Home | History | Annotate | Download | only in webapp
      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.
      4 
      5 // This file contains type definitions for the host plugin. It is used only
      6 // with JSCompiler to verify the type-correctness of our code.
      7 
      8 /** @suppress {duplicate} */
      9 var remoting = remoting || {};
     10 
     11 /** @constructor
     12  *  @extends HTMLElement
     13  */
     14 remoting.HostPlugin = function() {};
     15 
     16 /** @param {string} email The email address of the connector.
     17  *  @param {string} token The access token for the connector.
     18  *  @return {void} Nothing. */
     19 remoting.HostPlugin.prototype.connect = function(email, token) {};
     20 
     21 /** @return {void} Nothing. */
     22 remoting.HostPlugin.prototype.disconnect = function() {};
     23 
     24 /** @param {function(string):string} callback Pointer to chrome.i18n.getMessage.
     25  *  @return {void} Nothing. */
     26 remoting.HostPlugin.prototype.localize = function(callback) {};
     27 
     28 /** @param {function(string):void} callback Callback to be called with the
     29  *      local hostname.
     30  *  @return {void} Nothing. */
     31 remoting.HostPlugin.prototype.getHostName = function(callback) {};
     32 
     33 /** @param {string} hostId The host ID.
     34  *  @param {string} pin The PIN.
     35  *  @param {function(string):void} callback Callback to be called with the hash
     36  *      encoded with Base64.
     37  *  @return {void} Nothing. */
     38 remoting.HostPlugin.prototype.getPinHash = function(hostId, pin, callback) {};
     39 
     40 /** @param {function(string, string):void} callback Callback to be called
     41  *  after new key is generated.
     42  *  @return {void} Nothing. */
     43 remoting.HostPlugin.prototype.generateKeyPair = function(callback) {};
     44 
     45 /**
     46  * Updates host config with the values specified in |config|. All
     47  * fields that are not specified in |config| remain
     48  * unchanged. Following parameters cannot be changed using this
     49  * function: host_id, xmpp_login. Error is returned if |config|
     50  * includes these paramters. Changes take effect before the callback
     51  * is called.
     52  *
     53  * @param {string} config The new config parameters, JSON encoded dictionary.
     54  * @param {function(remoting.HostController.AsyncResult):void} callback
     55  *     Callback to be called when finished.
     56  * @return {void} Nothing. */
     57 remoting.HostPlugin.prototype.updateDaemonConfig =
     58     function(config, callback) {};
     59 
     60 /** @param {function(string):void} callback Callback to be called with
     61  *      the config.
     62  *  @return {void} Nothing. */
     63 remoting.HostPlugin.prototype.getDaemonConfig = function(callback) {};
     64 
     65 /** @param {function(string):void} callback Callback to be called with
     66  *      the version, as a dotted string.
     67  *  @return {void} Nothing. */
     68 remoting.HostPlugin.prototype.getDaemonVersion = function(callback) {};
     69 
     70 /** @param {function(boolean, boolean, boolean):void} callback Callback to be
     71  *      called with the consent.
     72  *  @return {void} Nothing. */
     73 remoting.HostPlugin.prototype.getUsageStatsConsent = function(callback) {};
     74 
     75 /** @param {string} config Host configuration.
     76  *  @param {function(remoting.HostController.AsyncResult):void} callback
     77  *     Callback to be called when finished.
     78  *  @return {void} Nothing. */
     79 remoting.HostPlugin.prototype.startDaemon = function(
     80     config, consent, callback) {};
     81 
     82 /** @param {function(remoting.HostController.AsyncResult):void} callback
     83  *     Callback to be called when finished.
     84  *  @return {void} Nothing. */
     85 remoting.HostPlugin.prototype.stopDaemon = function(callback) {};
     86 
     87 /** @param {function(string):void} callback Callback to be called with the
     88  *      JSON-encoded list of paired clients.
     89  *  @return {void} Nothing.
     90  */
     91 remoting.HostPlugin.prototype.getPairedClients = function(callback) {};
     92 
     93 /** @param {function(boolean):void} callback Callback to be called when
     94  *      finished.
     95  *  @return {void} Nothing.
     96  */
     97 remoting.HostPlugin.prototype.clearPairedClients = function(callback) {};
     98 
     99 /** @param {string} client Client id of the pairing to be deleted.
    100  *  @param {function(boolean):void} callback Callback to be called when
    101  *      finished.
    102  *  @return {void} Nothing.
    103  */
    104 remoting.HostPlugin.prototype.deletePairedClient = function(
    105     client, callback) {};
    106 
    107 /** @type {number} */ remoting.HostPlugin.prototype.state;
    108 
    109 /** @type {number} */ remoting.HostPlugin.prototype.STARTING;
    110 /** @type {number} */ remoting.HostPlugin.prototype.REQUESTED_ACCESS_CODE;
    111 /** @type {number} */ remoting.HostPlugin.prototype.RECEIVED_ACCESS_CODE;
    112 /** @type {number} */ remoting.HostPlugin.prototype.CONNECTED;
    113 /** @type {number} */ remoting.HostPlugin.prototype.DISCONNECTED;
    114 /** @type {number} */ remoting.HostPlugin.prototype.DISCONNECTING;
    115 /** @type {number} */ remoting.HostPlugin.prototype.ERROR;
    116 
    117 /** @type {string} */ remoting.HostPlugin.prototype.accessCode;
    118 /** @type {number} */ remoting.HostPlugin.prototype.accessCodeLifetime;
    119 
    120 /** @type {string} */ remoting.HostPlugin.prototype.client;
    121 
    122 /** @type {remoting.HostController.State} */
    123 remoting.HostPlugin.prototype.daemonState;
    124 
    125 /** @type {function(boolean):void} */
    126 remoting.HostPlugin.prototype.onNatTraversalPolicyChanged;
    127 
    128 /** @type {string} */ remoting.HostPlugin.prototype.xmppServerAddress;
    129 /** @type {boolean} */ remoting.HostPlugin.prototype.xmppServerUseTls;
    130 /** @type {string} */ remoting.HostPlugin.prototype.directoryBotJid;
    131 /** @type {string} */ remoting.HostPlugin.prototype.supportedFeatures;
    132