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 {function(remoting.HostController.AsyncResult):void} callback
101 * Callback to be called when finished.
102 * @return {void} Nothing. */
103 remoting.HostPlugin.prototype.installHost = function(callback) {};
105 /** @param {string} config Host configuration.
106 * @param {function(remoting.HostController.AsyncResult):void} callback
107 * Callback to be called when finished.
108 * @return {void} Nothing. */
109 remoting.HostPlugin.prototype.startDaemon = function(
110 config, consent, callback) {};
112 /** @param {function(remoting.HostController.AsyncResult):void} callback
113 * Callback to be called when finished.
114 * @return {void} Nothing. */
115 remoting.HostPlugin.prototype.stopDaemon = function(callback) {};
117 /** @param {function(string):void} callback Callback to be called with the
118 * JSON-encoded list of paired clients.
119 * @return {void} Nothing.
121 remoting.HostPlugin.prototype.getPairedClients = function(callback) {};
123 /** @param {function(boolean):void} callback Callback to be called when
125 * @return {void} Nothing.
127 remoting.HostPlugin.prototype.clearPairedClients = function(callback) {};
129 /** @param {string} client Client id of the pairing to be deleted.
130 * @param {function(boolean):void} callback Callback to be called when
132 * @return {void} Nothing.
134 remoting.HostPlugin.prototype.deletePairedClient = function(
135 client, callback) {};
137 /** @type {number} */ remoting.HostPlugin.prototype.state;
139 /** @type {number} */ remoting.HostPlugin.prototype.STARTING;
140 /** @type {number} */ remoting.HostPlugin.prototype.REQUESTED_ACCESS_CODE;
141 /** @type {number} */ remoting.HostPlugin.prototype.RECEIVED_ACCESS_CODE;
142 /** @type {number} */ remoting.HostPlugin.prototype.CONNECTED;
143 /** @type {number} */ remoting.HostPlugin.prototype.DISCONNECTED;
144 /** @type {number} */ remoting.HostPlugin.prototype.DISCONNECTING;
145 /** @type {number} */ remoting.HostPlugin.prototype.ERROR;
147 /** @type {string} */ remoting.HostPlugin.prototype.accessCode;
148 /** @type {number} */ remoting.HostPlugin.prototype.accessCodeLifetime;
150 /** @type {string} */ remoting.HostPlugin.prototype.client;
152 /** @type {remoting.HostController.State} */
153 remoting.HostPlugin.prototype.daemonState;
155 /** @type {function(boolean):void} */
156 remoting.HostPlugin.prototype.onNatTraversalPolicyChanged;
158 /** @type {string} */ remoting.HostPlugin.prototype.xmppServerAddress;
159 /** @type {boolean} */ remoting.HostPlugin.prototype.xmppServerUseTls;
160 /** @type {string} */ remoting.HostPlugin.prototype.directoryBotJid;
161 /** @type {string} */ remoting.HostPlugin.prototype.supportedFeatures;
165 * @extends HTMLEmbedElement
167 remoting.ViewerPlugin = function() { };
169 /** @param {string} message The message to send to the host. */
170 remoting.ViewerPlugin.prototype.postMessage = function(message) {};
175 remoting.WcsIqClient = function() {};
177 /** @param {function(Array.<string>): void} onMsg The function called when a
178 * message is received.
179 * @return {void} Nothing. */
180 remoting.WcsIqClient.prototype.setOnMessage = function(onMsg) {};
182 /** @return {void} Nothing. */
183 remoting.WcsIqClient.prototype.connectChannel = function() {};
185 /** @param {string} stanza An IQ stanza.
186 * @return {void} Nothing. */
187 remoting.WcsIqClient.prototype.sendIq = function(stanza) {};
189 /** @param {string} token An OAuth2 access token.
190 * @return {void} Nothing. */
191 remoting.WcsIqClient.prototype.updateAccessToken = function(token) {};