chromium/third_party/closure_compiler/interfaces/networking_private_interface.js

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file was generated by:
//   ./tools/json_schema_compiler/compiler.py.

/** @fileoverview Interface for networkingPrivate that can be overriden. */

/** @interface */
function NetworkingPrivate() {}

NetworkingPrivate.prototype = {
  /**
   * Gets all the properties of the network with id networkGuid. Includes all
   * properties of the network (read-only and read/write values).
   * @param {string} networkGuid The GUID of the network to get properties for.
   * @param {function(!chrome.networkingPrivate.NetworkProperties):void}
   *     callback Called with the network properties when received.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-getProperties
   */
  getProperties: function(networkGuid, callback) {},

  /**
   * Gets the merged properties of the network with id networkGuid from the
   * sources: User settings, shared settings, user policy, device policy and the
   * currently active settings.
   * @param {string} networkGuid The GUID of the network to get properties for.
   * @param {function(!chrome.networkingPrivate.ManagedProperties):void}
   *     callback Called with the managed network properties when received.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-getManagedProperties
   */
  getManagedProperties: function(networkGuid, callback) {},

  /**
   * Gets the cached read-only properties of the network with id networkGuid.
   * This is meant to be a higher performance function than
   * $(ref:getProperties), which requires a round trip to query the networking
   * subsystem. The following properties are returned for all networks: GUID,
   * Type, Name, WiFi.Security. Additional properties are provided for visible
   * networks: ConnectionState, ErrorState, WiFi.SignalStrength,
   * Cellular.NetworkTechnology, Cellular.ActivationState,
   * Cellular.RoamingState.
   * @param {string} networkGuid The GUID of the network to get properties for.
   * @param {function(!chrome.networkingPrivate.NetworkStateProperties):void}
   *     callback Called immediately with the network state properties.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-getState
   */
  getState: function(networkGuid, callback) {},

  /**
   * Sets the properties of the network with id networkGuid.
   * @param {string} networkGuid The GUID of the network to set properties for.
   * @param {!chrome.networkingPrivate.NetworkConfigProperties} properties The
   *     properties to set.
   * @param {function():void=} callback Called when the operation has completed.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-setProperties
   */
  setProperties: function(networkGuid, properties, callback) {},

  /**
   * Creates a new network configuration from properties. If a matching
   * configured network already exists, this will fail. Otherwise returns the
   * guid of the new network.
   * @param {boolean} shared If true, share this network configuration with
   *     other users.
   * @param {!chrome.networkingPrivate.NetworkConfigProperties} properties The
   *     properties to configure the new network with.
   * @param {function(string):void=} callback Called with the GUID for the new
   *     network configuration once     the network has been created.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-createNetwork
   */
  createNetwork: function(shared, properties, callback) {},

  /**
   * Forgets a network configuration by clearing any configured properties for
   * the network with GUID 'networkGuid'. This may also include any other
   * networks with matching identifiers (e.g. WiFi SSID and Security). If no
   * such configuration exists, an error will be set and the operation will
   * fail.
   * @param {string} networkGuid The GUID of the network to forget.
   * @param {function():void=} callback Called when the operation has completed.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-forgetNetwork
   */
  forgetNetwork: function(networkGuid, callback) {},

  /**
   * Returns a list of network objects with the same properties provided by
   * $(ref:networkingPrivate.getState). A filter is provided to specify the type
   * of networks returned and to limit the number of networks. Networks are
   * ordered by the system based on their priority, with connected or connecting
   * networks listed first.
   * @param {!chrome.networkingPrivate.NetworkFilter} filter Describes which
   *     networks to return.
   * @param {function(!Array<!chrome.networkingPrivate.NetworkStateProperties>):void}
   *     callback Called with a dictionary of networks and their state
   *     properties when received.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-getNetworks
   */
  getNetworks: function(filter, callback) {},

  /**
   * Returns a list of $(ref:networkingPrivate.DeviceStateProperties) objects.
   * @param {function(!Array<!chrome.networkingPrivate.DeviceStateProperties>):void}
   *     callback Called with a list of devices and their state.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-getDeviceStates
   */
  getDeviceStates: function(callback) {},

  /**
   * Enables any devices matching the specified network type. Note, the type
   * might represent multiple network types (e.g. 'Wireless').
   * @param {!chrome.networkingPrivate.NetworkType} networkType The type of
   *     network to enable.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-enableNetworkType
   */
  enableNetworkType: function(networkType) {},

  /**
   * Disables any devices matching the specified network type. See note for
   * $(ref:networkingPrivate.enableNetworkType).
   * @param {!chrome.networkingPrivate.NetworkType} networkType The type of
   *     network to disable.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-disableNetworkType
   */
  disableNetworkType: function(networkType) {},

  /**
   * Requests that the networking subsystem scan for new networks and update the
   * list returned by $(ref:getVisibleNetworks). This is only a request: the
   * network subsystem can choose to ignore it.  If the list is updated, then
   * the $(ref:onNetworkListChanged) event will be fired.
   * @param {!chrome.networkingPrivate.NetworkType=} networkType If provided,
   *     requests a scan specific to the type.     For Cellular a mobile network
   *     scan will be requested if supported.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-requestNetworkScan
   */
  requestNetworkScan: function(networkType) {},

  /**
   * Starts a connection to the network with networkGuid.
   * @param {string} networkGuid The GUID of the network to connect to.
   * @param {function():void=} callback Called when the connect request has been
   *     sent. Note: the     connection may not have completed. Observe
   *     $(ref:onNetworksChanged)     to be notified when a network state
   *     changes.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-startConnect
   */
  startConnect: function(networkGuid, callback) {},

  /**
   * Starts a disconnect from the network with networkGuid.
   * @param {string} networkGuid The GUID of the network to disconnect from.
   * @param {function():void=} callback Called when the disconnect request has
   *     been sent. See note     for $(ref:startConnect).
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-startDisconnect
   */
  startDisconnect: function(networkGuid, callback) {},

  /**
   * Starts activation of the Cellular network with networkGuid. If called for a
   * network that is already activated, or for a network with a carrier that can
   * not be directly activated, this will show the account details page for the
   * carrier if possible.
   * @param {string} networkGuid The GUID of the Cellular network to activate.
   * @param {string=} carrier Optional name of carrier to activate.
   * @param {function():void=} callback Called when the activation request has
   *     been sent. See note     for $(ref:startConnect).
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-startActivate
   */
  startActivate: function(networkGuid, carrier, callback) {},

  /**
   * Returns captive portal status for the network matching 'networkGuid'.
   * @param {string} networkGuid The GUID of the network to get captive portal
   *     status for.
   * @param {function(!chrome.networkingPrivate.CaptivePortalStatus):void}
   *     callback A callback function that returns the results of the query for
   *     network captive portal status.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-getCaptivePortalStatus
   */
  getCaptivePortalStatus: function(networkGuid, callback) {},

  /**
   * Unlocks a Cellular SIM card. * If the SIM is PIN locked, |pin| will be used
   * to unlock the SIM and   the |puk| argument will be ignored if provided. *
   * If the SIM is PUK locked, |puk| and |pin| must be provided. If the
   * operation succeeds (|puk| is valid), the PIN will be set to |pin|.   (If
   * |pin| is empty or invalid the operation will fail).
   * @param {string} networkGuid The GUID of the cellular network to unlock.
   *     If empty, the default cellular device will be used.
   * @param {string} pin The current SIM PIN, or the new PIN if PUK is provided.
   * @param {string=} puk The operator provided PUK for unblocking a blocked
   *     SIM.
   * @param {function():void=} callback Called when the operation has completed.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-unlockCellularSim
   */
  unlockCellularSim: function(networkGuid, pin, puk, callback) {},

  /**
   * Sets whether or not SIM locking is enabled (i.e a PIN will be required when
   * the device is powered) and changes the PIN if a new PIN is specified. If
   * the new PIN is provided but not valid (e.g. too short) the operation will
   * fail. This will not lock the SIM; that is handled automatically by the
   * device. NOTE: If the SIM is locked, it must first be unlocked with
   * unlockCellularSim() before this can be called (otherwise it will fail and
   * chrome.runtime.lastError will be set to Error.SimLocked).
   * @param {string} networkGuid The GUID of the cellular network to set the SIM
   *     state of.     If empty, the default cellular device will be used.
   * @param {!chrome.networkingPrivate.CellularSimState} simState The SIM state
   *     to set.
   * @param {function():void=} callback Called when the operation has completed.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-setCellularSimState
   */
  setCellularSimState: function(networkGuid, simState, callback) {},

  /**
   * Selects which Cellular Mobile Network to use. |networkId| must be the
   * NetworkId property of a member of Cellular.FoundNetworks from the network
   * properties for the specified Cellular network.
   * @param {string} networkGuid The GUID of the cellular network to select the
   *     network     for. If empty, the default cellular device will be used.
   * @param {string} networkId The networkId to select.
   * @param {function():void=} callback Called when the operation has completed.
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-selectCellularMobileNetwork
   */
  selectCellularMobileNetwork: function(networkGuid, networkId, callback) {},

  /**
   * Gets the global policy properties. These properties are not expected to
   * change during a session.
   * @param {function(!chrome.networkingPrivate.GlobalPolicy):void} callback
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-getGlobalPolicy
   */
  getGlobalPolicy: function(callback) {},

  /**
   * Gets the lists of certificates available for network configuration.
   * @param {function(!chrome.networkingPrivate.CertificateLists):void} callback
   * @see https://developer.chrome.com/extensions/networkingPrivate#method-getCertificateLists
   */
  getCertificateLists: function(callback) {},
};

/**
 * Fired when the properties change on any of the networks.  Sends a list of
 * GUIDs for networks whose properties have changed.
 * @type {!ChromeEvent}
 * @see https://developer.chrome.com/extensions/networkingPrivate#event-onNetworksChanged
 */
NetworkingPrivate.prototype.onNetworksChanged;

/**
 * Fired when the list of networks has changed.  Sends a complete list of GUIDs
 * for all the current networks.
 * @type {!ChromeEvent}
 * @see https://developer.chrome.com/extensions/networkingPrivate#event-onNetworkListChanged
 */
NetworkingPrivate.prototype.onNetworkListChanged;

/**
 * Fired when the list of devices has changed or any device state properties
 * have changed.
 * @type {!ChromeEvent}
 * @see https://developer.chrome.com/extensions/networkingPrivate#event-onDeviceStateListChanged
 */
NetworkingPrivate.prototype.onDeviceStateListChanged;

/**
 * Fired when a portal detection for a network completes. Sends the guid of the
 * network and the corresponding captive portal status.
 * @type {!ChromeEvent}
 * @see https://developer.chrome.com/extensions/networkingPrivate#event-onPortalDetectionCompleted
 */
NetworkingPrivate.prototype.onPortalDetectionCompleted;

/**
 * Fired when any certificate list has changed.
 * @type {!ChromeEvent}
 * @see https://developer.chrome.com/extensions/networkingPrivate#event-onCertificateListsChanged
 */
NetworkingPrivate.prototype.onCertificateListsChanged;