remove @types/chromecast-caf-sender (#5537)

To prevent a collusion with `@types/chromecast-caf-receiver` that would make `lit-analyzer` fail.
This commit is contained in:
Bram Kragten 2020-04-14 20:25:03 +02:00 committed by GitHub
parent 4f9d77b906
commit 3d20d8b208
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 12 deletions

View File

@ -52,6 +52,7 @@ class CastDemoRow extends LitElement implements LovelaceRow {
}); });
mgr.castContext.addEventListener( mgr.castContext.addEventListener(
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
// @ts-ignore
cast.framework.CastContextEventType.SESSION_STATE_CHANGED, cast.framework.CastContextEventType.SESSION_STATE_CHANGED,
(ev) => { (ev) => {
// On Android, opening a new session always results in SESSION_RESUMED. // On Android, opening a new session always results in SESSION_RESUMED.

View File

@ -128,7 +128,6 @@
"@babel/preset-typescript": "^7.9.0", "@babel/preset-typescript": "^7.9.0",
"@types/chai": "^4.1.7", "@types/chai": "^4.1.7",
"@types/chromecast-caf-receiver": "^3.0.12", "@types/chromecast-caf-receiver": "^3.0.12",
"@types/chromecast-caf-sender": "^1.0.1",
"@types/codemirror": "^0.0.78", "@types/codemirror": "^0.0.78",
"@types/hls.js": "^0.12.3", "@types/hls.js": "^0.12.3",
"@types/js-yaml": "^3.12.1", "@types/js-yaml": "^3.12.1",

View File

@ -1,8 +1,4 @@
/* eslint-disable no-undef, no-console */ /* eslint-disable no-undef, no-console */
import {
CastStateEventData,
SessionStateEventData,
} from "chromecast-caf-receiver/cast.framework";
import { Auth } from "home-assistant-js-websocket"; import { Auth } from "home-assistant-js-websocket";
import { castApiAvailable } from "./cast_framework"; import { castApiAvailable } from "./cast_framework";
import { CAST_APP_ID, CAST_DEV, CAST_NS } from "./const"; import { CAST_APP_ID, CAST_DEV, CAST_NS } from "./const";
@ -48,10 +44,12 @@ export class CastManager {
autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED, autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,
}); });
context.addEventListener( context.addEventListener(
// @ts-ignore
cast.framework.CastContextEventType.SESSION_STATE_CHANGED, cast.framework.CastContextEventType.SESSION_STATE_CHANGED,
(ev) => this._sessionStateChanged(ev) (ev) => this._sessionStateChanged(ev)
); );
context.addEventListener( context.addEventListener(
// @ts-ignore
cast.framework.CastContextEventType.CAST_STATE_CHANGED, cast.framework.CastContextEventType.CAST_STATE_CHANGED,
(ev) => this._castStateChanged(ev) (ev) => this._castStateChanged(ev)
); );
@ -92,6 +90,7 @@ export class CastManager {
} }
public get castContext() { public get castContext() {
// @ts-ignore
return cast.framework.CastContext.getInstance(); return cast.framework.CastContext.getInstance();
} }
@ -119,7 +118,7 @@ export class CastManager {
} }
} }
private _sessionStateChanged(ev: SessionStateEventData) { private _sessionStateChanged(ev) {
if (__DEV__) { if (__DEV__) {
console.log("Cast session state changed", ev.sessionState); console.log("Cast session state changed", ev.sessionState);
} }
@ -142,7 +141,7 @@ export class CastManager {
} }
} }
private _castStateChanged(ev: CastStateEventData) { private _castStateChanged(ev) {
if (__DEV__) { if (__DEV__) {
console.log("Cast state changed", ev.castState); console.log("Cast state changed", ev.castState);
} }

View File

@ -2536,11 +2536,6 @@
resolved "https://registry.yarnpkg.com/@types/chromecast-caf-receiver/-/chromecast-caf-receiver-3.0.12.tgz#0172edc5e43a0b4f426b21a614a58e04e3df009d" resolved "https://registry.yarnpkg.com/@types/chromecast-caf-receiver/-/chromecast-caf-receiver-3.0.12.tgz#0172edc5e43a0b4f426b21a614a58e04e3df009d"
integrity sha512-GdR9nGOENDWYhF40FasB0Xnsy3c+e68K90sGVBZx1W1N3LP1NGOmCtaxgUpxk4IuHYmzGrW7I57zWZIbT3D5BQ== integrity sha512-GdR9nGOENDWYhF40FasB0Xnsy3c+e68K90sGVBZx1W1N3LP1NGOmCtaxgUpxk4IuHYmzGrW7I57zWZIbT3D5BQ==
"@types/chromecast-caf-sender@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@types/chromecast-caf-sender/-/chromecast-caf-sender-1.0.1.tgz#da0047c41c2a7ecf2d5348715b27c4542ed9b579"
integrity sha512-/JuG+zrS+KCPwEiOrK9O7WrIMyiUEF7Ev9ywbzXcCOPkXin9tLX7w9zxCmxtnOPdgH9lZbtOvgo5IA4cEJknRg==
"@types/clean-css@*": "@types/clean-css@*":
version "4.2.1" version "4.2.1"
resolved "https://registry.yarnpkg.com/@types/clean-css/-/clean-css-4.2.1.tgz#cb0134241ec5e6ede1b5344bc829668fd9871a8d" resolved "https://registry.yarnpkg.com/@types/clean-css/-/clean-css-4.2.1.tgz#cb0134241ec5e6ede1b5344bc829668fd9871a8d"