1 // Copyright (c) 2012 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 type definitions for various remoting classes.
6 // It is used only with JSCompiler to verify the type-correctness of our code.
8 /** @suppress {duplicate} */
9 var remoting = remoting || {};
14 remoting.ClipboardData = function() {};
16 /** @type {Array.<string>} */
17 remoting.ClipboardData.prototype.types;
19 /** @type {function(string): string} */
20 remoting.ClipboardData.prototype.getData;
22 /** @type {function(string, string): void} */
23 remoting.ClipboardData.prototype.setData;
27 remoting.ClipboardEvent = function() {};
29 /** @type {remoting.ClipboardData} */
30 remoting.ClipboardEvent.prototype.clipboardData;
32 /** @type {function(): void} */
33 remoting.ClipboardEvent.prototype.preventDefault;
37 * @extends HTMLElement
39 remoting.HostPlugin = function() {};
41 /** @param {string} email The email address of the connector.
42 * @param {string} token The access token for the connector.
43 * @return {void} Nothing. */
44 remoting.HostPlugin.prototype.connect = function(email, token) {};
46 /** @return {void} Nothing. */
47 remoting.HostPlugin.prototype.disconnect = function() {};
49 /** @param {function(string):string} callback Pointer to chrome.i18n.getMessage.
50 * @return {void} Nothing. */
51 remoting.HostPlugin.prototype.localize = function(callback) {};
53 /** @param {function(string):void} callback Callback to be called with the
55 * @return {void} Nothing. */
56 remoting.HostPlugin.prototype.getHostName = function(callback) {};
58 /** @param {string} hostId The host ID.
59 * @param {string} pin The PIN.
60 * @param {function(string):void} callback Callback to be called with the hash
61 * encoded with Base64.
62 * @return {void} Nothing. */
63 remoting.HostPlugin.prototype.getPinHash = function(hostId, pin, callback) {};
65 /** @param {function(string, string):void} callback Callback to be called
66 * after new key is generated.
67 * @return {void} Nothing. */
68 remoting.HostPlugin.prototype.generateKeyPair = function(callback) {};
71 * Updates host config with the values specified in |config|. All
72 * fields that are not specified in |config| remain
73 * unchanged. Following parameters cannot be changed using this
74 * function: host_id, xmpp_login. Error is returned if |config|
75 * includes these paramters. Changes take effect before the callback
78 * @param {string} config The new config parameters, JSON encoded dictionary.
79 * @param {function(remoting.HostController.AsyncResult):void} callback
80 * Callback to be called when finished.
81 * @return {void} Nothing. */
82 remoting.HostPlugin.prototype.updateDaemonConfig =
83 function(config, callback) {};
85 /** @param {function(string):void} callback Callback to be called with
87 * @return {void} Nothing. */
88 remoting.HostPlugin.prototype.getDaemonConfig = function(callback) {};
90 /** @param {function(string):void} callback Callback to be called with
91 * the version, as a dotted string.
92 * @return {void} Nothing. */
93 remoting.HostPlugin.prototype.getDaemonVersion = function(callback) {};
95 /** @param {function(boolean, boolean, boolean):void} callback Callback to be
96 * called with the consent.
97 * @return {void} Nothing. */
98 remoting.HostPlugin.prototype.getUsageStatsConsent = function(callback) {};
100 /** @param {string} config Host configuration.
101 * @param {function(remoting.HostController.AsyncResult):void} callback
102 * Callback to be called when finished.
103 * @return {void} Nothing. */
104 remoting.HostPlugin.prototype.startDaemon = function(
105 config, consent, callback) {};
107 /** @param {function(remoting.HostController.AsyncResult):void} callback
108 * Callback to be called when finished.
109 * @return {void} Nothing. */
110 remoting.HostPlugin.prototype.stopDaemon = function(callback) {};
112 /** @param {function(string):void} callback Callback to be called with the
113 * JSON-encoded list of paired clients.
114 * @return {void} Nothing.
116 remoting.HostPlugin.prototype.getPairedClients = function(callback) {};
118 /** @param {function(boolean):void} callback Callback to be called when
120 * @return {void} Nothing.
122 remoting.HostPlugin.prototype.clearPairedClients = function(callback) {};
124 /** @param {string} client Client id of the pairing to be deleted.
125 * @param {function(boolean):void} callback Callback to be called when
127 * @return {void} Nothing.
129 remoting.HostPlugin.prototype.deletePairedClient = function(
130 client, callback) {};
132 /** @type {number} */ remoting.HostPlugin.prototype.state;
134 /** @type {number} */ remoting.HostPlugin.prototype.STARTING;
135 /** @type {number} */ remoting.HostPlugin.prototype.REQUESTED_ACCESS_CODE;
136 /** @type {number} */ remoting.HostPlugin.prototype.RECEIVED_ACCESS_CODE;
137 /** @type {number} */ remoting.HostPlugin.prototype.CONNECTED;
138 /** @type {number} */ remoting.HostPlugin.prototype.DISCONNECTED;
139 /** @type {number} */ remoting.HostPlugin.prototype.DISCONNECTING;
140 /** @type {number} */ remoting.HostPlugin.prototype.ERROR;
142 /** @type {string} */ remoting.HostPlugin.prototype.accessCode;
143 /** @type {number} */ remoting.HostPlugin.prototype.accessCodeLifetime;
145 /** @type {string} */ remoting.HostPlugin.prototype.client;
147 /** @type {remoting.HostController.State} */
148 remoting.HostPlugin.prototype.daemonState;
150 /** @type {function(boolean):void} */
151 remoting.HostPlugin.prototype.onNatTraversalPolicyChanged;
153 /** @type {string} */ remoting.HostPlugin.prototype.xmppServerAddress;
154 /** @type {boolean} */ remoting.HostPlugin.prototype.xmppServerUseTls;
155 /** @type {string} */ remoting.HostPlugin.prototype.directoryBotJid;
156 /** @type {string} */ remoting.HostPlugin.prototype.supportedFeatures;
160 * @extends HTMLEmbedElement
162 remoting.ViewerPlugin = function() { };
164 /** @param {string} message The message to send to the host. */
165 remoting.ViewerPlugin.prototype.postMessage = function(message) {};
170 remoting.WcsIqClient = function() {};
172 /** @param {function(Array.<string>): void} onMsg The function called when a
173 * message is received.
174 * @return {void} Nothing. */
175 remoting.WcsIqClient.prototype.setOnMessage = function(onMsg) {};
177 /** @return {void} Nothing. */
178 remoting.WcsIqClient.prototype.connectChannel = function() {};
180 /** @param {string} stanza An IQ stanza.
181 * @return {void} Nothing. */
182 remoting.WcsIqClient.prototype.sendIq = function(stanza) {};
184 /** @param {string} token An OAuth2 access token.
185 * @return {void} Nothing. */
186 remoting.WcsIqClient.prototype.updateAccessToken = function(token) {};