1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file contains various hacks needed to inform JSCompiler of various
6 // WebKit- and Chrome-specific properties and methods. It is used only with
7 // JSCompiler to verify the type-correctness of our code.
13 chrome
.cast
.AutoJoinPolicy = function() {};
15 /** @type {chrome.cast.AutoJoinPolicy} */
16 chrome
.cast
.AutoJoinPolicy
.PAGE_SCOPED
;
18 /** @type {chrome.cast.AutoJoinPolicy} */
19 chrome
.cast
.AutoJoinPolicy
.ORIGIN_SCOPED
;
21 /** @type {chrome.cast.AutoJoinPolicy} */
22 chrome
.cast
.AutoJoinPolicy
.TAB_AND_ORIGIN_SCOPED
;
25 chrome
.cast
.DefaultActionPolicy = function() {};
27 /** @type {chrome.cast.DefaultActionPolicy} */
28 chrome
.cast
.DefaultActionPolicy
.CAST_THIS_TAB
;
30 /** @type {chrome.cast.DefaultActionPolicy} */
31 chrome
.cast
.DefaultActionPolicy
.CREATE_SESSION
;
34 chrome
.cast
.Error = function() {};
37 chrome
.cast
.ReceiverAvailability = function() {};
39 /** @type {chrome.cast.ReceiverAvailability} */
40 chrome
.cast
.ReceiverAvailability
.AVAILABLE
;
42 /** @type {chrome.cast.ReceiverAvailability} */
43 chrome
.cast
.ReceiverAvailability
.UNAVAILABLE
;
46 chrome
.cast
.media
= {};
49 chrome
.cast
.media
.Media = function() {
51 this.mediaSessionId
= 0;
55 chrome
.cast
.Session = function() {
56 /** @type {Array<chrome.cast.media.Media>} */
64 * @param {string} namespace
65 * @param {Object} message
66 * @param {function():void} successCallback
67 * @param {function(chrome.cast.Error):void} errorCallback
69 chrome
.cast
.Session
.prototype.sendMessage
=
70 function(namespace, message
, successCallback
, errorCallback
) {};
73 * @param {function(chrome.cast.media.Media):void} listener
75 chrome
.cast
.Session
.prototype.addMediaListener = function(listener
) {};
78 * @param {function(boolean):void} listener
80 chrome
.cast
.Session
.prototype.addUpdateListener = function(listener
) {};
83 * @param {string} namespace
84 * @param {function(string, string):void} listener
86 chrome
.cast
.Session
.prototype.addMessageListener
=
87 function(namespace, listener
){};
90 * @param {function():void} successCallback
91 * @param {function(chrome.cast.Error):void} errorCallback
93 chrome
.cast
.Session
.prototype.stop
=
94 function(successCallback
, errorCallback
) {};
98 * @param {string} applicationID
100 chrome
.cast
.SessionRequest = function(applicationID
) {};
104 * @param {chrome.cast.SessionRequest} sessionRequest
105 * @param {function(chrome.cast.Session):void} sessionListener
106 * @param {function(chrome.cast.ReceiverAvailability):void} receiverListener
107 * @param {chrome.cast.AutoJoinPolicy=} opt_autoJoinPolicy
108 * @param {chrome.cast.DefaultActionPolicy=} opt_defaultActionPolicy
110 chrome
.cast
.ApiConfig = function(sessionRequest
,
114 opt_defaultActionPolicy
) {};
117 * @param {chrome.cast.ApiConfig} apiConfig
118 * @param {function():void} onInitSuccess
119 * @param {function(chrome.cast.Error):void} onInitError
121 chrome
.cast
.initialize
=
122 function(apiConfig
, onInitSuccess
, onInitError
) {};
125 * @param {function(chrome.cast.Session):void} successCallback
126 * @param {function(chrome.cast.Error):void} errorCallback
128 chrome
.cast
.requestSession
=
129 function(successCallback
, errorCallback
) {};