Added/Updated networking.config /w docs

This commit is contained in:
Fredrik Høisæther Rasch
2015-08-26 16:35:12 +02:00
parent f1f2218618
commit 9ca8cfcfe8

60
chrome/chrome.d.ts vendored
View File

@@ -4587,6 +4587,66 @@ declare module chrome.management {
var onEnabled: ManagementEnabledEvent;
}
////////////////////
// Notifications
////////////////////
/**
* Use the networking.config API to authenticate to captive portals.
* Permissions: "networking.config"
* Important: This API works only on Chrome OS.
* @since Chrome 43.
*/
declare module chrome.networking.config {
interface NetworkInfo {
/** Currently only WiFi supported. */
Type: string;
/** Optional. A unique identifier of the network. */
GUID?: string;
/** Optional. A hex-encoded byte sequence. */
HexSSID?: string;
/** Optional. The decoded SSID of the network (default encoding is UTF-8). To filter for non-UTF-8 SSIDs, use HexSSID instead. */
SSID?: string;
/** Optional. The basic service set identification (BSSID) uniquely identifying the basic service set. BSSID is represented as a human readable, hex-encoded string with bytes separated by colons, e.g. 45:67:89:ab:cd:ef. */
BSSID?: string;
/** Optional. Identifier indicating the security type of the network. Valid values are None, WEP-PSK, WPA-PSK and WPA-EAP. */
Security?: string;
}
interface CaptivePorttalDetectedEvent extends chrome.events.Event {
/**
* @param callback The callback parameter should be a function that looks like this:
* function( NetworkInfo networkInfo) {...};
* Parameter networkInfo: Information about the network on which a captive portal was detected.
*/
addListener(callback: (networkInfo: NetworkInfo) => void): void;
}
/**
* Allows an extension to define network filters for the networks it can handle. A call to this function will remove all filters previously installed by the extension before setting the new list.
* @param networks Network filters to set. Every NetworkInfo must either have the SSID or HexSSID set. Other fields will be ignored.
* @param callback Called back when this operation is finished.
* The callback parameter should be a function that looks like this:
* function() {...};
*/
export function setNetworkFilter(networks: NetworkInfo[], callback: () => void): void;
/**
* Called by the extension to notify the network config API that it finished a captive portal authentication attempt and hand over the result of the attempt. This function must only be called with the GUID of the latest onCaptivePortalDetected event.
* @param GUID Unique network identifier obtained from onCaptivePortalDetected.
* @param result The result of the authentication attempt.
* unhandled: The extension does not handle this network or captive portal (e.g. server end-point not found or not compatible).
* succeeded: The extension handled this network and authenticated successfully.
* rejected: The extension handled this network, tried to authenticate, however was rejected by the server.
* failed: The extension handled this network, tried to authenticate, however failed due to an unspecified error.
* @param callback Called back when this operation is finished.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
export function finishAuthentication(GUID: string, result: string, callback?: () => void): void;
/** This event fires everytime a captive portal is detected on a network matching any of the currently registered network filters and the user consents to use the extension for authentication. Network filters may be set using the setNetworkFilter. Upon receiving this event the extension should start its authentication attempt with the captive portal. When the extension finishes its attempt, it must call finishAuthentication with the GUID received with this event and the appropriate authentication result. */
var onCaptivePortalDetected: CaptivePorttalDetectedEvent;
}
////////////////////
// Notifications
// https://developer.chrome.com/extensions/notifications