From ad07ff4d74b8b4ffa35f3c847d533181a9260247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20C=C3=B4t=C3=A9-Roy?= Date: Tue, 27 Aug 2019 14:32:47 -0400 Subject: [PATCH] chromecast-caf-sender: add __onGCastApiAvailable (#37937) * chromecast-caf-sender: add __onGCastApiAvailable * PR fixes --- types/chromecast-caf-sender/chromecast-caf-sender-tests.ts | 4 ++++ types/chromecast-caf-sender/index.d.ts | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/chromecast-caf-sender/chromecast-caf-sender-tests.ts b/types/chromecast-caf-sender/chromecast-caf-sender-tests.ts index b8e699ffd4..b4b0286636 100644 --- a/types/chromecast-caf-sender/chromecast-caf-sender-tests.ts +++ b/types/chromecast-caf-sender/chromecast-caf-sender-tests.ts @@ -1,6 +1,10 @@ +/// + cast.framework.VERSION === "1.0.06"; cast.framework.setLoggerLevel(cast.framework.LoggerLevel.DEBUG); +window.__onGCastApiAvailable = (available: boolean) => {}; + const context = cast.framework.CastContext.getInstance(); context.getCastState() === cast.framework.CastState.CONNECTED; context.getSessionState() === cast.framework.SessionState.NO_SESSION; diff --git a/types/chromecast-caf-sender/index.d.ts b/types/chromecast-caf-sender/index.d.ts index 10f2845316..5200d0fbc6 100644 --- a/types/chromecast-caf-sender/index.d.ts +++ b/types/chromecast-caf-sender/index.d.ts @@ -2,7 +2,7 @@ // Project: https://developers.google.com/cast/docs/caf_receiver_overview // Definitions by: Samuel Maddock // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 3.0 /// @@ -11,6 +11,7 @@ //////////////////// interface Window { cast: typeof cast; + __onGCastApiAvailable(available: boolean): void; } ////////////////////