diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-02-29 18:03:02 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-02-29 18:03:02 +0100 |
commit | c962e9402123900c53967c14cf809ea10576cdb8 (patch) | |
tree | e7df9cfdd6fceae30fb99c8ec6be5e07c8b153a8 /lib/decl | |
parent | 30ee3320c788129b258ed8b42f4fc63d28431e2f (diff) |
restructure
Diffstat (limited to 'lib/decl')
-rwxr-xr-x | lib/decl/chrome/chrome.d.ts | 8231 | ||||
-rw-r--r-- | lib/decl/filesystem/filesystem.d.ts | 548 | ||||
-rw-r--r-- | lib/decl/filewriter/filewriter.d.ts | 176 | ||||
-rw-r--r-- | lib/decl/handlebars/handlebars-1.0.0.d.ts | 184 | ||||
-rw-r--r-- | lib/decl/handlebars/handlebars.d.ts | 227 | ||||
-rw-r--r-- | lib/decl/jquery/jquery.d.ts | 3190 | ||||
-rw-r--r-- | lib/decl/lib.es6.d.ts | 18634 | ||||
-rw-r--r-- | lib/decl/lodash.d.ts | 16525 | ||||
-rw-r--r-- | lib/decl/mithril.d.ts | 926 | ||||
-rw-r--r-- | lib/decl/node.d.ts | 2178 | ||||
-rw-r--r-- | lib/decl/systemjs/systemjs.d.ts | 20 | ||||
-rw-r--r-- | lib/decl/urijs/URIjs.d.ts | 236 | ||||
-rw-r--r-- | lib/decl/webrtc/MediaStream.d.ts | 199 |
13 files changed, 51274 insertions, 0 deletions
diff --git a/lib/decl/chrome/chrome.d.ts b/lib/decl/chrome/chrome.d.ts new file mode 100755 index 000000000..77d2898fd --- /dev/null +++ b/lib/decl/chrome/chrome.d.ts @@ -0,0 +1,8231 @@ +// Type definitions for Chrome extension development +// Project: http://developer.chrome.com/extensions/ +// Definitions by: Matthew Kimber <https://github.com/matthewkimber>, otiai10 <https://github.com/otiai10>, couven92 <https://github.com/couven92> +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// <reference path='../webrtc/MediaStream.d.ts'/> +/// <reference path='../filesystem/filesystem.d.ts' /> + +//////////////////// +// Global object +//////////////////// +interface Window { + chrome: typeof chrome; +} + +//////////////////// +// Accessibility Features +//////////////////// +/** + * Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. This API relies on the ChromeSetting prototype of the type API for getting and setting individual accessibility features. In order to get feature states the extension must request accessibilityFeatures.read permission. For modifying feature state, the extension needs accessibilityFeatures.modify permission. Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read permission. + * Availability: Since Chrome 37. + * Permissions: "accessibilityFeatures.read" + * Important: This API works only on Chrome OS. + */ +declare module chrome.accessibilityFeatures { + interface AccessibilityFeaturesGetArg { + /** Optional. Whether to return the value that applies to the incognito session (default false). */ + incognito?: boolean; + } + + interface AccessibilityFeaturesCallbackArg { + /** The value of the setting. */ + value: any; + /** + * One of + * • not_controllable: cannot be controlled by any extension + * • controlled_by_other_extensions: controlled by extensions with higher precedence + * • controllable_by_this_extension: can be controlled by this extension + * • controlled_by_this_extension: controlled by this extension + */ + levelOfControl: string; + /** Optional. Whether the effective value is specific to the incognito session. This property will only be present if the incognito property in the details parameter of get() was true. */ + incognitoSpecific?: boolean; + } + + interface AccessibilityFeaturesSetArg { + /** + * The value of the setting. + * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type. + */ + value: any; + /** + * Optional. + * The scope of the ChromeSetting. One of + * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), + * • regular_only: setting for the regular profile only (not inherited by the incognito profile), + * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), + * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). + */ + scope?: string; + } + + interface AccessibilityFeaturesClearArg { + /** + * Optional. + * The scope of the ChromeSetting. One of + * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), + * • regular_only: setting for the regular profile only (not inherited by the incognito profile), + * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), + * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). + */ + scope?: string; + } + + interface AccessibilityFeaturesSetting { + /** + * Gets the value of a setting. + * @param details Which setting to consider. + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; + */ + get(details: AccessibilityFeaturesGetArg, callback: (details: AccessibilityFeaturesCallbackArg) => void): void; + /** + * Sets the value of a setting. + * @param details Which setting to change. + * @param callback Called at the completion of the set operation. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + set(details: AccessibilityFeaturesSetArg, callback?: () => void): void; + /** + * Clears the setting, restoring any default value. + * @param details Which setting to clear. + * @param callback Called at the completion of the clear operation. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + clear(details: AccessibilityFeaturesClearArg, callback?: () => void): void; + } + + var spokenFeedback: AccessibilityFeaturesSetting; + var largeCursor: AccessibilityFeaturesSetting; + var stickyKeys: AccessibilityFeaturesSetting; + var highContrast: AccessibilityFeaturesSetting; + var screenMagnifier: AccessibilityFeaturesSetting; + var autoclick: AccessibilityFeaturesSetting; + var virtualKeyboard: AccessibilityFeaturesSetting; + var animationPolicy: AccessibilityFeaturesSetting; +} + +//////////////////// +// Alarms +//////////////////// +/** + * Use the chrome.alarms API to schedule code to run periodically or at a specified time in the future. + * Availability: Since Chrome 22. + * Permissions: "alarms" + */ +declare module chrome.alarms { + interface AlarmCreateInfo { + /** Optional. Length of time in minutes after which the onAlarm event should fire. */ + delayInMinutes?: number; + /** Optional. If set, the onAlarm event should fire every periodInMinutes minutes after the initial event specified by when or delayInMinutes. If not set, the alarm will only fire once. */ + periodInMinutes?: number; + /** Optional. Time at which the alarm should fire, in milliseconds past the epoch (e.g. Date.now() + n). */ + when?: number; + } + + interface Alarm { + /** Optional. If not null, the alarm is a repeating alarm and will fire again in periodInMinutes minutes. */ + periodInMinutes?: number; + /** Time at which this alarm was scheduled to fire, in milliseconds past the epoch (e.g. Date.now() + n). For performance reasons, the alarm may have been delayed an arbitrary amount beyond this. */ + scheduledTime: number; + /** Name of this alarm. */ + name: string; + } + + interface AlarmEvent extends chrome.events.Event { + /** + * The callback parameter should be a function that looks like this: + * function( Alarm alarm) {...}; + */ + addListener(callback: (alarm: Alarm) => void): void; + } + + /** + * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm. + * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute. + * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire. + * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes. + */ + export function create(alarmInfo: AlarmCreateInfo): void; + /** + * Creates an alarm. Near the time(s) specified by alarmInfo, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm. + * In order to reduce the load on the user's machine, Chrome limits alarms to at most once every 1 minute but may delay them an arbitrary amount more. That is, setting delayInMinutes or periodInMinutes to less than 1 will not be honored and will cause a warning. when can be set to less than 1 minute after "now" without warning but won't actually cause the alarm to fire for at least 1 minute. + * To help you debug your app or extension, when you've loaded it unpacked, there's no limit to how often the alarm can fire. + * @param name Optional name to identify this alarm. Defaults to the empty string. + * @param alarmInfo Describes when the alarm should fire. The initial time must be specified by either when or delayInMinutes (but not both). If periodInMinutes is set, the alarm will repeat every periodInMinutes minutes after the initial event. If neither when or delayInMinutes is set for a repeating alarm, periodInMinutes is used as the default for delayInMinutes. + */ + export function create(name: string, alarmInfo: AlarmCreateInfo): void; + /** + * Gets an array of all the alarms. + * @param callback The callback parameter should be a function that looks like this: + * function(array of Alarm alarms) {...}; + */ + export function getAll(callback: (alarms: Alarm[]) => void): void; + /** + * Clears all alarms. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(boolean wasCleared) {...}; + */ + export function clearAll(callback?: (wasCleared: boolean) => void): void; + /** + * Clears the alarm with the given name. + * @param name The name of the alarm to clear. Defaults to the empty string. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(boolean wasCleared) {...}; + */ + export function clear(name?: string, callback?: (wasCleared: boolean) => void): void; + /** + * Clears the alarm without a name. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(boolean wasCleared) {...}; + */ + export function clear(callback: (wasCleared: boolean) => void): void; + /** + * Retrieves details about the specified alarm. + * @param callback The callback parameter should be a function that looks like this: + * function( Alarm alarm) {...}; + */ + export function get(callback: (alarm: Alarm) => void): void; + /** + * Retrieves details about the specified alarm. + * @param name The name of the alarm to get. Defaults to the empty string. + * @param callback The callback parameter should be a function that looks like this: + * function( Alarm alarm) {...}; + */ + export function get(name: string, callback: (alarm: Alarm) => void): void; + + /** Fired when an alarm has elapsed. Useful for event pages. */ + var onAlarm: AlarmEvent; +} + +/** + * Use the chrome.browser API to interact with the Chrome browser associated with + * the current application and Chrome profile. + */ +declare module chrome.browser { + interface Options { + /** The URL to navigate to when the new tab is initially opened. */ + url: string; + } + + /** + * Opens a new tab in a browser window associated with the current application + * and Chrome profile. If no browser window for the Chrome profile is opened, + * a new one is opened prior to creating the new tab. + * @param options Configures how the tab should be opened. + * @param callback Called when the tab was successfully + * created, or failed to be created. If failed, runtime.lastError will be set. + */ + export function openTab(options: Options, callback: () => void): void; + + /** + * Opens a new tab in a browser window associated with the current application + * and Chrome profile. If no browser window for the Chrome profile is opened, + * a new one is opened prior to creating the new tab. Since Chrome 42 only. + * @param options Configures how the tab should be opened. + */ + export function openTab(options: Options): void; +} + +//////////////////// +// Bookmarks +//////////////////// +/** + * Use the chrome.bookmarks API to create, organize, and otherwise manipulate bookmarks. Also see Override Pages, which you can use to create a custom Bookmark Manager page. + * Availability: Since Chrome 5. + * Permissions: "bookmarks" + */ +declare module chrome.bookmarks { + /** A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder. */ + interface BookmarkTreeNode { + /** Optional. The 0-based position of this node within its parent folder. */ + index?: number; + /** Optional. When this node was created, in milliseconds since the epoch (new Date(dateAdded)). */ + dateAdded?: number; + /** The text displayed for the node. */ + title: string; + /** Optional. The URL navigated to when a user clicks the bookmark. Omitted for folders. */ + url?: string; + /** Optional. When the contents of this folder last changed, in milliseconds since the epoch. */ + dateGroupModified?: number; + /** The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted. */ + id: string; + /** Optional. The id of the parent folder. Omitted for the root node. */ + parentId?: string; + /** Optional. An ordered list of children of this node. */ + children?: BookmarkTreeNode[]; + /** + * Optional. + * Since Chrome 37. + * Indicates the reason why this node is unmodifiable. The managed value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default). + */ + unmodifiable?: any; + } + + interface BookmarkRemoveInfo { + index: number; + parentId: string; + } + + interface BookmarkMoveInfo { + index: number; + oldIndex: number; + parentId: string; + oldParentId: string; + } + + interface BookmarkChangeInfo { + url?: string; + title: string; + } + + interface BookmarkReorderInfo { + childIds: string[]; + } + + interface BookmarkRemovedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string id, object removeInfo) {...}; + */ + addListener(callback: (id: string, removeInfo: BookmarkRemoveInfo) => void): void; + } + + interface BookmarkImportEndedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: () => void): void; + } + + interface BookmarkMovedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string id, object moveInfo) {...}; + */ + addListener(callback: (id: string, moveInfo: BookmarkMoveInfo) => void): void; + } + + interface BookmarkImportBeganEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: () => void): void; + } + + interface BookmarkChangedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string id, object changeInfo) {...}; + */ + addListener(callback: (id: string, changeInfo: BookmarkChangeInfo) => void): void; + } + + interface BookmarkCreatedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string id, BookmarkTreeNode bookmark) {...}; + */ + addListener(callback: (id: string, bookmark: BookmarkTreeNode) => void): void; + } + + interface BookmarkChildrenReordered extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string id, object reorderInfo) {...}; + */ + addListener(callback: (id: string, reorderInfo: BookmarkReorderInfo) => void): void; + } + + interface BookmarkSearchQuery { + query?: string; + url?: string; + title?: string; + } + + interface BookmarkCreateArg { + /** Optional. Defaults to the Other Bookmarks folder. */ + parentId?: string; + index?: number; + title?: string; + url?: string; + } + + interface BookmarkDestinationArg { + parentId?: string; + index?: number; + } + + interface BookmarkChangesArg { + title?: string; + url?: string; + } + + /** @deprecated since Chrome 38. Bookmark write operations are no longer limited by Chrome. */ + var MAX_WRITE_OPERATIONS_PER_HOUR: number; + /** @deprecated since Chrome 38. Bookmark write operations are no longer limited by Chrome. */ + var MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; + + /** + * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties. + * @param query A string of words and quoted phrases that are matched against bookmark URLs and titles. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function search(query: string, callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties. + * @param query An object with one or more of the properties query, url, and title specified. Bookmarks matching all specified properties will be produced. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function search(query: BookmarkSearchQuery, callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Retrieves the entire Bookmarks hierarchy. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function getTree(callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Retrieves the recently added bookmarks. + * @param numberOfItems The maximum number of items to return. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function getRecent(numberOfItems: number, callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Retrieves the specified BookmarkTreeNode. + * @param id A single string-valued id + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function get(id: string, callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Retrieves the specified BookmarkTreeNode. + * @param idList An array of string-valued ids + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function get(idList: string[], callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( BookmarkTreeNode result) {...}; + */ + export function create(bookmark: BookmarkCreateArg, callback?: (result: BookmarkTreeNode) => void): void; + /** + * Moves the specified BookmarkTreeNode to the provided location. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( BookmarkTreeNode result) {...}; + */ + export function move(id: string, destination: BookmarkDestinationArg, callback?: (result: BookmarkTreeNode) => void): void; + /** + * Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. Note: Currently, only 'title' and 'url' are supported. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( BookmarkTreeNode result) {...}; + */ + export function update(id: string, changes: BookmarkChangesArg, callback?: (result: BookmarkTreeNode) => void): void; + /** + * Removes a bookmark or an empty bookmark folder. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function remove(id: string, callback?: Function): void; + /** + * Retrieves the children of the specified BookmarkTreeNode id. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function getChildren(id: string, callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Since Chrome 14. + * Retrieves part of the Bookmarks hierarchy, starting at the specified node. + * @param id The ID of the root of the subtree to retrieve. + * @param callback The callback parameter should be a function that looks like this: + * function(array of BookmarkTreeNode results) {...}; + */ + export function getSubTree(id: string, callback: (results: BookmarkTreeNode[]) => void): void; + /** + * Recursively removes a bookmark folder. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeTree(id: string, callback?: Function): void; + + /** Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents. */ + var onRemoved: BookmarkRemovedEvent; + /** Fired when a bookmark import session is ended. */ + var onImportEnded: BookmarkImportEndedEvent; + /** Fired when a bookmark import session is begun. Expensive observers should ignore onCreated updates until onImportEnded is fired. Observers should still handle other notifications immediately. */ + var onImportBegan: BookmarkImportBeganEvent; + /** Fired when a bookmark or folder changes. Note: Currently, only title and url changes trigger this. */ + var onChanged: BookmarkChangedEvent; + /** Fired when a bookmark or folder is moved to a different parent folder. */ + var onMoved: BookmarkMovedEvent; + /** Fired when a bookmark or folder is created. */ + var onCreated: BookmarkCreatedEvent; + /** Fired when the children of a folder have changed their order due to the order being sorted in the UI. This is not called as a result of a move(). */ + var onChildrenReordered: BookmarkChildrenReordered; +} + +//////////////////// +// Browser Action +//////////////////// +/** + * Use browser actions to put icons in the main Google Chrome toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup. + * Availability: Since Chrome 5. + * Manifest: "browser_action": {...} + */ +declare module chrome.browserAction { + interface BadgeBackgroundColorDetails { + /** An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is [255, 0, 0, 255]. Can also be a string with a CSS value, with opaque red being #FF0000 or #F00. */ + color: any; + /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ + tabId?: number; + } + + interface BadgeTextDetails { + /** Any number of characters can be passed, but only about four can fit in the space. */ + text: string; + /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ + tabId?: number; + } + + interface TitleDetails { + /** The string the browser action should display when moused over. */ + title: string; + /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ + tabId?: number; + } + + interface TabDetails { + /** Optional. Specify the tab to get the information. If no tab is specified, the non-tab-specific information is returned. */ + tabId?: number; + } + + interface TabIconDetails { + /** Optional. Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' */ + path?: any; + /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ + tabId?: number; + /** Optional. Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' */ + imageData?: ImageData; + } + + interface PopupDetails { + /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ + tabId?: number; + /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */ + popup: string; + } + + interface BrowserClickedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( tabs.Tab tab) {...}; + */ + addListener(callback: (tab: chrome.tabs.Tab) => void): void; + } + + /** + * Since Chrome 22. + * Enables the browser action for a tab. By default, browser actions are enabled. + * @param tabId The id of the tab for which you want to modify the browser action. + */ + export function enable(tabId?: number): void; + /** Sets the background color for the badge. */ + export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails): void; + /** Sets the badge text for the browser action. The badge is displayed on top of the icon. */ + export function setBadgeText(details: BadgeTextDetails): void; + /** Sets the title of the browser action. This shows up in the tooltip. */ + export function setTitle(details: TitleDetails): void; + /** + * Since Chrome 19. + * Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; + */ + export function getBadgeText(details: TabDetails, callback: (result: string) => void): void; + /** Sets the html document to be opened as a popup when the user clicks on the browser action's icon. */ + export function setPopup(details: PopupDetails): void; + /** + * Since Chrome 22. + * Disables the browser action for a tab. + * @param tabId The id of the tab for which you want to modify the browser action. + */ + export function disable(tabId?: number): void; + /** + * Since Chrome 19. + * Gets the title of the browser action. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; + */ + export function getTitle(details: TabDetails, callback: (result: string) => void): void; + /** + * Since Chrome 19. + * Gets the background color of the browser action. + * @param callback The callback parameter should be a function that looks like this: + * function( ColorArray result) {...}; + */ + export function getBadgeBackgroundColor(details: TabDetails, callback: (result: number[]) => void): void; + /** + * Since Chrome 19. + * Gets the html document set as the popup for this browser action. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; + */ + export function getPopup(details: TabDetails, callback: (result: string) => void): void; + /** + * Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setIcon(details: TabIconDetails, callback?: Function): void; + + /** Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup. */ + var onClicked: BrowserClickedEvent; +} + +//////////////////// +// Browsing Data +//////////////////// +/** + * Use the chrome.browsingData API to remove browsing data from a user's local profile. + * Availability: Since Chrome 19. + * Permissions: "browsingData" + */ +declare module chrome.browsingData { + interface OriginTypes { + /** Optional. Websites that have been installed as hosted applications (be careful!). */ + protectedWeb?: boolean; + /** Optional. Extensions and packaged applications a user has installed (be _really_ careful!). */ + extension?: boolean; + /** Optional. Normal websites. */ + unprotectedWeb?: boolean; + } + + /** Options that determine exactly what data will be removed. */ + interface RemovalOptions { + /** + * Optional. + * Since Chrome 21. + * An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you really want to remove application data before adding 'protectedWeb' or 'extensions'. + */ + originTypes?: OriginTypes; + /** Optional. Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all browsing data). */ + since?: number; + } + + /** + * Since Chrome 27. + * A set of data types. Missing data types are interpreted as false. + */ + interface DataTypeSet { + /** Optional. Websites' WebSQL data. */ + webSQL?: boolean; + /** Optional. Websites' IndexedDB data. */ + indexedDB?: boolean; + /** Optional. The browser's cookies. */ + cookies?: boolean; + /** Optional. Stored passwords. */ + passwords?: boolean; + /** Optional. Server-bound certificates. */ + serverBoundCertificates?: boolean; + /** Optional. The browser's download list. */ + downloads?: boolean; + /** Optional. The browser's cache. Note: when removing data, this clears the entire cache: it is not limited to the range you specify. */ + cache?: boolean; + /** Optional. Websites' appcaches. */ + appcache?: boolean; + /** Optional. Websites' file systems. */ + fileSystems?: boolean; + /** Optional. Plugins' data. */ + pluginData?: boolean; + /** Optional. Websites' local storage data. */ + localStorage?: boolean; + /** Optional. The browser's stored form data. */ + formData?: boolean; + /** Optional. The browser's history. */ + history?: boolean; + /** + * Optional. + * Since Chrome 39. + * Service Workers. + */ + serviceWorkers?: boolean; + } + + interface SettingsCallback { + options: RemovalOptions; + /** All of the types will be present in the result, with values of true if they are both selected to be removed and permitted to be removed, otherwise false. */ + dataToRemove: DataTypeSet; + /** All of the types will be present in the result, with values of true if they are permitted to be removed (e.g., by enterprise policy) and false if not. */ + dataRemovalPermitted: DataTypeSet; + } + + /** + * Since Chrome 26. + * Reports which types of data are currently selected in the 'Clear browsing data' settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here. + * @param callback The callback parameter should be a function that looks like this: + * function(object result) {...}; + */ + export function settings(callback: (result: SettingsCallback) => void): void; + /** + * Clears plugins' data. + * @param callback Called when plugins' data has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removePluginData(options: RemovalOptions, callback?: () => void): void; + /** + * Clears the browser's stored form data (autofill). + * @param callback Called when the browser's form data has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeFormData(options: RemovalOptions, callback?: () => void): void; + /** + * Clears websites' file system data. + * @param callback Called when websites' file systems have been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeFileSystems(options: RemovalOptions, callback?: () => void): void; + /** + * Clears various types of browsing data stored in a user's profile. + * @param dataToRemove The set of data types to remove. + * @param callback Called when deletion has completed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback?: () => void): void; + /** + * Clears the browser's stored passwords. + * @param callback Called when the browser's passwords have been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removePasswords(options: RemovalOptions, callback?: () => void): void; + /** + * Clears the browser's cookies and server-bound certificates modified within a particular timeframe. + * @param callback Called when the browser's cookies and server-bound certificates have been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeCookies(options: RemovalOptions, callback?: () => void): void; + /** + * Clears websites' WebSQL data. + * @param callback Called when websites' WebSQL databases have been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeWebSQL(options: RemovalOptions, callback?: () => void): void; + /** + * Clears websites' appcache data. + * @param callback Called when websites' appcache data has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeAppcache(options: RemovalOptions, callback?: () => void): void; + /** + * Clears the browser's list of downloaded files (not the downloaded files themselves). + * @param callback Called when the browser's list of downloaded files has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeDownloads(options: RemovalOptions, callback?: () => void): void; + /** + * Clears websites' local storage data. + * @param callback Called when websites' local storage has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeLocalStorage(options: RemovalOptions, callback?: () => void): void; + /** + * Clears the browser's cache. + * @param callback Called when the browser's cache has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeCache(options: RemovalOptions, callback?: () => void): void; + /** + * Clears the browser's history. + * @param callback Called when the browser's history has cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeHistory(options: RemovalOptions, callback?: () => void): void; + /** + * Clears websites' IndexedDB data. + * @param callback Called when websites' IndexedDB data has been cleared. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeIndexedDB(options: RemovalOptions, callback?: () => void): void; +} + +//////////////////// +// Commands +//////////////////// +/** + * Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the extension. + * Availability: Since Chrome 25. + * Manifest: "commands": {...} + */ +declare module chrome.commands { + interface Command { + /** Optional. The name of the Extension Command */ + name?: string; + /** Optional. The Extension Command description */ + description?: string; + /** Optional. The shortcut active for this command, or blank if not active. */ + shortcut?: string; + } + + interface CommandEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string command) {...}; + */ + addListener(callback: (command: string) => void): void; + } + + /** + * Returns all the registered extension commands for this extension and their shortcut (if active). + * @param callback Called to return the registered commands. + * If you specify the callback parameter, it should be a function that looks like this: + * function(array of Command commands) {...}; + */ + export function getAll(callback: (commands: Command[]) => void): void; + + /** Fired when a registered command is activated using a keyboard shortcut. */ + var onCommand: CommandEvent; +} + +//////////////////// +// Content Settings +//////////////////// +/** + * Use the chrome.contentSettings API to change settings that control whether websites can use features such as cookies, JavaScript, and plugins. More generally speaking, content settings allow you to customize Chrome's behavior on a per-site basis instead of globally. + * Availability: Since Chrome 16. + * Permissions: "contentSettings" + */ +declare module chrome.contentSettings { + interface ClearDetails { + /** + * Optional. + * Where to clear the setting (default: regular). + * The scope of the ContentSetting. One of + * * regular: setting for regular profile (which is inherited by the incognito profile if not overridden elsewhere), + * * incognito_session_only: setting for incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular settings). + */ + scope?: string; + } + + interface SetDetails { + /** Optional. The resource identifier for the content type. */ + resourceIdentifier?: ResourceIdentifier; + /** The setting applied by this rule. See the description of the individual ContentSetting objects for the possible values. */ + setting: any; + /** Optional. The pattern for the secondary URL. Defaults to matching all URLs. For details on the format of a pattern, see Content Setting Patterns. */ + secondaryPattern?: string; + /** Optional. Where to set the setting (default: regular). */ + scope?: string; + /** The pattern for the primary URL. For details on the format of a pattern, see Content Setting Patterns. */ + primaryPattern: string; + } + + interface GetDetails { + /** Optional. The secondary URL for which the content setting should be retrieved. Defaults to the primary URL. Note that the meaning of a secondary URL depends on the content type, and not all content types use secondary URLs. */ + secondaryUrl?: string; + /** Optional. A more specific identifier of the type of content for which the settings should be retrieved. */ + resourceIdentifier?: ResourceIdentifier; + /** Optional. Whether to check the content settings for an incognito session. (default false) */ + incognito?: boolean; + /** The primary URL for which the content setting should be retrieved. Note that the meaning of a primary URL depends on the content type. */ + primaryUrl: string; + } + + interface ReturnedDetails { + /** The content setting. See the description of the individual ContentSetting objects for the possible values. */ + setting: any; + } + + interface ContentSetting { + /** + * Clear all content setting rules set by this extension. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + clear(details: ClearDetails, callback?: () => void): void; + /** + * Applies a new content setting rule. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + set(details: SetDetails, callback?: () => void): void; + /** + * @param callback The callback parameter should be a function that looks like this: + * function(array of ResourceIdentifier resourceIdentifiers) {...}; + * Parameter resourceIdentifiers: A list of resource identifiers for this content type, or undefined if this content type does not use resource identifiers. + */ + getResourceIdentifiers(callback: (resourceIdentifiers?: ResourceIdentifier[]) => void): void; + /** + * Gets the current content setting for a given pair of URLs. + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; + */ + get(details: GetDetails, callback: (details: ReturnedDetails) => void): void; + } + + /** The only content type using resource identifiers is contentSettings.plugins. For more information, see Resource Identifiers. */ + interface ResourceIdentifier { + /** The resource identifier for the given content type. */ + id: string; + /** Optional. A human readable description of the resource. */ + description?: string; + } + + /** + * Whether to allow cookies and other local data to be set by websites. One of + * allow: Accept cookies, + * block: Block cookies, + * session_only: Accept cookies only for the current session. + * Default is allow. + * The primary URL is the URL representing the cookie origin. The secondary URL is the URL of the top-level frame. + */ + var cookies: ContentSetting; + /** + * Whether to allow sites to show pop-ups. One of + * allow: Allow sites to show pop-ups, + * block: Don't allow sites to show pop-ups. + * Default is block. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. + */ + var popups: ContentSetting; + /** + * Whether to run JavaScript. One of + * allow: Run JavaScript, + * block: Don't run JavaScript. + * Default is allow. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. + */ + var javascript: ContentSetting; + /** + * Whether to allow sites to show desktop notifications. One of + * allow: Allow sites to show desktop notifications, + * block: Don't allow sites to show desktop notifications, + * ask: Ask when a site wants to show desktop notifications. + * Default is ask. + * The primary URL is the URL of the document which wants to show the notification. The secondary URL is not used. + */ + var notifications: ContentSetting; + /** + * Whether to run plugins. One of + * allow: Run plugins automatically, + * block: Don't run plugins automatically, + * detect_important_content: Only run automatically those plugins that are detected as the website's main content. + * Default is allow. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. + */ + var plugins: ContentSetting; + /** + * Whether to show images. One of + * allow: Show images, + * block: Don't show images. + * Default is allow. + * The primary URL is the URL of the top-level frame. The secondary URL is the URL of the image. + */ + var images: ContentSetting; + /** + * Since Chrome 42. + * Whether to allow Geolocation. One of + * allow: Allow sites to track your physical location, + * block: Don't allow sites to track your physical location, + * ask: Ask before allowing sites to track your physical location. + * Default is ask. + * The primary URL is the URL of the document which requested location data. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL). + */ + var location: ContentSetting; + /** + * Since Chrome 42. + * Whether to allow sites to toggle the fullscreen mode. One of + * allow: Allow sites to toggle the fullscreen mode, + * ask: Ask when a site wants to toggle the fullscreen mode. + * Default is ask. + * The primary URL is the URL of the document which requested to toggle the fullscreen mode. The secondary URL is the URL of the top-level frame (which may or may not differ from the requesting URL). + */ + var fullscreen: ContentSetting; + /** + * Since Chrome 42. + * Whether to allow sites to disable the mouse cursor. One of + * allow: Allow sites to disable the mouse cursor, + * block: Don't allow sites to disable the mouse cursor, + * ask: Ask when a site wants to disable the mouse cursor. + * Default is ask. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. + */ + var mouselock: ContentSetting; + /** + * Since Chrome 42. + * Whether to allow sites to run plugins unsandboxed. One of + * allow: Allow sites to run plugins unsandboxed, + * block: Don't allow sites to run plugins unsandboxed, + * ask: Ask when a site wants to run a plugin unsandboxed. + * Default is ask. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. + */ + var unsandboxedPlugins: ContentSetting; + /** + * Since Chrome 42. + * Whether to allow sites to download multiple files automatically. One of + * allow: Allow sites to download multiple files automatically, + * block: Don't allow sites to download multiple files automatically, + * ask: Ask when a site wants to download files automatically after the first file. + * Default is ask. + * The primary URL is the URL of the top-level frame. The secondary URL is not used. + */ + var automaticDownloads: ContentSetting; +} + +//////////////////// +// Context Menus +//////////////////// +/** + * Use the chrome.contextMenus API to add items to Google Chrome's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages. + * Availability: Since Chrome 6. + * Permissions: "contextMenus" + */ +declare module chrome.contextMenus { + interface OnClickData { + /** + * Optional. + * Since Chrome 35. + * The text for the context selection, if any. + */ + selectionText?: string; + /** + * Optional. + * Since Chrome 35. + * A flag indicating the state of a checkbox or radio item after it is clicked. + */ + checked?: boolean; + /** + * Since Chrome 35. + * The ID of the menu item that was clicked. + */ + menuItemId: any; + /** + * Optional. + * Since Chrome 35. + * The URL of the frame of the element where the context menu was clicked, if it was in a frame. + */ + frameUrl?: string; + /** + * Since Chrome 35. + * A flag indicating whether the element is editable (text input, textarea, etc.). + */ + editable: boolean; + /** + * Optional. + * Since Chrome 35. + * One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements. + */ + mediaType?: string; + /** + * Optional. + * Since Chrome 35. + * A flag indicating the state of a checkbox or radio item before it was clicked. + */ + wasChecked?: boolean; + /** + * Since Chrome 35. + * The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu. + */ + pageUrl: string; + /** + * Optional. + * Since Chrome 35. + * If the element is a link, the URL it points to. + */ + linkUrl?: string; + /** + * Optional. + * Since Chrome 35. + * The parent ID, if any, for the item clicked. + */ + parentMenuItemId?: any; + /** + * Optional. + * Since Chrome 35. + * Will be present for elements with a 'src' URL. + */ + srcUrl?: string; + } + + interface CreateProperties { + /** Optional. Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see Match Patterns. */ + documentUrlPatterns?: string[]; + /** Optional. The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items. */ + checked?: boolean; + /** Optional. The text to be displayed in the item; this is required unless type is 'separator'. When the context is 'selection', you can use %s within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin". */ + title?: string; + /** Optional. List of contexts this menu item will appear in. Defaults to ['page'] if not specified. */ + contexts?: string[]; + /** + * Optional. + * Since Chrome 20. + * Whether this context menu item is enabled or disabled. Defaults to true. + */ + enabled?: boolean; + /** Optional. Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags. */ + targetUrlPatterns?: string[]; + /** + * Optional. + * A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for chrome.contextMenus.onClicked. + * @param info Information sent when a context menu item is clicked. + * @param tab The details of the tab where the click took place. Note: this parameter only present for extensions. + */ + onclick?: (info: OnClickData, tab: chrome.tabs.Tab) => void; + /** Optional. The ID of a parent menu item; this makes the item a child of a previously added item. */ + parentId?: any; + /** Optional. The type of menu item. Defaults to 'normal' if not specified. */ + type?: string; + /** + * Optional. + * Since Chrome 21. + * The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension. + */ + id?: string; + } + + interface UpdateProperties { + documentUrlPatterns?: string[]; + checked?: boolean; + title?: string; + contexts?: string[]; + /** Optional. Since Chrome 20. */ + enabled?: boolean; + targetUrlPatterns?: string[]; + onclick?: Function; + /** Optional. Note: You cannot change an item to be a child of one of its own descendants. */ + parentId?: any; + type?: string; + } + + interface MenuClickedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object info, tabs.Tab tab) {...}; + * Parameter info: Information sent when a context menu item is clicked. + * Parameter tab: The details of the tab where the click took place. If the click did not take place in a tab, this parameter will be missing. + */ + addListener(callback: (info: OnClickData, tab?: chrome.tabs.Tab) => void): void; + } + + /** + * Since Chrome 38. + * The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored. + */ + var ACTION_MENU_TOP_LEVEL_LIMIT: number; + + /** + * Removes all context menu items added by this extension. + * @param callback Called when removal is complete. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeAll(callback?: () => void): void; + /** + * Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError). + * @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function create(createProperties: CreateProperties, callback?: () => void): void; + /** + * Updates a previously created context menu item. + * @param id The ID of the item to update. + * @param updateProperties The properties to update. Accepts the same values as the create function. + * @param callback Called when the context menu has been updated. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function update(id: string, updateProperties: UpdateProperties, callback?: () => void): void; + /** + * Updates a previously created context menu item. + * @param id The ID of the item to update. + * @param updateProperties The properties to update. Accepts the same values as the create function. + * @param callback Called when the context menu has been updated. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function update(id: number, updateProperties: UpdateProperties, callback?: () => void): void; + /** + * Removes a context menu item. + * @param menuItemId The ID of the context menu item to remove. + * @param callback Called when the context menu has been removed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function remove(menuItemId: string, callback?: () => void): void; + /** + * Removes a context menu item. + * @param menuItemId The ID of the context menu item to remove. + * @param callback Called when the context menu has been removed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function remove(menuItemId: number, callback?: () => void): void; + + /** + * Since Chrome 21. + * Fired when a context menu item is clicked. + */ + var onClicked: MenuClickedEvent; +} + +//////////////////// +// Cookies +//////////////////// +/** + * Use the chrome.cookies API to query and modify cookies, and to be notified when they change. + * Availability: Since Chrome 6. + * Permissions: "cookies", host permissions + */ +declare module chrome.cookies { + /** Represents information about an HTTP cookie. */ + interface Cookie { + /** The domain of the cookie (e.g. "www.google.com", "example.com"). */ + domain: string; + /** The name of the cookie. */ + name: string; + /** The ID of the cookie store containing this cookie, as provided in getAllCookieStores(). */ + storeId: string; + /** The value of the cookie. */ + value: string; + /** True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date. */ + session: boolean; + /** True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie). */ + hostOnly: boolean; + /** Optional. The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies. */ + expirationDate?: number; + /** The path of the cookie. */ + path: string; + /** True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts). */ + httpOnly: boolean; + /** True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS). */ + secure: boolean; + } + + /** Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window. */ + interface CookieStore { + /** The unique identifier for the cookie store. */ + id: string; + /** Identifiers of all the browser tabs that share this cookie store. */ + tabIds: number[]; + } + + interface GetAllDetails { + /** Optional. Restricts the retrieved cookies to those whose domains match or are subdomains of this one. */ + domain?: string; + /** Optional. Filters the cookies by name. */ + name?: string; + /** Optional. Restricts the retrieved cookies to those that would match the given URL. */ + url?: string; + /** Optional. The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used. */ + storeId?: string; + /** Optional. Filters out session vs. persistent cookies. */ + session?: boolean; + /** Optional. Restricts the retrieved cookies to those whose path exactly matches this string. */ + path?: string; + /** Optional. Filters the cookies by their Secure property. */ + secure?: boolean; + } + + interface SetDetails { + /** Optional. The domain of the cookie. If omitted, the cookie becomes a host-only cookie. */ + domain?: string; + /** Optional. The name of the cookie. Empty by default if omitted. */ + name?: string; + /** The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail. */ + url: string; + /** Optional. The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store. */ + storeId?: string; + /** Optional. The value of the cookie. Empty by default if omitted. */ + value?: string; + /** Optional. The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie. */ + expirationDate?: number; + /** Optional. The path of the cookie. Defaults to the path portion of the url parameter. */ + path?: string; + /** Optional. Whether the cookie should be marked as HttpOnly. Defaults to false. */ + httpOnly?: boolean; + /** Optional. Whether the cookie should be marked as Secure. Defaults to false. */ + secure?: boolean; + } + + interface Details { + name: string; + url: string; + storeId?: string; + } + + interface CookieChangeInfo { + /** Information about the cookie that was set or removed. */ + cookie: Cookie; + /** True if a cookie was removed. */ + removed: boolean; + /** + * Since Chrome 12. + * The underlying reason behind the cookie's change. + */ + cause: string; + } + + interface CookieChangedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object changeInfo) {...}; + */ + addListener(callback: (changeInfo: CookieChangeInfo) => void): void; + } + + /** + * Lists all existing cookie stores. + * @param callback The callback parameter should be a function that looks like this: + * function(array of CookieStore cookieStores) {...}; + * Parameter cookieStores: All the existing cookie stores. + */ + export function getAllCookieStores(callback: (cookieStores: CookieStore[]) => void): void; + /** + * Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first. + * @param details Information to filter the cookies being retrieved. + * @param callback The callback parameter should be a function that looks like this: + * function(array of Cookie cookies) {...}; + * Parameter cookies: All the existing, unexpired cookies that match the given cookie info. + */ + export function getAll(details: GetAllDetails, callback: (cookies: Cookie[]) => void): void; + /** + * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. + * @param details Details about the cookie being set. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( Cookie cookie) {...}; + * Optional parameter cookie: Contains details about the cookie that's been set. If setting failed for any reason, this will be "null", and "chrome.runtime.lastError" will be set. + */ + export function set(details: SetDetails, callback?: (cookie?: Cookie) => void): void; + /** + * Deletes a cookie by name. + * @param details Information to identify the cookie to remove. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; + */ + export function remove(details: Details, callback?: (details: Details) => void): void; + /** + * Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned. + * @param details Details to identify the cookie being retrieved. + * @param callback The callback parameter should be a function that looks like this: + * function( Cookie cookie) {...}; + * Parameter cookie: Contains details about the cookie. This parameter is null if no such cookie was found. + */ + export function get(details: Details, callback: (cookie?: Cookie) => void): void; + + /** Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with "cause" of "overwrite" . Afterwards, a new cookie is written with the updated values, generating a second notification with "cause" "explicit". */ + var onChanged: CookieChangedEvent; +} + +//////////////////// +// Debugger +//////////////////// +/** + * The chrome.debugger API serves as an alternate transport for Chrome's remote debugging protocol. Use chrome.debugger to attach to one or more tabs to instrument network interaction, debug JavaScript, mutate the DOM and CSS, etc. Use the Debuggee tabId to target tabs with sendCommand and route events by tabId from onEvent callbacks. + * Availability: Since Chrome 18. + * Permissions: "debugger" + */ +declare module "chrome.debugger" { + /** Debuggee identifier. Either tabId or extensionId must be specified */ + interface Debuggee { + /** Optional. The id of the tab which you intend to debug. */ + tabId?: number; + /** + * Optional. + * Since Chrome 27. + * The id of the extension which you intend to debug. Attaching to an extension background page is only possible when 'silent-debugger-extension-api' flag is enabled on the target browser. + */ + extensionId?: string; + /** + * Optional. + * Since Chrome 28. + * The opaque id of the debug target. + */ + targetId?: string; + } + + /** + * Since Chrome 28. + * Debug target information + */ + interface TargetInfo { + /** Target type. */ + type: string; + /** Target id. */ + id: string; + /** + * Optional. + * Since Chrome 30. + * The tab id, defined if type == 'page'. + */ + tabId?: number; + /** + * Optional. + * Since Chrome 30. + * The extension id, defined if type = 'background_page'. + */ + extensionId?: string; + /** True if debugger is already attached. */ + attached: boolean; + /** Target page title. */ + title: string; + /** Target URL. */ + url: string; + /** Optional. Target favicon URL. */ + faviconUrl?: string; + } + + interface DebuggerDetachedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( Debuggee source, DetachReason reason) {...}; + * Parameter source: The debuggee that was detached. + * Parameter reason: Since Chrome 24. Connection termination reason. + */ + addListener(callback: (source: Debuggee, reason: string) => void): void; + } + + interface DebuggerEventEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( Debuggee source, string method, object params) {...}; + * Parameter source: The debuggee that generated this event. + * Parameter method: Method name. Should be one of the notifications defined by the remote debugging protocol. + * Parameter params: JSON object with the parameters. Structure of the parameters varies depending on the method name and is defined by the 'parameters' attribute of the event description in the remote debugging protocol. + */ + addListener(callback: (source: Debuggee, method: string, params?: Object) => void): void; + } + + /** + * Attaches debugger to the given target. + * @param target Debugging target to which you want to attach. + * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages. + * @param callback Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void; + /** + * Detaches debugger from the given target. + * @param target Debugging target from which you want to detach. + * @param callback Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function detach(target: Debuggee, callback?: () => void): void; + /** + * Sends given command to the debugging target. + * @param target Debugging target to which you want to send the command. + * @param method Method name. Should be one of the methods defined by the remote debugging protocol. + * @param commandParams Since Chrome 22. + * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method. + * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object result) {...}; + */ + export function sendCommand(target: Debuggee, method: string, commandParams?: Object, callback?: (result?: Object) => void): void; + /** + * Since Chrome 28. + * Returns the list of available debug targets. + * @param callback The callback parameter should be a function that looks like this: + * function(array of TargetInfo result) {...}; + * Parameter result: Array of TargetInfo objects corresponding to the available debug targets. + */ + export function getTargets(callback: (result: TargetInfo[]) => void): void; + + /** Fired when browser terminates debugging session for the tab. This happens when either the tab is being closed or Chrome DevTools is being invoked for the attached tab. */ + var onDetach: DebuggerDetachedEvent; + /** Fired whenever debugging target issues instrumentation event. */ + var onEvent: DebuggerEventEvent; +} + +//////////////////// +// Declarative Content +//////////////////// +/** + * Use the chrome.declarativeContent API to take actions depending on the content of a page, without requiring permission to read the page's content. + * Availability: Since Chrome 33. + * Permissions: "declarativeContent" + */ +declare module chrome.declarativeContent { + interface PageStateUrlDetails { + /** Optional. Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name. */ + hostContains?: string; + /** Optional. Matches if the host name of the URL is equal to a specified string. */ + hostEquals?: string; + /** Optional. Matches if the host name of the URL starts with a specified string. */ + hostPrefix?: string; + /** Optional. Matches if the host name of the URL ends with a specified string. */ + hostSuffix?: string; + /** Optional. Matches if the path segment of the URL contains a specified string. */ + pathContains?: string; + /** Optional. Matches if the path segment of the URL is equal to a specified string. */ + pathEquals?: string; + /** Optional. Matches if the path segment of the URL starts with a specified string. */ + pathPrefix?: string; + /** Optional. Matches if the path segment of the URL ends with a specified string. */ + pathSuffix?: string; + /** Optional. Matches if the query segment of the URL contains a specified string. */ + queryContains?: string; + /** Optional. Matches if the query segment of the URL is equal to a specified string. */ + queryEquals?: string; + /** Optional. Matches if the query segment of the URL starts with a specified string. */ + queryPrefix?: string; + /** Optional. Matches if the query segment of the URL ends with a specified string. */ + querySuffix?: string; + /** Optional. Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlContains?: string; + /** Optional. Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlEquals?: string; + /** Optional. Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. */ + urlMatches?: string; + /** Optional. Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. */ + originAndPathMatches?: string; + /** Optional. Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlPrefix?: string; + /** Optional. Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlSuffix?: string; + /** Optional. Matches if the scheme of the URL is equal to any of the schemes specified in the array. */ + schemes?: string[]; + /** Optional. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. */ + port?: any[]; + } + + /** Matches the state of a web page by various criteria. */ + interface PageStateMatcher { + /** Optional. Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */ + pageUrl?: PageStateUrlDetails; + /** Optional. Matches if all of the CSS selectors in the array match displayed elements in a frame with the same origin as the page's main frame. All selectors in this array must be compound selectors to speed up matching. Note that listing hundreds of CSS selectors or CSS selectors that match hundreds of times per page can still slow down web sites. */ + css?: string[]; + /** + * Optional. + * Since Chrome 45. Warning: this is the current Beta channel. More information available on the API documentation pages. + * Matches if the bookmarked state of the page is equal to the specified value. Requres the bookmarks permission. + */ + isBookmarked?: boolean; + } +} + +//////////////////// +// Declarative Web Request +//////////////////// +declare module chrome.declarativeWebRequest { + interface HeaderFilter { + nameEquals?: string; + valueContains?: any; + nameSuffix?: string; + valueSuffix?: string; + valuePrefix?: string; + nameContains?: any; + valueEquals?: string; + namePrefix?: string; + } + + interface AddResponseHeader { + name: string; + value: string; + } + + interface RemoveResponseCookie { + filter: ResponseCookie; + } + + interface RemoveResponseHeader { + name: string; + value?: string; + } + + interface RequestMatcher { + contentType?: string[]; + url?: chrome.events.UrlFilter; + excludeContentType?: string[]; + excludeResponseHeader?: HeaderFilter[]; + resourceType?: string; + responseHeaders?: HeaderFilter[]; + } + + interface IgnoreRules { + lowerPriorityThan: number; + } + + interface RedirectToEmptyDocument { } + + interface RedirectRequest { + redirectUrl: string; + } + + interface ResponseCookie { + domain?: string; + name?: string; + expires?: string; + maxAge?: number; + value?: string; + path?: string; + httpOnly?: string; + secure?: string; + } + + interface AddResponseCookie { + cookie: ResponseCookie; + } + + interface EditResponseCookie { + filter: ResponseCookie; + modification: ResponseCookie; + } + + interface CancelRequest { } + + interface RemoveRequestHeader { + name: string; + } + + interface EditRequestCookie { + filter: RequestCookie; + modification: RequestCookie; + } + + interface SetRequestHeader { + name: string; + value: string; + } + + interface RequestCookie { + name?: string; + value?: string; + } + + interface RedirectByRegEx { + to: string; + from: string; + } + + interface RedirectToTransparentImage { } + + interface AddRequestCookie { + cookie: RequestCookie; + } + + interface RemoveRequestCookie { + filter: RequestCookie; + } + + interface RequestedEvent extends chrome.events.Event { + addListener(callback: Function): void; + } + + var onRequest: RequestedEvent; +} + +//////////////////// +// DesktopCapture +//////////////////// +/** + * Desktop Capture API that can be used to capture content of screen, individual windows or tabs. + * Availability: Since Chrome 34. + * Permissions: "desktopCapture" + */ +declare module chrome.desktopCapture { + /** + * Shows desktop media picker UI with the specified set of sources. + * @param sources Set of sources that should be shown to the user. + * @param callback The callback parameter should be a function that looks like this: + * function(string streamId) {...}; + * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used. + */ + export function chooseDesktopMedia(sources: string[], callback: (streamId: string) => void): number; + /** + * Shows desktop media picker UI with the specified set of sources. + * @param sources Set of sources that should be shown to the user. + * @param targetTab Optional tab for which the stream is created. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches tab.url. + * @param callback The callback parameter should be a function that looks like this: + * function(string streamId) {...}; + * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used. + */ + export function chooseDesktopMedia(sources: string[], targetTab: chrome.tabs.Tab, callback: (streamId: string) => void): number; + /** + * Hides desktop media picker dialog shown by chooseDesktopMedia(). + * @param desktopMediaRequestId Id returned by chooseDesktopMedia() + */ + export function cancelChooseDesktopMedia(desktopMediaRequestId: number): void; +} + +//////////////////// +// Dev Tools - Inspected Window +//////////////////// +/** + * Use the chrome.devtools.inspectedWindow API to interact with the inspected window: obtain the tab ID for the inspected page, evaluate the code in the context of the inspected window, reload the page, or obtain the list of resources within the page. + * Availability: Since Chrome 18. + */ +declare module chrome.devtools.inspectedWindow { + /** A resource within the inspected page, such as a document, a script, or an image. */ + interface Resource { + /** The URL of the resource. */ + url: string; + /** + * Gets the content of the resource. + * @param callback A function that receives resource content when the request completes. + * The callback parameter should be a function that looks like this: + * function(string content, string encoding) {...}; + * Parameter content: Content of the resource (potentially encoded). + * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. + */ + getContent(callback: (content: string, encoding: string) => void): void; + /** + * Sets the content of the resource. + * @param content New content of the resource. Only resources with the text type are currently supported. + * @param commit True if the user has finished editing the resource, and the new content of the resource should be persisted; false if this is a minor change sent in progress of the user editing the resource. + * @param callback A function called upon request completion. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object error) {...}; + * Optional parameter error: Set to undefined if the resource content was set successfully; describes error otherwise. + */ + setContent(content: string, commit: boolean, callback?: (error: Object) => void): void; + } + + interface ReloadOptions { + /** Optional. If specified, the string will override the value of the User-Agent HTTP header that's sent while loading the resources of the inspected page. The string will also override the value of the navigator.userAgent property that's returned to any scripts that are running within the inspected page. */ + userAgent?: string; + /** Optional. When true, the loader will ignore the cache for all inspected page resources loaded before the load event is fired. The effect is similar to pressing Ctrl+Shift+R in the inspected window or within the Developer Tools window. */ + ignoreCache?: boolean; + /** Optional. If specified, the script will be injected into every frame of the inspected page immediately upon load, before any of the frame's scripts. The script will not be injected after subsequent reloads—for example, if the user presses Ctrl+R. */ + injectedScript?: boolean; + /** + * Optional. + * If specified, this script evaluates into a function that accepts three string arguments: the source to preprocess, the URL of the source, and a function name if the source is an DOM event handler. The preprocessorerScript function should return a string to be compiled by Chrome in place of the input source. In the case that the source is a DOM event handler, the returned source must compile to a single JS function. + * @deprecated Deprecated since Chrome 41. Please avoid using this parameter, it will be removed soon. + */ + preprocessorScript?: string; + } + + interface EvaluationExceptionInfo { + /** Set if the error occurred on the DevTools side before the expression is evaluated. */ + isError: boolean; + /** Set if the error occurred on the DevTools side before the expression is evaluated. */ + code: string; + /** Set if the error occurred on the DevTools side before the expression is evaluated. */ + description: string; + /** Set if the error occurred on the DevTools side before the expression is evaluated, contains the array of the values that may be substituted into the description string to provide more information about the cause of the error. */ + details: any[]; + /** Set if the evaluated code produces an unhandled exception. */ + isException: boolean; + /** Set if the evaluated code produces an unhandled exception. */ + value: string; + } + + interface ResourceAddedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( Resource resource) {...}; + */ + addListener(callback: (resource: Resource) => void): void; + } + + interface ResourceContentCommittedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( Resource resource, string content) {...}; + * Parameter content: New content of the resource. + */ + addListener(callback: (resource: Resource, content: string) => void): void; + } + + /** The ID of the tab being inspected. This ID may be used with chrome.tabs.* API. */ + var tabId: number; + + /** Reloads the inspected page. */ + export function reload(reloadOptions: ReloadOptions): void; + /** + * Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result parameter of the callback is undefined. In the case of a DevTools-side error, the isException parameter is non-null and has isError set to true and code set to an error code. In the case of a JavaScript error, isException is set to true and value is set to the string value of thrown object. + * @param expression An expression to evaluate. + * @param callback A function called when evaluation completes. + * If you specify the callback parameter, it should be a function that looks like this: + * function(object result, object exceptionInfo) {...}; + * Parameter result: The result of evaluation. + * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression. + */ + export function eval(expression: string, callback?: (result: Object, exceptionInfo: EvaluationExceptionInfo) => void): void; + /** + * Retrieves the list of resources from the inspected page. + * @param callback A function that receives the list of resources when the request completes. + * The callback parameter should be a function that looks like this: + * function(array of Resource resources) {...}; + */ + export function getResources(callback: (resources: Resource[]) => void): void; + + /** Fired when a new resource is added to the inspected page. */ + var onResourceAdded: ResourceAddedEvent; + /** Fired when a new revision of the resource is committed (e.g. user saves an edited version of the resource in the Developer Tools). */ + var onResourceContentCommitted: ResourceContentCommittedEvent; +} + +//////////////////// +// Dev Tools - Network +//////////////////// +/** + * Use the chrome.devtools.network API to retrieve the information about network requests displayed by the Developer Tools in the Network panel. + * Availability: Since Chrome 18. + */ +declare module chrome.devtools.network { + /** Represents a network request for a document resource (script, image and so on). See HAR Specification for reference. */ + interface Request { + /** + * Returns content of the response body. + * @param callback A function that receives the response body when the request completes. + * The callback parameter should be a function that looks like this: + * function(string content, string encoding) {...}; + * Parameter content: Content of the response body (potentially encoded). + * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. + */ + getContent(callback: (content: string, encoding: string) => void): void; + } + + interface RequestFinishedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( Request request) {...}; + * Parameter request: Description of a network request in the form of a HAR entry. See HAR specification for details. + */ + addListener(callback: (request: Request) => void): void; + } + + interface NavigatedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string url) {...}; + * Parameter url: URL of the new page. + */ + addListener(callback: (url: string) => void): void; + } + + /** + * Returns HAR log that contains all known network requests. + * @param callback A function that receives the HAR log when the request completes. + * The callback parameter should be a function that looks like this: + * function(object harLog) {...}; + * Parameter harLog: A HAR log. See HAR specification for details. + */ + export function getHAR(callback: (harLog: Object) => void): void; + + /** Fired when a network request is finished and all request data are available. */ + var onRequestFinished: RequestFinishedEvent; + /** Fired when the inspected window navigates to a new page. */ + var onNavigated: NavigatedEvent; +} + +//////////////////// +// Dev Tools - Panels +//////////////////// +/** + * Use the chrome.devtools.panels API to integrate your extension into Developer Tools window UI: create your own panels, access existing panels, and add sidebars. + * Availability: Since Chrome 18. + */ +declare module chrome.devtools.panels { + interface PanelShownEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(global window) {...}; + * Parameter window: The JavaScript window object of panel's page. + */ + addListener(callback: (window: chrome.windows.Window) => void): void; + } + + interface PanelHiddenEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: () => void): void; + } + + interface PanelSearchEvent extends chrome.events.Event { + /** + * The callback parameter should be a function that looks like this: + * function(string action, string queryString) {...}; + * Parameter action: Type of search action being performed. + * Optional parameter queryString: Query string (only for 'performSearch'). + */ + addListener(callback: (action: string, queryString?: string) => void): void; + } + + /** Represents a panel created by extension. */ + interface ExtensionPanel { + /** + * Appends a button to the status bar of the panel. + * @param iconPath Path to the icon of the button. The file should contain a 64x24-pixel image composed of two 32x24 icons. The left icon is used when the button is inactive; the right icon is displayed when the button is pressed. + * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button. + * @param disabled Whether the button is disabled. + */ + createStatusBarButton(iconPath: string, tooltipText: string, disabled: boolean): Button; + /** Fired when the user switches to the panel. */ + onShown: PanelShownEvent; + /** Fired when the user switches away from the panel. */ + onHidden: PanelHiddenEvent; + /** Fired upon a search action (start of a new search, search result navigation, or search being canceled). */ + onSearch: PanelSearchEvent; + } + + interface ButtonClickedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: () => void): void; + } + + /** A button created by the extension. */ + interface Button { + /** + * Updates the attributes of the button. If some of the arguments are omitted or null, the corresponding attributes are not updated. + * @param iconPath Path to the new icon of the button. + * @param tooltipText Text shown as a tooltip when user hovers the mouse over the button. + * @param disabled Whether the button is disabled. + */ + update(iconPath?: string, tooltipText?: string, disabled?: boolean): void; + /** Fired when the button is clicked. */ + onClicked: ButtonClickedEvent; + } + + interface SelectionChangedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: () => void): void; + } + + /** Represents the Elements panel. */ + interface ElementsPanel { + /** + * Creates a pane within panel's sidebar. + * @param title Text that is displayed in sidebar caption. + * @param callback A callback invoked when the sidebar is created. + * If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionSidebarPane result) {...}; + * Parameter result: An ExtensionSidebarPane object for created sidebar pane. + */ + createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => void): void; + /** Fired when an object is selected in the panel. */ + onSelectionChanged: SelectionChangedEvent; + } + + /** + * Since Chrome 41. + * Represents the Sources panel. + */ + interface SourcesPanel { + /** + * Creates a pane within panel's sidebar. + * @param title Text that is displayed in sidebar caption. + * @param callback A callback invoked when the sidebar is created. + * If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionSidebarPane result) {...}; + * Parameter result: An ExtensionSidebarPane object for created sidebar pane. + */ + createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => void): void; + /** Fired when an object is selected in the panel. */ + onSelectionChanged: SelectionChangedEvent; + } + + interface ExtensionSidebarPaneShownEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(global window) {...}; + * Parameter window: The JavaScript window object of the sidebar page, if one was set with the setPage() method. + */ + addListener(callback: (window: chrome.windows.Window) => void): void; + } + + interface ExtensionSidebarPaneHiddenEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: () => void): void; + } + + /** A sidebar created by the extension. */ + interface ExtensionSidebarPane { + /** + * Sets the height of the sidebar. + * @param height A CSS-like size specification, such as '100px' or '12ex'. + */ + setHeight(height: string): void; + /** + * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane. + * @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch. + * @param rootTitle An optional title for the root of the expression tree. + * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + setExpression(expression: string, rootTitle?: string, callback?: () => void): void; + /** + * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane. + * @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch. + * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + setExpression(expression: string, callback?: () => void): void; + /** + * Sets a JSON-compliant object to be displayed in the sidebar pane. + * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client). + * @param rootTitle An optional title for the root of the expression tree. + * @param callback A callback invoked after the sidebar is updated with the object. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + setObject(jsonObject: string, rootTitle?: string, callback?: () => void): void; + /** + * Sets a JSON-compliant object to be displayed in the sidebar pane. + * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client). + * @param callback A callback invoked after the sidebar is updated with the object. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + setObject(jsonObject: string, callback?: () => void): void; + /** + * Sets an HTML page to be displayed in the sidebar pane. + * @param path Relative path of an extension page to display within the sidebar. + */ + setPage(path: string): void; + /** Fired when the sidebar pane becomes visible as a result of user switching to the panel that hosts it. */ + onShown: ExtensionSidebarPaneShownEvent; + /** Fired when the sidebar pane becomes hidden as a result of the user switching away from the panel that hosts the sidebar pane. */ + onHidden: ExtensionSidebarPaneHiddenEvent; + } + + /** Elements panel. */ + var elements: ElementsPanel; + /** + * Since Chrome 38. + * Sources panel. + */ + var sources: SourcesPanel; + + /** + * Creates an extension panel. + * @param title Title that is displayed next to the extension icon in the Developer Tools toolbar. + * @param iconPath Path of the panel's icon relative to the extension directory. + * @param pagePath Path of the panel's HTML page relative to the extension directory. + * @param callback A function that is called when the panel is created. + * If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionPanel panel) {...}; + * Parameter panel: An ExtensionPanel object representing the created panel. + */ + export function create(title: string, iconPath: string, pagePath: string, callback?: (panel: ExtensionPanel) => void): void; + /** + * Specifies the function to be called when the user clicks a resource link in the Developer Tools window. To unset the handler, either call the method with no parameters or pass null as the parameter. + * @param callback A function that is called when the user clicks on a valid resource link in Developer Tools window. Note that if the user clicks an invalid URL or an XHR, this function is not called. + * If you specify the callback parameter, it should be a function that looks like this: + * function( devtools.inspectedWindow.Resource resource) {...}; + * Parameter resource: A devtools.inspectedWindow.Resource object for the resource that was clicked. + */ + export function setOpenResourceHandler(callback?: (resource: chrome.devtools.inspectedWindow.Resource) => void): void; + /** + * Since Chrome 38. + * Requests DevTools to open a URL in a Developer Tools panel. + * @param url The URL of the resource to open. + * @param lineNumber Specifies the line number to scroll to when the resource is loaded. + * @param callback A function that is called when the resource has been successfully loaded. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function openResource(url: string, lineNumber: number, callback: () => void): void; +} + +//////////////////// +// Document Scan +//////////////////// +/** + * Use the chrome.documentScan API to discover and retrieve images from attached paper document scanners. + * Availability: Since Chrome 44. + * Permissions: "documentScan" + * Important: This API works only on Chrome OS. + */ +declare module chrome.documentScan { + interface DocumentScanOptions { + /** Optional. The MIME types that are accepted by the caller. */ + mimeTypes?: string[]; + /** Optional. The number of scanned images allowed (defaults to 1). */ + maxImages?: number; + } + + interface DocumentScanCallbackArg { + /** The data image URLs in a form that can be passed as the "src" value to an image tag. */ + dataUrls: string[]; + /** The MIME type of dataUrls. */ + mimeType: string; + } + + /** + * Performs a document scan. On success, the PNG data will be sent to the callback. + * @param options Object containing scan parameters. + * @param callback Called with the result and data from the scan. + * The callback parameter should be a function that looks like this: + * function(object result) {...}; + */ + export function scan(options: DocumentScanOptions, callback: (result: DocumentScanCallbackArg) => void): void; +} + +//////////////////// +// Dev Tools - Downloads +//////////////////// +/** + * Use the chrome.downloads API to programmatically initiate, monitor, manipulate, and search for downloads. + * Availability: Since Chrome 31. + * Permissions: "downloads" + */ +declare module chrome.downloads { + interface HeaderNameValuePair { + /** Name of the HTTP header. */ + name: string; + /** Value of the HTTP header. */ + value: string; + } + + interface DownloadOptions { + /** Optional. Post body. */ + body?: string; + /** Optional. Use a file-chooser to allow the user to select a filename regardless of whether filename is set or already exists. */ + saveAs?: boolean; + /** The URL to download. */ + url: string; + /** Optional. A file path relative to the Downloads directory to contain the downloaded file, possibly containing subdirectories. Absolute paths, empty paths, and paths containing back-references ".." will cause an error. onDeterminingFilename allows suggesting a filename after the file's MIME type and a tentative filename have been determined. */ + filename?: string; + /** Optional. Extra HTTP headers to send with the request if the URL uses the HTTP[s] protocol. Each header is represented as a dictionary containing the keys name and either value or binaryValue, restricted to those allowed by XMLHttpRequest. */ + headers?: HeaderNameValuePair[]; + /** Optional. The HTTP method to use if the URL uses the HTTP[S] protocol. */ + method?: string; + /** Optional. The action to take if filename already exists. */ + conflictAction?: string; + } + + interface DownloadDelta { + /** Optional. The change in danger, if any. */ + danger?: StringDelta; + /** Optional. The change in url, if any. */ + url?: StringDelta; + /** Optional. The change in totalBytes, if any. */ + totalBytes?: DoubleDelta; + /** Optional. The change in filename, if any. */ + filename?: StringDelta; + /** Optional. The change in paused, if any. */ + paused?: BooleanDelta; + /** Optional. The change in state, if any. */ + state?: StringDelta; + /** Optional. The change in mime, if any. */ + mime?: StringDelta; + /** Optional. The change in fileSize, if any. */ + fileSize?: DoubleDelta; + /** Optional. The change in startTime, if any. */ + startTime?: DoubleDelta; + /** Optional. The change in error, if any. */ + error?: StringDelta; + /** Optional. The change in endTime, if any. */ + endTime?: DoubleDelta; + /** The id of the DownloadItem that changed. */ + id: number; + /** Optional. The change in canResume, if any. */ + canResume?: BooleanDelta; + /** Optional. The change in exists, if any. */ + exists?: BooleanDelta; + } + + interface BooleanDelta { + current?: boolean; + previous?: boolean; + } + + /** Since Chrome 34. */ + interface DoubleDelta { + current?: number; + previous?: number; + } + + interface StringDelta { + current?: string; + previous?: string; + } + + interface DownloadItem { + /** Number of bytes received so far from the host, without considering file compression. */ + bytesReceived: number; + /** Indication of whether this download is thought to be safe or known to be suspicious. */ + danger: string; + /** Absolute URL. */ + url: string; + /** Number of bytes in the whole file, without considering file compression, or -1 if unknown. */ + totalBytes: number; + /** Absolute local path. */ + filename: string; + /** True if the download has stopped reading data from the host, but kept the connection open. */ + paused: boolean; + /** Indicates whether the download is progressing, interrupted, or complete. */ + state: string; + /** The file's MIME type. */ + mime: string; + /** Number of bytes in the whole file post-decompression, or -1 if unknown. */ + fileSize: number; + /** The time when the download began in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){console.log(new Date(item.startTime))})}) */ + startTime: string; + /** Optional. Why the download was interrupted. Several kinds of HTTP errors may be grouped under one of the errors beginning with SERVER_. Errors relating to the network begin with NETWORK_, errors relating to the process of writing the file to the file system begin with FILE_, and interruptions initiated by the user begin with USER_. */ + error?: string; + /** Optional. The time when the download ended in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){if (item.endTime) console.log(new Date(item.endTime))})}) */ + endTime?: string; + /** An identifier that is persistent across browser sessions. */ + id: number; + /** False if this download is recorded in the history, true if it is not recorded. */ + incognito: boolean; + /** Absolute URL. */ + referrer: string; + /** Optional. Estimated time when the download will complete in ISO 8601 format. May be passed directly to the Date constructor: chrome.downloads.search({}, function(items){items.forEach(function(item){if (item.estimatedEndTime) console.log(new Date(item.estimatedEndTime))})}) */ + estimatedEndTime?: string; + /** True if the download is in progress and paused, or else if it is interrupted and can be resumed starting from where it was interrupted. */ + canResume: boolean; + /** Whether the downloaded file still exists. This information may be out of date because Chrome does not automatically watch for file removal. Call search() in order to trigger the check for file existence. When the existence check completes, if the file has been deleted, then an onChanged event will fire. Note that search() does not wait for the existence check to finish before returning, so results from search() may not accurately reflect the file system. Also, search() may be called as often as necessary, but will not check for file existence any more frequently than once every 10 seconds. */ + exists: boolean; + /** Optional. The identifier for the extension that initiated this download if this download was initiated by an extension. Does not change once it is set. */ + byExtensionId?: string; + /** Optional. The localized name of the extension that initiated this download if this download was initiated by an extension. May change if the extension changes its name or if the user changes their locale. */ + byExtensionName?: string; + } + + interface GetFileIconOptions { + /** Optional. * The size of the returned icon. The icon will be square with dimensions size * size pixels. The default and largest size for the icon is 32x32 pixels. The only supported sizes are 16 and 32. It is an error to specify any other size. + */ + size?: number; + } + + interface DownloadQuery { + /** Optional. Set elements of this array to DownloadItem properties in order to sort search results. For example, setting orderBy=['startTime'] sorts the DownloadItem by their start time in ascending order. To specify descending order, prefix with a hyphen: '-startTime'. */ + orderBy?: string[]; + /** Optional. Limits results to DownloadItem whose url matches the given regular expression. */ + urlRegex?: string; + /** Optional. Limits results to DownloadItem that ended before the given ms since the epoch. */ + endedBefore?: number; + /** Optional. Limits results to DownloadItem whose totalBytes is greater than the given integer. */ + totalBytesGreater?: number; + /** Optional. Indication of whether this download is thought to be safe or known to be suspicious. */ + danger?: string; + /** Optional. Number of bytes in the whole file, without considering file compression, or -1 if unknown. */ + totalBytes?: number; + /** Optional. True if the download has stopped reading data from the host, but kept the connection open. */ + paused?: boolean; + /** Optional. Limits results to DownloadItem whose filename matches the given regular expression. */ + filenameRegex?: string; + /** Optional. This array of search terms limits results to DownloadItem whose filename or url contain all of the search terms that do not begin with a dash '-' and none of the search terms that do begin with a dash. */ + query?: string[]; + /** Optional. Limits results to DownloadItem whose totalBytes is less than the given integer. */ + totalBytesLess?: number; + /** Optional. The id of the DownloadItem to query. */ + id?: number; + /** Optional. Number of bytes received so far from the host, without considering file compression. */ + bytesReceived?: number; + /** Optional. Limits results to DownloadItem that ended after the given ms since the epoch. */ + endedAfter?: number; + /** Optional. Absolute local path. */ + filename?: string; + /** Optional. Indicates whether the download is progressing, interrupted, or complete. */ + state?: string; + /** Optional. Limits results to DownloadItem that started after the given ms since the epoch. */ + startedAfter?: number; + /** Optional. The file's MIME type. */ + mime?: string; + /** Optional. Number of bytes in the whole file post-decompression, or -1 if unknown. */ + fileSize?: number; + /** Optional. The time when the download began in ISO 8601 format. */ + startTime?: number; + /** Optional. Absolute URL. */ + url?: string; + /** Optional. Limits results to DownloadItem that started before the given ms since the epoch. */ + startedBefore?: number; + /** Optional. The maximum number of matching DownloadItem returned. Defaults to 1000. Set to 0 in order to return all matching DownloadItem. See search for how to page through results. */ + limit?: number; + /** Optional. Why a download was interrupted. */ + error?: number; + /** Optional. The time when the download ended in ISO 8601 format. */ + endTime?: number; + /** Optional. Whether the downloaded file exists; */ + exists?: boolean; + } + + interface DownloadFilenameSuggestion { + /** The DownloadItem's new target DownloadItem.filename, as a path relative to the user's default Downloads directory, possibly containing subdirectories. Absolute paths, empty paths, and paths containing back-references ".." will be ignored. */ + filename: string; + /** Optional. The action to take if filename already exists. */ + conflictAction?: string; + } + + interface DownloadChangedEvent extends chrome.events.Event { + /** + * When any of a DownloadItem's properties except bytesReceived and estimatedEndTime changes, this event fires with the downloadId and an object containing the properties that changed. + * @param callback The callback parameter should be a function that looks like this: + * function(object downloadDelta) {...}; + */ + addListener(callback: (downloadDelta: DownloadDelta) => void): void; + } + + interface DownloadCreatedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( DownloadItem downloadItem) {...}; + */ + addListener(callback: (downloadItem: DownloadItem) => void): void; + } + + interface DownloadErasedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(integer downloadId) {...}; + * Parameter downloadId: The id of the DownloadItem that was erased. + */ + addListener(callback: (downloadId: number) => void): void; + } + + interface DownloadDeterminingFilenameEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( DownloadItem downloadItem, function suggest) {...}; + */ + addListener(callback: (downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void): void; + } + + /** + * Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page. + * @param callback The callback parameter should be a function that looks like this: + * function(array of DownloadItem results) {...}; + */ + export function search(query: DownloadQuery, callback: (results: DownloadItem[]) => void): void; + /** + * Pause the download. If the request was successful the download is in a paused state. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active. + * @param downloadId The id of the download to pause. + * @param callback Called when the pause request is completed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function pause(downloadId: number, callback?: () => void): void; + /** + * Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message. + * @param downloadId The identifier for the download. + * @param callback A URL to an image that represents the download. + * The callback parameter should be a function that looks like this: + * function(string iconURL) {...}; + */ + export function getFileIcon(downloadId: number, callback: (iconURL: string) => void): void; + /** + * Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message. + * @param downloadId The identifier for the download. + * @param callback A URL to an image that represents the download. + * The callback parameter should be a function that looks like this: + * function(string iconURL) {...}; + */ + export function getFileIcon(downloadId: number, options: GetFileIconOptions, callback: (iconURL: string) => void): void; + /** + * Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active. + * @param downloadId The id of the download to resume. + * @param callback Called when the resume request is completed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function resume(downloadId: number, callback?: () => void): void; + /** + * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore. + * @param downloadId The id of the download to cancel. + * @param callback Called when the cancel request is completed. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function cancel(downloadId: number, callback?: () => void): void; + /** + * Download a URL. If the URL uses the HTTP[S] protocol, then the request will include all cookies currently set for its hostname. If both filename and saveAs are specified, then the Save As dialog will be displayed, pre-populated with the specified filename. If the download started successfully, callback will be called with the new DownloadItem's downloadId. If there was an error starting the download, then callback will be called with downloadId=undefined and runtime.lastError will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. Extensions must not parse it. + * @param options What to download and how. + * @param callback Called with the id of the new DownloadItem. + * If you specify the callback parameter, it should be a function that looks like this: + * function(integer downloadId) {...}; + */ + export function download(options: DownloadOptions, callback?: (downloadId: number) => void): void; + /** + * Open the downloaded file now if the DownloadItem is complete; otherwise returns an error through runtime.lastError. Requires the "downloads.open" permission in addition to the "downloads" permission. An onChanged event will fire when the item is opened for the first time. + * @param downloadId The identifier for the downloaded file. + */ + export function open(downloadId: number): void; + /** + * Show the downloaded file in its folder in a file manager. + * @param downloadId The identifier for the downloaded file. + */ + export function show(downloadId: number): void; + /** Show the default Downloads folder in a file manager. */ + export function showDefaultFolder(): void; + /** + * Erase matching DownloadItem from history without deleting the downloaded file. An onErased event will fire for each DownloadItem that matches query, then callback will be called. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(array of integer erasedIds) {...}; + */ + export function erase(query: DownloadQuery, callback: (erasedIds: number[]) => void): void; + /** + * Remove the downloaded file if it exists and the DownloadItem is complete; otherwise return an error through runtime.lastError. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeFile(downloadId: number, callback?: () => void): void; + /** + * Prompt the user to accept a dangerous download. Can only be called from a visible context (tab, window, or page/browser action popup). Does not automatically accept dangerous downloads. If the download is accepted, then an onChanged event will fire, otherwise nothing will happen. When all the data is fetched into a temporary file and either the download is not dangerous or the danger has been accepted, then the temporary file is renamed to the target filename, the |state| changes to 'complete', and onChanged fires. + * @param downloadId The identifier for the DownloadItem. + * @param callback Called when the danger prompt dialog closes. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function acceptDanger(downloadId: number, callback: () => void): void; + /** Initiate dragging the downloaded file to another application. Call in a javascript ondragstart handler. */ + export function drag(downloadId: number): void; + /** Enable or disable the gray shelf at the bottom of every window associated with the current browser profile. The shelf will be disabled as long as at least one extension has disabled it. Enabling the shelf while at least one other extension has disabled it will return an error through runtime.lastError. Requires the "downloads.shelf" permission in addition to the "downloads" permission. */ + export function setShelfEnabled(enabled: boolean): void; + + /** When any of a DownloadItem's properties except bytesReceived and estimatedEndTime changes, this event fires with the downloadId and an object containing the properties that changed. */ + var onChanged: DownloadChangedEvent; + /** This event fires with the DownloadItem object when a download begins. */ + var onCreated: DownloadCreatedEvent; + /** Fires with the downloadId when a download is erased from history. */ + var onErased: DownloadErasedEvent; + /** During the filename determination process, extensions will be given the opportunity to override the target DownloadItem.filename. Each extension may not register more than one listener for this event. Each listener must call suggest exactly once, either synchronously or asynchronously. If the listener calls suggest asynchronously, then it must return true. If the listener neither calls suggest synchronously nor returns true, then suggest will be called automatically. The DownloadItem will not complete until all listeners have called suggest. Listeners may call suggest without any arguments in order to allow the download to use downloadItem.filename for its filename, or pass a suggestion object to suggest in order to override the target filename. If more than one extension overrides the filename, then the last extension installed whose listener passes a suggestion object to suggest wins. In order to avoid confusion regarding which extension will win, users should not install extensions that may conflict. If the download is initiated by download and the target filename is known before the MIME type and tentative filename have been determined, pass filename to download instead. */ + var onDeterminingFilename: DownloadDeterminingFilenameEvent; +} + +//////////////////// +// Enterprise Platform Keys +//////////////////// +/** + * Use the chrome.enterprise.platformKeys API to generate hardware-backed keys and to install certificates for these keys. The certificates will be managed by the platform and can be used for TLS authentication, network access or by other extension through chrome.platformKeys. + * Availability: Since Chrome 37. + * Permissions: "enterprise.platformKeys" + * Important: This API works only on Chrome OS. + * Note: This API is only for extensions pre-installed by policy. + */ +declare module chrome.enterprise.platformKeys { + interface Token { + /** + * Uniquely identifies this Token. + * Static IDs are "user" and "system", referring to the platform's user-specific and the system-wide hardware token, respectively. Any other tokens (with other identifiers) might be returned by enterprise.platformKeys.getTokens. + */ + id: string; + /** + * Implements the WebCrypto's SubtleCrypto interface. The cryptographic operations, including key generation, are hardware-backed. + * Only non-extractable RSASSA-PKCS1-V1_5 keys with modulusLength up to 2048 can be generated. Each key can be used for signing data at most once. + * Keys generated on a specific Token cannot be used with any other Tokens, nor can they be used with window.crypto.subtle. Equally, Key objects created with window.crypto.subtle cannot be used with this interface. + */ + subtleCrypto: SubtleCrypto; + } + + /** + * Returns the available Tokens. In a regular user's session the list will always contain the user's token with id "user". If a system-wide TPM token is available, the returned list will also contain the system-wide token with id "system". The system-wide token will be the same for all sessions on this device (device in the sense of e.g. a Chromebook). + * @param callback Invoked by getTokens with the list of available Tokens. + * The callback parameter should be a function that looks like this: + * function(array of Token tokens) {...}; + * Parameter tokens: The list of available tokens. + */ + export function getToken(callback: (tokens: Token[]) => void): void; + /** + * Returns the list of all client certificates available from the given token. Can be used to check for the existence and expiration of client certificates that are usable for a certain authentication. + * @param tokenId The id of a Token returned by getTokens. + * @param callback Called back with the list of the available certificates. + * The callback parameter should be a function that looks like this: + * function(array of ArrayBuffer certificates) {...}; + * Parameter certificates: The list of certificates, each in DER encoding of a X.509 certificate. + */ + export function getCertificates(tokenId: string, callback: (certificates: ArrayBuffer) => void): void; + /** + * Imports certificate to the given token if the certified key is already stored in this token. After a successful certification request, this function should be used to store the obtained certificate and to make it available to the operating system and browser for authentication. + * @param tokenId The id of a Token returned by getTokens. + * @param certificate The DER encoding of a X.509 certificate. + * @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 importCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void; + /** + * Removes certificate from the given token if present. Should be used to remove obsolete certificates so that they are not considered during authentication and do not clutter the certificate choice. Should be used to free storage in the certificate store. + * @param tokenId The id of a Token returned by getTokens. + * @param certificate The DER encoding of a X.509 certificate. + * @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 removeCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void; +} + +//////////////////// +// Events +//////////////////// +/** + * The chrome.events namespace contains common types used by APIs dispatching events to notify you when something interesting happens. + * Availability: Since Chrome 21. + */ +declare module chrome.events { + /** Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */ + interface UrlFilter { + /** Optional. Matches if the scheme of the URL is equal to any of the schemes specified in the array. */ + schemes?: string[]; + /** + * Optional. + * Since Chrome 23. + * Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. + */ + urlMatches?: string; + /** Optional. Matches if the path segment of the URL contains a specified string. */ + pathContains?: string; + /** Optional. Matches if the host name of the URL ends with a specified string. */ + hostSuffix?: string; + /** Optional. Matches if the host name of the URL starts with a specified string. */ + hostPrefix?: string; + /** Optional. Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name. */ + hostContains?: string; + /** Optional. Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlContains?: string; + /** Optional. Matches if the query segment of the URL ends with a specified string. */ + querySuffix?: string; + /** Optional. Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlPrefix?: string; + /** Optional. Matches if the host name of the URL is equal to a specified string. */ + hostEquals?: string; + /** Optional. Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlEquals?: string; + /** Optional. Matches if the query segment of the URL contains a specified string. */ + queryContains?: string; + /** Optional. Matches if the path segment of the URL starts with a specified string. */ + pathPrefix?: string; + /** Optional. Matches if the path segment of the URL is equal to a specified string. */ + pathEquals?: string; + /** Optional. Matches if the path segment of the URL ends with a specified string. */ + pathSuffix?: string; + /** Optional. Matches if the query segment of the URL is equal to a specified string. */ + queryEquals?: string; + /** Optional. Matches if the query segment of the URL starts with a specified string. */ + queryPrefix?: string; + /** Optional. Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */ + urlSuffix?: string; + /** Optional. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. */ + ports?: any[]; + /** + * Optional. + * Since Chrome 28. + * Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the RE2 syntax. + */ + originAndPathMatches?: string; + } + + /** An object which allows the addition and removal of listeners for a Chrome event. */ + interface Event { + /** + * Registers an event listener callback to an event. + * @param callback Called when an event occurs. The parameters of this function depend on the type of event. + * The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: Function): void; + /** + * Returns currently registered rules. + * @param callback Called with registered rules. + * The callback parameter should be a function that looks like this: + * function(array of Rule rules) {...}; + * Parameter rules: Rules that were registered, the optional parameters are filled with values. + */ + getRules(callback: (rules: Rule[]) => void): void; + /** + * Returns currently registered rules. + * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are returned. + * @param callback Called with registered rules. + * The callback parameter should be a function that looks like this: + * function(array of Rule rules) {...}; + * Parameter rules: Rules that were registered, the optional parameters are filled with values. + */ + getRules(ruleIdentifiers: string[], callback: (rules: Rule[]) => void): void; + /** + * @param callback Listener whose registration status shall be tested. + */ + hasListener(callback: Function): boolean; + /** + * Unregisters currently registered rules. + * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are unregistered. + * @param callback Called when rules were unregistered. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + removeRules(ruleIdentifiers?: string[], callback?: () => void): void; + /** + * Unregisters currently registered rules. + * @param callback Called when rules were unregistered. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + removeRules(callback?: () => void): void; + /** + * Registers rules to handle events. + * @param rules Rules to be registered. These do not replace previously registered rules. + * @param callback Called with registered rules. + * If you specify the callback parameter, it should be a function that looks like this: + * function(array of Rule rules) {...}; + * Parameter rules: Rules that were registered, the optional parameters are filled with values. + */ + addRules(rules: Rule[], callback?: (rules: Rule[]) => void): void; + /** + * Deregisters an event listener callback from an event. + * @param callback Listener that shall be unregistered. + * The callback parameter should be a function that looks like this: + * function() {...}; + */ + removeListener(callback: () => void): void; + hasListeners(): boolean; + } + + /** Description of a declarative rule for handling events. */ + interface Rule { + /** Optional. Optional priority of this rule. Defaults to 100. */ + priority?: number; + /** List of conditions that can trigger the actions. */ + conditions: any[]; + /** Optional. Optional identifier that allows referencing this rule. */ + id?: string; + /** List of actions that are triggered if one of the condtions is fulfilled. */ + actions: any[]; + /** + * Optional. + * Since Chrome 28. + * Tags can be used to annotate rules and perform operations on sets of rules. + */ + tags?: string[]; + } +} + +//////////////////// +// Extension +//////////////////// +/** + * The chrome.extension API has utilities that can be used by any extension page. It includes support for exchanging messages between an extension and its content scripts or between extensions, as described in detail in Message Passing. + * Availability: Since Chrome 5. + */ +declare module chrome.extension { + interface FetchProperties { + /** Optional. The window to restrict the search to. If omitted, returns all views. */ + windowId?: number; + /** Optional. The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'notification', 'popup'. */ + type?: string; + } + + interface LastError { + /** Description of the error that has taken place. */ + message: string; + } + + interface OnRequestEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(any request, runtime.MessageSender sender, function sendResponse) {...}; + * Parameter request: The request sent by the calling script. + * Parameter sendResponse: Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response. If you have more than one onRequest listener in the same document, then only one may send a response. + */ + addListener(callback: (request: any, sender: runtime.MessageSender, sendResponse: () => void) => void): void; + /** + * @param callback The callback parameter should be a function that looks like this: + * function(runtime.MessageSender sender, function sendResponse) {...}; + * Parameter sendResponse: Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response. If you have more than one onRequest listener in the same document, then only one may send a response. + */ + addListener(callback: (sender: runtime.MessageSender, sendResponse: () => void) => void): void; + } + + /** + * Since Chrome 7. + * True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior. + */ + var inIncognitoContext: boolean; + /** Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be undefined. */ + var lastError: LastError; + + /** Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page. */ + export function getBackgroundPage(): Window; + /** + * Converts a relative path within an extension install directory to a fully-qualified URL. + * @param path A path to a resource within an extension expressed relative to its install directory. + */ + export function getURL(path: string): string; + /** + * Sets the value of the ap CGI parameter used in the extension's update URL. This value is ignored for extensions that are hosted in the Chrome Extension Gallery. + * Since Chrome 9. + */ + export function setUpdateUrlData(data: string): void; + /** Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension. */ + export function getViews(fetchProperties?: FetchProperties): Window[]; + /** + * Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox. + * Since Chrome 12. + * @param callback The callback parameter should be a function that looks like this: + * function(boolean isAllowedAccess) {...}; + * Parameter isAllowedAccess: True if the extension can access the 'file://' scheme, false otherwise. + */ + export function isAllowedFileSchemeAccess(callback: (isAllowedAccess: boolean) => void): void; + /** + * Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox. + * Since Chrome 12. + * @param callback The callback parameter should be a function that looks like this: + * function(boolean isAllowedAccess) {...}; + * Parameter isAllowedAccess: True if the extension has access to Incognito mode, false otherwise. + */ + export function isAllowedIncognitoAccess(callback: (isAllowedAccess: boolean) => void): void; + /** + * Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension. + * @deprecated Deprecated since Chrome 33. Please use runtime.sendMessage. + * @param extensionId The extension ID of the extension you want to connect to. If omitted, default is your own extension. + * @param responseCallback If you specify the responseCallback parameter, it should be a function that looks like this: + * function(any response) {...}; + * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendRequest(extensionId: string, request: any, responseCallback?: (response: any) => void): void; + /** + * Sends a single request to other listeners within the extension. Similar to runtime.connect, but only sends a single request with an optional response. The extension.onRequest event is fired in each page of the extension. + * @deprecated Deprecated since Chrome 33. Please use runtime.sendMessage. + * @param responseCallback If you specify the responseCallback parameter, it should be a function that looks like this: + * function(any response) {...}; + * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendRequest(request: any, responseCallback?: (response: any) => void): void; + /** + * Returns an array of the JavaScript 'window' objects for each of the tabs running inside the current extension. If windowId is specified, returns only the 'window' objects of tabs attached to the specified window. + * @deprecated Deprecated since Chrome 33. Please use extension.getViews {type: "tab"}. + */ + export function getExtensionTabs(windowId?: number): Window[]; + + /** + * Fired when a request is sent from either an extension process or a content script. + * @deprecated Deprecated since Chrome 33. Please use runtime.onMessage. + */ + var onRequest: OnRequestEvent; + /** + * Fired when a request is sent from another extension. + * @deprecated Deprecated since Chrome 33. Please use runtime.onMessageExternal. + */ + var onRequestExternal: OnRequestEvent; +} + +//////////////////// +// File Browser Handler +//////////////////// +/** + * Use the chrome.fileBrowserHandler API to extend the Chrome OS file browser. For example, you can use this API to enable users to upload files to your website. + * Availability: Since Chrome 12. + * Permissions: "fileBrowserHandler" + * Important: This API works only on Chrome OS. + */ +declare module chrome.fileBrowserHandler { + interface SelectionParams { + /** + * Optional. + * List of file extensions that the selected file can have. The list is also used to specify what files to be shown in the select file dialog. Files with the listed extensions are only shown in the dialog. Extensions should not include the leading '.'. Example: ['jpg', 'png'] + * Since Chrome 23. + */ + allowedFileExtensions?: string[]; + /** Suggested name for the file. */ + suggestedName: string; + } + + interface SelectionResult { + /** Optional. Selected file entry. It will be null if a file hasn't been selected. */ + entry?: Object; + /** Whether the file has been selected. */ + success: boolean; + } + + /** Event details payload for fileBrowserHandler.onExecute event. */ + interface FileHandlerExecuteEventDetails { + /** Optional. The ID of the tab that raised this event. Tab IDs are unique within a browser session. */ + tab_id?: number; + /** Array of Entry instances representing files that are targets of this action (selected in ChromeOS file browser). */ + entries: any[]; + } + + interface FileBrowserHandlerExecuteEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string id, FileHandlerExecuteEventDetails details) {...}; + * Parameter id: File browser action id as specified in the listener component's manifest. + * Parameter details: File handler execute event details. + */ + addListener(callback: (id: string, details: FileHandlerExecuteEventDetails) => void): void; + } + + /** + * Prompts user to select file path under which file should be saved. When the file is selected, file access permission required to use the file (read, write and create) are granted to the caller. The file will not actually get created during the function call, so function caller must ensure its existence before using it. The function has to be invoked with a user gesture. + * Since Chrome 21. + * @param selectionParams Parameters that will be used while selecting the file. + * @param callback Function called upon completion. + * The callback parameter should be a function that looks like this: + * function(object result) {...}; + * Parameter result: Result of the method. + */ + export function selectFile(selectionParams: SelectionParams, callback: (result: SelectionResult) => void): void; + + /** Fired when file system action is executed from ChromeOS file browser. */ + var onExecute: FileBrowserHandlerExecuteEvent; +} + +//////////////////// +// File System Provider +//////////////////// +/** + * Use the chrome.fileSystemProvider API to create file systems, that can be accessible from the file manager on Chrome OS. + * Availability: Since Chrome 40. + * Permissions: "fileSystemProvider" + * Important: This API works only on Chrome OS. + */ +declare module chrome.fileSystemProvider { + interface OpenedFileInfo { + /** A request ID to be be used by consecutive read/write and close requests. */ + openRequestId: number; + /** The path of the opened file. */ + filePath: string; + /** Whether the file was opened for reading or writing. */ + mode: string; + } + + interface FileWatchersInfo { + /** The path of the entry being observed. */ + entryPath: string; + /** Whether watching should include all child entries recursively. It can be true for directories only. */ + recursive: boolean; + /** Optional. Tag used by the last notification for the watcher. */ + lastTag?: string; + } + + interface EntryMetadata { + /** True if it is a directory. */ + isDirectory: boolean; + /** Name of this entry (not full path name). Must not contain '/'. For root it must be empty. */ + name: string; + /** File size in bytes. */ + size: number; + /** The last modified time of this entry. */ + modificationTime: Date; + /** Optional. Mime type for the entry. */ + mimeType?: string; + /** Optional. Thumbnail image as a data URI in either PNG, JPEG or WEBP format, at most 32 KB in size. Optional, but can be provided only when explicitly requested by the onGetMetadataRequested event. */ + thumbnail?: string; + } + + interface FileSystemInfo { + /** The identifier of the file system. */ + fileSystemId: string; + /** A human-readable name for the file system. */ + displayName: string; + /** Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */ + writable: boolean; + /** + * The maximum number of files that can be opened at once. If 0, then not limited. + * @since Since Chrome 42. + */ + openedFilesLimit: number; + /** + * List of currently opened files. + * @since Since Chrome 42. + */ + openedFiles: OpenedFileInfo[]; + /** + * Optional. + * Whether the file system supports the tag field for observing directories. + * @since Since Chrome 45. Warning: this is the current Beta channel. + */ + supportsNotifyTag?: boolean; + /** + * List of watchers. + * @since Since Chrome 45. Warning: this is the current Beta channel. + */ + watchers: FileWatchersInfo[]; + } + + /** @since Since Chrome 45. Warning: this is the current Beta channel. */ + interface GetActionsRequestedOptions { + /** The identifier of the file system related to this operation. */ + fileSystemId: string; + /** The unique identifier of this request. */ + requestId: number; + /** The path of the entry to return the list of actions for. */ + entryPath: string; + } + + /** @since Since Chrome 45. Warning: this is the current Beta channel. */ + interface Action { + /** The identifier of the action. Any string or CommonActionId for common actions. */ + id: string; + /** Optional. The title of the action. It may be ignored for common actions. */ + title?: string; + } + + /** @since Since Chrome 45. Warning: this is the current Beta channel. */ + interface ExecuteActionRequestedOptions { + /** The identifier of the file system related to this operation. */ + fileSystemId: string; + /** The unique identifier of this request. */ + requestId: number; + /** The path of the entry to be used for the action. */ + entryPath: string; + /** The identifier of the action to be executed. */ + actionId: string; + } + + interface MountOptions { + /** The string indentifier of the file system. Must be unique per each extension. */ + fileSystemId: string; + /** A human-readable name for the file system. */ + displayName: string; + /** Optional. Whether the file system supports operations which may change contents of the file system (such as creating, deleting or writing to files). */ + writable?: boolean; + /** + * Optional. + * The maximum number of files that can be opened at once. If not specified, or 0, then not limited. + * @since Since Chrome 41. + */ + openedFilesLimit?: number; + /** + * Optional. + * Whether the file system supports the tag field for observed directories. + * @since Since Chrome 45. Warning: this is the current Beta channel. + */ + supportsNotifyTag?: boolean; + } + + interface UnmountOptions { + /** The identifier of the file system to be unmounted. */ + fileSystemId: string; + } + + interface NotificationChange { + /** The path of the changed entry. */ + entryPath: string; + /** The type of the change which happened to the entry. */ + changeType: string; + } + + interface NotificationOptions { + /** The identifier of the file system related to this change. */ + fileSystemId: string; + /** The path of the observed entry. */ + observedPath: string; + /** Mode of the observed entry. */ + recursive: boolean; + /** The type of the change which happened to the observed entry. If it is DELETED, then the observed entry will be automatically removed from the list of observed entries. */ + changeType: string; + /** Optional. List of changes to entries within the observed directory (including the entry itself) */ + changes?: NotificationChange[]; + /** Optional. Tag for the notification. Required if the file system was mounted with the supportsNotifyTag option. Note, that this flag is necessary to provide notifications about changes which changed even when the system was shutdown. */ + tag?: string; + } + + interface RequestedEventOptions { + /** The identifier of the file system related to this operation. */ + fileSystemId: string; + /** The unique identifier of this request. */ + requestId: number; + } + + interface EntryPathRequestedEventOptions extends RequestedEventOptions { + /** The path of the entry to which this operation is related to. */ + entryPath: string; + } + + interface MetadataRequestedEventOptions extends EntryPathRequestedEventOptions { + /** Set to true if the thumbnail is requested. */ + thumbnail: boolean; + } + + interface DirectoryPathRequestedEventOptions extends RequestedEventOptions { + /** The path of the directory which is to be operated on. */ + directoryPath: string; + } + + interface FilePathRequestedEventOptions extends RequestedEventOptions { + /** The path of the entry for the operation */ + filePath: string; + } + + interface OpenFileRequestedEventOptions extends FilePathRequestedEventOptions { + /** Whether the file will be used for reading or writing. */ + mode: string; + } + + interface OpenedFileRequestedEventOptions extends RequestedEventOptions { + /** A request ID used to open the file. */ + openRequestId: number; + } + + interface OpenedFileOffsetRequestedEventOptions extends OpenedFileRequestedEventOptions { + /** Position in the file (in bytes) to start reading from. */ + offset: number; + /** Number of bytes to be returned. */ + length: number; + } + + interface DirectoryPathRecursiveRequestedEventOptions extends DirectoryPathRequestedEventOptions { + /** Whether the operation is recursive (for directories only). */ + recursive: boolean; + } + + interface EntryPathRecursiveRequestedEventOptions extends EntryPathRequestedEventOptions { + /** Whether the operation is recursive (for directories only). */ + recursive: boolean; + } + + interface SourceTargetPathRequestedEventOptions extends RequestedEventOptions { + /** The source path for the operation. */ + sourcePath: string; + /** The destination path for the operation. */ + targetPath: string; + } + + interface FilePathLengthRequestedEventOptions extends FilePathRequestedEventOptions { + /** Number of bytes to be retained after the operation completes. */ + length: number; + } + + interface OpenedFileIoRequestedEventOptions extends OpenedFileRequestedEventOptions { + /** Position in the file (in bytes) to start operating from. */ + offset: number; + /** Buffer of bytes to be operated on the file. */ + data: ArrayBuffer; + } + + interface OperationRequestedEventOptions extends RequestedEventOptions { + /** An ID of the request to which this operation is related. */ + operationRequestId: number; + } + + interface RequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void): void; + } + + interface MetadataRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: MetadataRequestedEventOptions, successCallback: (metadata: EntryMetadata) => void, errorCallback: (error: string) => void) => void): void; + } + + interface DirectoryPathRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: DirectoryPathRequestedEventOptions, successCallback: (entries: EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void): void; + } + + interface OpenFileRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void): void; + } + + interface OpenedFileRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void): void; + } + + interface OpenedFileOffsetRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void): void; + } + + interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void): void; + } + + interface EntryPathRecursiveRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void): void; + } + + interface FilePathRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void): void; + } + + interface SourceTargetPathRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void): void; + } + + interface FilePathLengthRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void): void; + } + + interface OpenedFileIoRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void): void; + } + + interface OperationRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object options, function successCallback, function errorCallback) {...}; + */ + addListener(callback: (options: OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void): void; + } + + interface OptionlessRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(function successCallback, function errorCallback) {...}; + */ + addListener(callback: (successCallback: Function, errorCallback: (error: string) => void) => void): void; + } + + /** + * Mounts a file system with the given fileSystemId and displayName. displayName will be shown in the left panel of Files.app. displayName can contain any characters including '/', but cannot be an empty string. displayName must be descriptive but doesn't have to be unique. The fileSystemId must not be an empty string. + * Depending on the type of the file system being mounted, the source option must be set appropriately. + * In case of an error, runtime.lastError will be set with a corresponding error code. + * @param callback A generic result callback to indicate success or failure. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function mount(options: MountOptions, callback?: () => void): void; + /** + * Unmounts a file system with the given fileSystemId. It must be called after onUnmountRequested is invoked. Also, the providing extension can decide to perform unmounting if not requested (eg. in case of lost connection, or a file error). + * In case of an error, runtime.lastError will be set with a corresponding error code. + * @param callback A generic result callback to indicate success or failure. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function unmount(options: UnmountOptions, callback?: () => void): void; + /** + * Returns all file systems mounted by the extension. + * @param callback Callback to receive the result of getAll function. + * The callback parameter should be a function that looks like this: + * function(array of FileSystemInfo fileSystems) {...}; + */ + export function getAll(callback: (fileSystems: FileSystemInfo[]) => void): void; + /** + * Returns information about a file system with the passed fileSystemId. + * @since Since Chrome 42. + * @param callback Callback to receive the result of get function. + * The callback parameter should be a function that looks like this: + * function(FileSystemInfo fileSystem) {...}; + */ + export function get(fileSystemId: string, callback: (fileSystem: FileSystemInfo) => void): void; + /** + * Notifies about changes in the watched directory at observedPath in recursive mode. If the file system is mounted with supportsNofityTag, then tag must be provided, and all changes since the last notification always reported, even if the system was shutdown. The last tag can be obtained with getAll. + * To use, the file_system_provider.notify manifest option must be set to true. + * Value of tag can be any string which is unique per call, so it's possible to identify the last registered notification. Eg. if the providing extension starts after a reboot, and the last registered notification's tag is equal to "123", then it should call notify for all changes which happened since the change tagged as "123". It cannot be an empty string. + * Not all providers are able to provide a tag, but if the file system has a changelog, then the tag can be eg. a change number, or a revision number. + * Note that if a parent directory is removed, then all descendant entries are also removed, and if they are watched, then the API must be notified about the fact. Also, if a directory is renamed, then all descendant entries are in fact removed, as there is no entry under their original paths anymore. + * In case of an error, runtime.lastError will be set will a corresponding error code. + * @param callback A generic result callback to indicate success or failure. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function notify(options: NotificationOptions, callback: () => void): void; + + /** Raised when unmounting for the file system with the fileSystemId identifier is requested. In the response, the unmount API method must be called together with successCallback. If unmounting is not possible (eg. due to a pending operation), then errorCallback must be called. */ + var onUnmountRequested: RequestedEvent; + /** Raised when metadata of a file or a directory at entryPath is requested. The metadata must be returned with the successCallback call. In case of an error, errorCallback must be called. */ + var onGetMetadataRequested: MetadataRequestedEvent; + /** Raised when contents of a directory at directoryPath are requested. The results must be returned in chunks by calling the successCallback several times. In case of an error, errorCallback must be called. */ + var onReadDirectoryRequested: DirectoryPathRequestedEvent; + /** Raised when opening a file at filePath is requested. If the file does not exist, then the operation must fail. Maximum number of files opened at once can be specified with MountOptions. */ + var onOpenFileRequested: OpenFileRequestedEvent; + /** Raised when opening a file previously opened with openRequestId is requested to be closed. */ + var onCloseFileRequested: OpenedFileRequestedEvent; + /** Raised when reading contents of a file opened previously with openRequestId is requested. The results must be returned in chunks by calling successCallback several times. In case of an error, errorCallback must be called. */ + var onReadFileRequested: OpenedFileOffsetRequestedEvent; + /** Raised when creating a directory is requested. The operation must fail with the EXISTS error if the target directory already exists. If recursive is true, then all of the missing directories on the directory path must be created. */ + var onCreateDirectoryRequested: DirectoryPathRecursiveRequestedEvent; + /** Raised when deleting an entry is requested. If recursive is true, and the entry is a directory, then all of the entries inside must be recursively deleted as well. */ + var onDeleteEntryRequested: EntryPathRecursiveRequestedEvent; + /** Raised when creating a file is requested. If the file already exists, then errorCallback must be called with the "EXISTS" error code. */ + var onCreateFileRequested: FilePathRequestedEvent; + /** Raised when copying an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */ + var onCopyEntryRequested: SourceTargetPathRequestedEvent; + /** Raised when moving an entry (recursively if a directory) is requested. If an error occurs, then errorCallback must be called. */ + var onMoveEntryRequested: SourceTargetPathRequestedEvent; + /** Raised when truncating a file to a desired length is requested. If an error occurs, then errorCallback must be called. */ + var onTruncateRequested: FilePathLengthRequestedEvent; + /** Raised when writing contents to a file opened previously with openRequestId is requested. */ + var onWriteFileRequested: OpenedFileIoRequestedEvent; + /** Raised when aborting an operation with operationRequestId is requested. The operation executed with operationRequestId must be immediately stopped and successCallback of this abort request executed. If aborting fails, then errorCallback must be called. Note, that callbacks of the aborted operation must not be called, as they will be ignored. Despite calling errorCallback, the request may be forcibly aborted. */ + var onAbortRequested: OperationRequestedEvent; + /** + * Raised when showing a configuration dialog for fileSystemId is requested. If it's handled, the file_system_provider.configurable manfiest option must be set to true. + * @since Since Chrome 44. + */ + var onConfigureRequested: RequestedEvent; + /** + * Raised when showing a dialog for mounting a new file system is requested. If the extension/app is a file handler, then this event shouldn't be handled. Instead app.runtime.onLaunched should be handled in order to mount new file systems when a file is opened. For multiple mounts, the file_system_provider.multiple_mounts manifest option must be set to true. + * @since Since Chrome 44. + */ + var onMountRequested: OptionlessRequestedEvent; + /** + * Raised when setting a new directory watcher is requested. If an error occurs, then errorCallback must be called. + * @since Since Chrome 45. Warning: this is the current Beta channel. + */ + var onAddWatcherRequested: EntryPathRecursiveRequestedEvent; + /** + * Raised when the watcher should be removed. If an error occurs, then errorCallback must be called. + * @since Since Chrome 45. Warning: this is the current Beta channel. + */ + var onRemoveWatcherRequested: EntryPathRecursiveRequestedEvent; +} + +//////////////////// +// Font Settings +//////////////////// +/** + * Use the chrome.fontSettings API to manage Chrome's font settings. + * Availability: Since Chrome 22. + * Permissions: "fontSettings" + */ +declare module chrome.fontSettings { + /** Represents a font name. */ + interface FontName { + /** The display name of the font. */ + displayName: string; + /** The font ID. */ + fontId: string; + } + + interface DefaultFontSizeDetails { + /** The font size in pixels. */ + pixelSize: number; + } + + interface FontDetails { + /** The generic font family for the font. */ + genericFamily: string; + /** Optional. The script for the font. If omitted, the global script font setting is affected. */ + script?: string; + } + + interface FullFontDetails { + /** The generic font family for which the font setting has changed. */ + genericFamily: string; + /** The level of control this extension has over the setting. */ + levelOfControl: string; + /** Optional. The script code for which the font setting has changed. */ + script?: string; + /** The font ID. See the description in getFont. */ + fontId: string; + } + + interface FontDetailsResult { + /** The level of control this extension has over the setting. */ + levelOfControl: string; + /** The font ID. Rather than the literal font ID preference value, this may be the ID of the font that the system resolves the preference value to. So, fontId can differ from the font passed to setFont, if, for example, the font is not available on the system. The empty string signifies fallback to the global script font setting. */ + fontId: string; + } + + interface FontSizeDetails { + /** The font size in pixels. */ + pixelSize: number; + /** The level of control this extension has over the setting. */ + levelOfControl: string; + } + + interface SetFontSizeDetails { + /** The font size in pixels. */ + pixelSize: number; + } + + interface SetFontDetails extends FontDetails { + /** The font ID. The empty string means to fallback to the global script font setting. */ + fontId: string; + } + + interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; + */ + addListener(callback: (details: FontSizeDetails) => void): void; + } + + interface DefaultFontSizeChangedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; + */ + addListener(callback: (details: FontSizeDetails) => void): void; + } + + interface MinimumFontSizeChangedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; + */ + addListener(callback: (details: FontSizeDetails) => void): void; + } + + interface FontChangedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; + */ + addListener(callback: (details: FullFontDetails) => void): void; + } + + /** + * Sets the default font size. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setDefaultFontSize(details: DefaultFontSizeDetails, callback?: Function): void; + /** + * Gets the font for a given script and generic font family. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; + */ + export function getFont(details: FontDetails, callback?: (details: FontDetailsResult) => void): void; + /** + * Gets the default font size. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; + */ + export function getDefaultFontSize(details?: Object, callback?: (options: FontSizeDetails) => void): void; + /** + * Gets the minimum font size. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; + */ + export function getMinimumFontSize(details?: FontSizeDetails, callback?: (options: FontSizeDetails) => void): void; + /** + * Sets the minimum font size. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setMinimumFontSize(details: SetFontSizeDetails, callback?: Function): void; + /** + * Gets the default size for fixed width fonts. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; + */ + export function getDefaultFixedFontSize(details?: Object, callback?: (details: FontSizeDetails) => void): void; + /** + * Clears the default font size set by this extension, if any. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function clearDefaultFontSize(details?: Object, callback?: Function): void; + /** + * Sets the default size for fixed width fonts. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setDefaultFixedFontSize(details: SetFontSizeDetails, callback?: Function): void; + /** + * Clears the font set by this extension, if any. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function clearFont(details: FontDetails, callback?: Function): void; + /** + * Sets the font for a given script and generic font family. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(object details) {...}; + */ + export function setFont(details: SetFontDetails, callback?: Function): void; + /** + * Clears the minimum font size set by this extension, if any. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function clearMinimumFontSize(details?: Object, callback?: Function): void; + /** + * Gets a list of fonts on the system. + * @param callback The callback parameter should be a function that looks like this: + * function(array of FontName results) {...}; + */ + export function getFontList(callback: (results: FontName[]) => void): void; + /** + * Clears the default fixed font size set by this extension, if any. + * @param details This parameter is currently unused. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function clearDefaultFixedFontSize(details: Object, callback?: Function): void; + + /** Fired when the default fixed font size setting changes. */ + var onDefaultFixedFontSizeChanged: DefaultFixedFontSizeChangedEvent; + /** Fired when the default font size setting changes. */ + var onDefaultFontSizeChanged: DefaultFontSizeChangedEvent; + /** Fired when the minimum font size setting changes. */ + var onMinimumFontSizeChanged: MinimumFontSizeChangedEvent; + /** Fired when a font setting changes. */ + var onFontChanged: FontChangedEvent; +} + +//////////////////// +// Google Cloud Messaging +//////////////////// +/** + * Use chrome.gcm to enable apps and extensions to send and receive messages through the Google Cloud Messaging Service. + * Availability: Since Chrome 35. + * Permissions: "gcm" + */ +declare module chrome.gcm { + interface OutgoingMessage { + /** The ID of the server to send the message to as assigned by Google API Console. */ + destinationId: string; + /** The ID of the message. It must be unique for each message in scope of the applications. See the Cloud Messaging documentation for advice for picking and handling an ID. */ + messageId: string; + /** Optional. Time-to-live of the message in seconds. If it is not possible to send the message within that time, an onSendError event will be raised. A time-to-live of 0 indicates that the message should be sent immediately or fail if it's not possible. The maximum and a default value of time-to-live is 86400 seconds (1 day). */ + timeToLive?: number; + /** Message data to send to the server. Case-insensitive goog. and google, as well as case-sensitive collapse_key are disallowed as key prefixes. Sum of all key/value pairs should not exceed gcm.MAX_MESSAGE_SIZE. */ + data: Object; + } + + interface IncomingMessage { + /** The message data. */ + data: Object; + /** + * Optional. + * The sender who issued the message. + * @since Since Chrome 41. + */ + from?: string; + /** + * Optional. + * The collapse key of a message. See Collapsible Messages section of Cloud Messaging documentation for details. + */ + collapseKey?: string; + } + + interface GcmError { + /** The error message describing the problem. */ + errorMessage: string; + /** Optional. The ID of the message with this error, if error is related to a specific message. */ + messageId?: string; + /** Additional details related to the error, when available. */ + detail: Object; + } + + interface MessageReceptionEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object message) {...}; + * Parameter message: A message received from another party via GCM. + */ + addListener(callback: (message: IncomingMessage) => void): void; + } + + interface MessageDeletionEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: () => void): void; + } + + interface GcmErrorEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object error) {...}; + * Parameter error: An error that occured while trying to send the message either in Chrome or on the GCM server. Application can retry sending the message with a reasonable backoff and possibly longer time-to-live. + */ + addListener(callback: (error: GcmError) => void): void; + } + + /** The maximum size (in bytes) of all key/value pairs in a message. */ + var MAX_MESSAGE_SIZE: number; + + /** + * Registers the application with GCM. The registration ID will be returned by the callback. If register is called again with the same list of senderIds, the same registration ID will be returned. + * @param senderIds A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs. + * @param callback Function called when registration completes. It should check runtime.lastError for error when registrationId is empty. + * The callback parameter should be a function that looks like this: + * function(string registrationId) {...}; + * Parameter registrationId: A registration ID assigned to the application by the GCM. + */ + export function register(senderIds: string[], callback: (registrationId: string) => void): void; + /** + * Unregisters the application from GCM. + * @param callback A function called after the unregistration completes. Unregistration was successful if runtime.lastError is not set. + * The callback parameter should be a function that looks like this: + * function() {...}; + */ + export function unregister(callback: () => void): void; + /** + * Sends a message according to its contents. + * @param message A message to send to the other party via GCM. + * @param callback A function called after the message is successfully queued for sending. runtime.lastError should be checked, to ensure a message was sent without problems. + * The callback parameter should be a function that looks like this: + * function(string messageId) {...}; + * Parameter messageId: The ID of the message that the callback was issued for. + */ + export function send(message: OutgoingMessage, callback: (messageId: string) => void): void; + + /** Fired when a message is received through GCM. */ + var onMessage: MessageReceptionEvent; + /** Fired when a GCM server had to delete messages sent by an app server to the application. See Messages deleted event section of Cloud Messaging documentation for details on handling this event. */ + var onMessagesDeleted: MessageDeletionEvent; + /** Fired when it was not possible to send a message to the GCM server. */ + var onSendError: GcmErrorEvent; +} + +//////////////////// +// History +//////////////////// +/** + * Use the chrome.history API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see Override Pages. + * Availability: Since Chrome 5. + * Permissions: "history" + */ +declare module chrome.history { + /** An object encapsulating one visit to a URL. */ + interface VisitItem { + /** The transition type for this visit from its referrer. */ + transition: string; + /** Optional. When this visit occurred, represented in milliseconds since the epoch. */ + visitTime?: number; + /** The unique identifier for this visit. */ + visitId: string; + /** The visit ID of the referrer. */ + referringVisitId: string; + /** The unique identifier for the item. */ + id: string; + } + + /** An object encapsulating one result of a history query. */ + interface HistoryItem { + /** Optional. The number of times the user has navigated to this page by typing in the address. */ + typedCount?: number; + /** Optional. The title of the page when it was last loaded. */ + title?: string; + /** Optional. The URL navigated to by a user. */ + url?: string; + /** Optional. When this page was last loaded, represented in milliseconds since the epoch. */ + lastVisitTime?: number; + /** Optional. The number of times the user has navigated to this page. */ + visitCount?: number; + /** The unique identifier for the item. */ + id: string; + } + + interface HistoryQuery { + /** A free-text query to the history service. Leave empty to retrieve all pages. */ + text: string; + /** Optional. The maximum number of results to retrieve. Defaults to 100. */ + maxResults?: number; + /** Optional. Limit results to those visited after this date, represented in milliseconds since the epoch. */ + startTime?: number; + /** Optional. Limit results to those visited before this date, represented in milliseconds since the epoch. */ + endTime?: number; + } + + interface Url { + /** The URL for the operation. It must be in the format as returned from a call to history.search. */ + url: string; + } + + interface Range { + /** Items added to history before this date, represented in milliseconds since the epoch. */ + endTime: number; + /** Items added to history after this date, represented in milliseconds since the epoch. */ + startTime: number; + } + + interface RemovedResult { + /** True if all history was removed. If true, then urls will be empty. */ + allHistory: boolean; + /** Optional. */ + urls?: string[]; + } + + interface HistoryVisitedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( HistoryItem result) {...}; + */ + addListener(callback: (result: HistoryItem) => void): void; + } + + interface HistoryVisitRemovedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object removed) {...}; + */ + addListener(callback: (removed: RemovedResult) => void): void; + } + + /** + * Searches the history for the last visit time of each page matching the query. + * @param callback The callback parameter should be a function that looks like this: + * function(array of HistoryItem results) {...}; + */ + export function search(query: HistoryQuery, callback: (results: HistoryItem[]) => void): void; + /** + * Adds a URL to the history at the current time with a transition type of "link". + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function addUrl(details: Url, callback?: () => void): void; + /** + * Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range. + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; + */ + export function deleteRange(range: Range, callback: () => void): void; + /** + * Deletes all items from the history. + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; + */ + export function deleteAll(callback: () => void): void; + /** + * Retrieves information about visits to a URL. + * @param callback The callback parameter should be a function that looks like this: + * function(array of VisitItem results) {...}; + */ + export function getVisits(details: Url, callback: (results: VisitItem[]) => void): void; + /** + * Removes all occurrences of the given URL from the history. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function deleteUrl(details: Url, callback?: () => void): void; + + /** Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded. */ + var onVisited: HistoryVisitedEvent; + /** Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history. */ + var onVisitRemoved: HistoryVisitRemovedEvent; +} + +//////////////////// +// i18n +//////////////////// +/** + * Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension. + * @since Chrome 5. + */ +declare module chrome.i18n { + /** + * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage. + * @param callback The callback parameter should be a function that looks like this: + * function(array of string languages) {...}; + * Parameter languages: Array of the accept languages of the browser, such as en-US,en,zh-CN + */ + export function getAcceptLanguages(callback: (languages: string[]) => void): void; + /** + * Gets the localized string for the specified message. If the message is missing, this method returns an empty string (''). If the format of the getMessage() call is wrong — for example, messageName is not a string or the substitutions array has more than 9 elements — this method returns undefined. + * @param messageName The name of the message, as specified in the messages.json file. + * @param substitutions Optional. Up to 9 substitution strings, if the message requires any. + */ + export function getMessage(messageName: string, substitutions?: any): string; + /** + * Gets the browser UI language of the browser. This is different from i18n.getAcceptLanguages which returns the preferred user languages. + * @since Chrome 35. + */ + export function getUILanguage(): string; +} + +//////////////////// +// Identity +//////////////////// +/** + * Use the chrome.identity API to get OAuth2 access tokens. + * Permissions: "identity" + * @since Chrome 29. + */ +declare module chrome.identity { + /** @since Chrome 32. */ + interface AccountInfo { + /** A unique identifier for the account. This ID will not change for the lifetime of the account. */ + id: string; + } + + interface TokenDetails { + /** + * Optional. + * Fetching a token may require the user to sign-in to Chrome, or approve the application's requested scopes. If the interactive flag is true, getAuthToken will prompt the user as necessary. When the flag is false or omitted, getAuthToken will return failure any time a prompt would be required. + */ + interactive?: boolean; + /** + * Optional. + * The account ID whose token should be returned. If not specified, the primary account for the profile will be used. + * account is only supported when the "enable-new-profile-management" flag is set. + * @since Chrome 37. + */ + account?: AccountInfo; + /** + * Optional. + * A list of OAuth2 scopes to request. + * When the scopes field is present, it overrides the list of scopes specified in manifest.json. + * @since Chrome 37. + */ + scopes?: string[]; + } + + interface UserInfo { + /** An email address for the user account signed into the current profile. Empty if the user is not signed in or the identity.email manifest permission is not specified. */ + email: string; + /** A unique identifier for the account. This ID will not change for the lifetime of the account. Empty if the user is not signed in or (in M41+) the identity.email manifest permission is not specified. */ + id: string; + } + + interface TokenInformation { + /** The specific token that should be removed from the cache. */ + token: string; + } + + interface WebAuthFlowOptions { + /** The URL that initiates the auth flow. */ + url: string; + /** + * Optional. + * Whether to launch auth flow in interactive mode. + * Since some auth flows may immediately redirect to a result URL, launchWebAuthFlow hides its web view until the first navigation either redirects to the final URL, or finishes loading a page meant to be displayed. + * If the interactive flag is true, the window will be displayed when a page load completes. If the flag is false or omitted, launchWebAuthFlow will return with an error if the initial navigation does not complete the flow. + */ + interactive?: boolean; + } + + interface SignInChangeEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( AccountInfo account, boolean signedIn) {...}; + */ + addListener(callback: (account: AccountInfo, signedIn: boolean) => void): void; + } + + /** + * Retrieves a list of AccountInfo objects describing the accounts present on the profile. + * getAccounts is only supported on dev channel. + * Dev channel only. + */ + export function getAccounts(callback: (accounts: AccountInfo[]) => void): void; + /** + * Gets an OAuth2 access token using the client ID and scopes specified in the oauth2 section of manifest.json. + * The Identity API caches access tokens in memory, so it's ok to call getAuthToken non-interactively any time a token is required. The token cache automatically handles expiration. + * For a good user experience it is important interactive token requests are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests, or Chrome sign in screens if they are not signed in, with with no context. In particular, do not use getAuthToken interactively when your app is first launched. + * @param details Token options. + * @param callback Called with an OAuth2 access token as specified by the manifest, or undefined if there was an error. + * If you specify the callback parameter, it should be a function that looks like this: + * function(string token) {...}; + */ + export function getAuthToken(details: TokenDetails, callback?: (token: string) => void): void; + /** + * Retrieves email address and obfuscated gaia id of the user signed into a profile. + * This API is different from identity.getAccounts in two ways. The information returned is available offline, and it only applies to the primary account for the profile. + * @since Chrome 37. + */ + export function getProfileUserInfo(callback: (userInfo: UserInfo) => void): void; + /** + * Removes an OAuth2 access token from the Identity API's token cache. + * If an access token is discovered to be invalid, it should be passed to removeCachedAuthToken to remove it from the cache. The app may then retrieve a fresh token with getAuthToken. + * @param details Token information. + * @param callback Called when the token has been removed from the cache. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function removeCachedAuthToken(details: TokenInformation, callback?: () => void): void; + /** + * Starts an auth flow at the specified URL. + * This method enables auth flows with non-Google identity providers by launching a web view and navigating it to the first URL in the provider's auth flow. When the provider redirects to a URL matching the pattern https://<app-id>.chromiumapp.org/*, the window will close, and the final redirect URL will be passed to the callback function. + * For a good user experience it is important interactive auth flows are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no context. In particular, do not launch an interactive auth flow when your app is first launched. + * @param details WebAuth flow options. + * @param callback Called with the URL redirected back to your application. + * The callback parameter should be a function that looks like this: + * function(string responseUrl) {...}; + */ + export function launchWebAuthFlow(details: WebAuthFlowOptions, callback: (responseUrl?: string) => void): void; + /** + * Generates a redirect URL to be used in launchWebAuthFlow. + * The generated URLs match the pattern https://<app-id>.chromiumapp.org/*. + * @since Chrome 33. + * @param path Optional. The path appended to the end of the generated URL. + */ + export function getRedirectURL(path?: string): void; + + /** + * Fired when signin state changes for an account on the user's profile. + * @since Chrome 33. + */ + var onSignInChanged: SignInChangeEvent; +} + +//////////////////// +// Idle +//////////////////// +/** + * Use the chrome.idle API to detect when the machine's idle state changes. + * Permissions: "idle" + * @since Chrome 6. + */ +declare module chrome.idle { + interface IdleStateChangedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( IdleState newState) {...}; + */ + addListener(callback: (newState: string) => void): void; + } + + /** + * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise. + * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected. + * Since Chrome 25. + * @param callback The callback parameter should be a function that looks like this: + * function( IdleState newState) {...}; + */ + export function queryState(detectionIntervalInSeconds: number, callback: (newState: string) => void): void; + /** + * Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds. + * @since Chrome 25. + * @param intervalInSeconds Threshold, in seconds, used to determine when the system is in an idle state. + */ + export function setDetectionInterval(intervalInSeconds: number): void; + + /** Fired when the system changes to an active, idle or locked state. The event fires with "locked" if the screen is locked or the screensaver activates, "idle" if the system is unlocked and the user has not generated any input for a specified number of seconds, and "active" when the user generates input on an idle system. */ + var onStateChanged: IdleStateChangedEvent; +} + +//////////////////// +// Input - IME +//////////////////// +/** + * Use the chrome.input.ime API to implement a custom IME for Chrome OS. This allows your extension to handle keystrokes, set the composition, and manage the candidate window. + * Permissions: "input" + * @since Chrome 21. + */ +declare module chrome.input.ime { + /** See http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent */ + interface KeyboardEvent { + /** + * Optional. + * Whether or not the SHIFT key is pressed. + */ + shiftKey?: boolean; + /** + * Optional. + * Whether or not the ALT key is pressed. + */ + altKey?: boolean; + /** The ID of the request. */ + requestId: string; + /** Value of the key being pressed */ + key: string; + /** + * Optional. + * Whether or not the CTRL key is pressed. + */ + ctrlKey?: boolean; + /** One of keyup or keydown. */ + type: string; + /** + * Optional. + * The extension ID of the sender of this keyevent. + * @since Chrome 34. + */ + extensionId?: string; + /** + * Optional. + * Value of the physical key being pressed. The value is not affected by current keyboard layout or modifier state. + * @since Chrome 26. + */ + code: string; + /** + * Optional. + * The deprecated HTML keyCode, which is system- and implementation-dependent numerical code signifying the unmodified identifier associated with the key pressed. + * @since Chrome 37. + */ + keyCode?: number; + /** + * Optional. + * Whether or not the CAPS_LOCK is enabled. + * @since Chrome 29. + */ + capsLock?: boolean; + } + + /** Describes an input Context */ + interface InputContext { + /** This is used to specify targets of text field operations. This ID becomes invalid as soon as onBlur is called. */ + contextID: number; + /** Type of value this text field edits, (Text, Number, URL, etc) */ + type: string; + /** + * Whether the text field wants auto-correct. + * @since Chrome 40. + */ + autoCorrect: boolean; + /** + * Whether the text field wants auto-complete. + * @since Chrome 40. + */ + autoComplete: boolean; + /** + * Whether the text field wants spell-check. + * @since Chrome 40. + */ + spellCheck: boolean; + } + + /** + * A menu item used by an input method to interact with the user from the language menu. + * @since Chrome 30. + */ + interface MenuItem { + /** String that will be passed to callbacks referencing this MenuItem. */ + id: string; + /** Optional. Text displayed in the menu for this item. */ + label?: string; + /** Optional. The type of menu item. */ + style?: string; + /** Optional. Indicates this item is visible. */ + visible?: boolean; + /** Indicates this item should be drawn with a check. */ + checked?: boolean; + /** Indicates this item is enabled. */ + enabled?: boolean; + } + + interface ImeParameters { + /** MenuItems to use. */ + items: MenuItem[]; + /** ID of the engine to use */ + engineID: string; + } + + interface CommitTextParameters { + /** The text to commit */ + text: string; + /** ID of the context where the text will be committed */ + contextID: number; + } + + interface CandidateUsage { + /** The title string of details description. */ + title: string; + /** The body string of detail description. */ + body: string; + } + + interface CandidateTemplate { + /** The candidate */ + candidate: string; + /** The candidate's id */ + id: number; + /** + * Optional. + * The id to add these candidates under + */ + parentId?: number; + /** + * Optional. + * Short string displayed to next to the candidate, often the shortcut key or index + */ + label?: string; + /** + * Optional. + * Additional text describing the candidate + */ + annotation?: string; + /** + * Optional. + * The usage or detail description of word. + */ + usage?: CandidateUsage; + } + + interface CandidatesParameters { + /** ID of the context that owns the candidate window. */ + contextID: number; + /** List of candidates to show in the candidate window */ + candidates: CandidateTemplate[]; + } + + interface CompositionParameterSegment { + /** Index of the character to start this segment at */ + start: number; + /** Index of the character to end this segment after. */ + end: number; + /** The type of the underline to modify this segment. */ + style: string; + } + + interface CompositionParameters { + /** ID of the context where the composition text will be set */ + contextID: number; + /** Text to set */ + text: string; + /** Optional. List of segments and their associated types. */ + segments: CompositionParameterSegment[]; + /** Position in the text of the cursor. */ + cursor: number; + /** Optional. Position in the text that the selection starts at. */ + selectionStart?: number; + /** Optional. Position in the text that the selection ends at. */ + selectionEnd?: number; + } + + interface MenuItemParameters { + items: Object[]; + engineId: string; + } + + interface CandidateWindowParameterProperties { + /** + * Optional. + * True to show the cursor, false to hide it. + */ + cursorVisible?: boolean; + /** + * Optional. + * True if the candidate window should be rendered vertical, false to make it horizontal. + */ + vertical?: boolean; + /** + * Optional. + * The number of candidates to display per page. + */ + pageSize?: number; + /** + * Optional. + * True to display the auxiliary text, false to hide it. + */ + auxiliaryTextVisible?: boolean; + /** + * Optional. + * Text that is shown at the bottom of the candidate window. + */ + auxiliaryText?: string; + /** + * Optional. + * True to show the Candidate window, false to hide it. + */ + visible?: boolean; + /** + * Optional. + * Where to display the candidate window. + * @since Chrome 28. + */ + windowPosition?: string; + } + + interface CandidateWindowParameter { + /** ID of the engine to set properties on. */ + engineID: string; + properties: CandidateWindowParameterProperties; + } + + interface ClearCompositionParameters { + /** ID of the context where the composition will be cleared */ + contextID: number; + } + + interface CursorPositionParameters { + /** ID of the candidate to select. */ + candidateID: number; + /** ID of the context that owns the candidate window. */ + contextID: number; + } + + interface SendKeyEventParameters { + /** ID of the context where the key events will be sent, or zero to send key events to non-input field. */ + contextID: number; + /** Data on the key event. */ + keyData: KeyboardEvent[]; + } + + interface DeleteSurroundingTextParameters { + /** ID of the engine receiving the event. */ + engineID: string; + /** ID of the context where the surrounding text will be deleted. */ + contextID: number; + /** The offset from the caret position where deletion will start. This value can be negative. */ + offset: number; + /** The number of characters to be deleted */ + length: number; + } + + interface SurroundingTextInfo { + /** The text around cursor. */ + text: string; + /** The ending position of the selection. This value indicates caret position if there is no selection. */ + focus: number; + /** The beginning position of the selection. This value indicates caret position if is no selection. */ + anchor: number; + } + + interface BlurEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(integer contextID) {...}; + * Parameter contextID: The ID of the text field that has lost focus. The ID is invalid after this call + */ + addListener(callback: (contextID: number) => void): void; + } + + interface CandidateClickedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string engineID, integer candidateID, MouseButton button) {...}; + * Parameter engineID: ID of the engine receiving the event + * Parameter candidateID: ID of the candidate that was clicked. + * Parameter button: Which mouse buttons was clicked. + */ + addListener(callback: (engineID: string, candidateID: number, button: string) => void): void; + } + + interface KeyEventEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string engineID, KeyboardEvent keyData) {...}; + * Parameter engineID: ID of the engine receiving the event + * Parameter keyData: Data on the key event + */ + addListener(callback: (engineID: string, keyData: KeyboardEvent) => void): void; + } + + interface DeactivatedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string engineID) {...}; + * Parameter engineID: ID of the engine receiving the event + */ + addListener(callback: (engineID: string) => void): void; + } + + interface InputContextUpdateEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( InputContext context) {...}; + * Parameter context: An InputContext object describing the text field that has changed. + */ + addListener(callback: (context: InputContext) => void): void; + } + + interface ActivateEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string engineID, ScreenType screen) {...}; + * Parameter engineID: ID of the engine receiving the event + * Parameter The screen type under which the IME is activated. + */ + addListener(callback: (engineID: string, screen: string) => void): void; + } + + interface FocusEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( InputContext context) {...}; + * Parameter context: Describes the text field that has acquired focus. + */ + addListener(callback: (context: InputContext) => void): void; + } + + interface MenuItemActivatedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string engineID, string name) {...}; + * Parameter engineID: ID of the engine receiving the event + * Parameter name: Name of the MenuItem which was activated + */ + addListener(callback: (engineID: string, name: string) => void): void; + } + + interface SurroundingTextChangedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string engineID, object surroundingInfo) {...}; + * Parameter engineID: ID of the engine receiving the event + * Parameter surroundingInfo: The surrounding information. + */ + addListener(callback: (engineID: string, surroundingInfo: SurroundingTextInfo) => void): void; + } + + interface InputResetEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string engineID) {...}; + * Parameter engineID: ID of the engine receiving the event + */ + addListener(callback: (engineID: string) => void): void; + } + + /** + * Adds the provided menu items to the language menu when this IME is active. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setMenuItems(parameters: ImeParameters, callback?: () => void): void; + /** + * Commits the provided text to the current input. + * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean success) {...}; + */ + export function commitText(parameters: CommitTextParameters, callback?: (success: boolean) => void): void; + /** + * Sets the current candidate list. This fails if this extension doesn't own the active IME + * @param callback Called when the operation completes. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean success) {...}; + */ + export function setCandidates(parameters: CandidatesParameters, callback?: (success: boolean) => void): void; + /** + * Set the current composition. If this extension does not own the active IME, this fails. + * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean success) {...}; + */ + export function setComposition(parameters: CompositionParameters, callback?: (success: boolean) => void): void; + /** + * Updates the state of the MenuItems specified + * @param callback Called when the operation completes + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function updateMenuItems(parameters: MenuItemParameters, callback?: () => void): void; + /** + * Sets the properties of the candidate window. This fails if the extension doesn't own the active IME + * @param callback Called when the operation completes. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean success) {...}; + */ + export function setCandidateWindowProperties(parameters: CandidateWindowParameter, callback?: (success: boolean) => void): void; + /** + * Clear the current composition. If this extension does not own the active IME, this fails. + * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean success) {...}; + */ + export function clearComposition(parameters: ClearCompositionParameters, callback?: (success: boolean) => void): void; + /** + * Set the position of the cursor in the candidate window. This is a no-op if this extension does not own the active IME. + * @param callback Called when the operation completes + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean success) {...}; + */ + export function setCursorPosition(parameters: CursorPositionParameters, callback?: (success: boolean) => void): void; + /** + * Sends the key events. This function is expected to be used by virtual keyboards. When key(s) on a virtual keyboard is pressed by a user, this function is used to propagate that event to the system. + * @since Chrome 33. + * @param callback Called when the operation completes. + * If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function sendKeyEvents(parameters: SendKeyEventParameters, callback?: () => void): void; + /** + * Hides the input view window, which is popped up automatically by system. If the input view window is already hidden, this function will do nothing. + * @since Chrome 34. + */ + export function hideInputView(): void; + /** + * Deletes the text around the caret. + * @since Chrome 27. + */ + export function deleteSurroundingText(parameters: DeleteSurroundingTextParameters, callback?: () => void): void; + /** + * Indicates that the key event received by onKeyEvent is handled. This should only be called if the onKeyEvent listener is asynchronous. + * @since Chrome 25. + * @param requestId Request id of the event that was handled. This should come from keyEvent.requestId + * @param response True if the keystroke was handled, false if not + */ + export function keyEventHandled(requestId: string, response: boolean): void; + + /** This event is sent when focus leaves a text box. It is sent to all extensions that are listening to this event, and enabled by the user. */ + var onBlur: BlurEvent; + /** This event is sent if this extension owns the active IME. */ + var onCandidateClicked: CandidateClickedEvent; + /** This event is sent if this extension owns the active IME. */ + var onKeyEvent: KeyEventEvent; + /** This event is sent when an IME is deactivated. It signals that the IME will no longer be receiving onKeyPress events. */ + var onDeactivated: DeactivatedEvent; + /** This event is sent when the properties of the current InputContext change, such as the the type. It is sent to all extensions that are listening to this event, and enabled by the user. */ + var onInputContextUpdate: InputContextUpdateEvent; + /** This event is sent when an IME is activated. It signals that the IME will be receiving onKeyPress events. */ + var onActivate: ActivateEvent; + /** This event is sent when focus enters a text box. It is sent to all extensions that are listening to this event, and enabled by the user. */ + var onFocus: FocusEvent; + /** Called when the user selects a menu item */ + var onMenuItemActivated: MenuItemActivatedEvent; + /** + * Called when the editable string around caret is changed or when the caret position is moved. The text length is limited to 100 characters for each back and forth direction. + * @since Chrome 27. + */ + var onSurroundingTextChanged: SurroundingTextChangedEvent; + /** + * This event is sent when chrome terminates ongoing text input session. + * @since Chrome 29. + */ + var onReset: InputResetEvent; +} + +//////////////////// +// Management +//////////////////// +/** + * The chrome.management API provides ways to manage the list of extensions/apps that are installed and running. It is particularly useful for extensions that override the built-in New Tab page. + * Permissions: "management" + * @since Chrome 8. + */ +declare module chrome.management { + /** Information about an installed extension, app, or theme. */ + interface ExtensionInfo { + /** + * Optional. + * A reason the item is disabled. + * @since Chrome 17. + */ + disabledReason?: string; + /** Optional. The launch url (only present for apps). */ + appLaunchUrl?: string; + /** + * The description of this extension, app, or theme. + * @since Chrome 9. + */ + description: string; + /** + * Returns a list of API based permissions. + * @since Chrome 9. + */ + permissions: string[]; + /** + * Optional. + * A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the manifest documentation on icons for more details. + */ + icons?: IconInfo[]; + /** + * Returns a list of host based permissions. + * @since Chrome 9. + */ + hostPermissions: string[]; + /** Whether it is currently enabled or disabled. */ + enabled: boolean; + /** + * Optional. + * The URL of the homepage of this extension, app, or theme. + * @since Chrome 11. + */ + homepageUrl?: string; + /** + * Whether this extension can be disabled or uninstalled by the user. + * @since Chrome 12. + */ + mayDisable: boolean; + /** + * How the extension was installed. + * @since Chrome 22. + */ + installType: string; + /** The version of this extension, app, or theme. */ + version: string; + /** The extension's unique identifier. */ + id: string; + /** + * Whether the extension, app, or theme declares that it supports offline. + * @since Chrome 15. + */ + offlineEnabled: boolean; + /** + * Optional. + * The update URL of this extension, app, or theme. + * @since Chrome 16. + */ + updateUrl?: string; + /** + * The type of this extension, app, or theme. + * @since Chrome 23. + */ + type: string; + /** The url for the item's options page, if it has one. */ + optionsUrl: string; + /** The name of this extension, app, or theme. */ + name: string; + /** + * A short version of the name of this extension, app, or theme. + * @since Chrome 31. + */ + shortName: string; + /** + * True if this is an app. + * @deprecated since Chrome 33. Please use management.ExtensionInfo.type. + */ + isApp: boolean; + /** + * Optional. + * The app launch type (only present for apps). + * @since Chrome 37. + */ + launchType?: string; + /** + * Optional. + * The currently available launch types (only present for apps). + * @since Chrome 37. + */ + availableLaunchTypes?: string[]; + } + + /** Information about an icon belonging to an extension, app, or theme. */ + interface IconInfo { + /** The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append ?grayscale=true to the URL. */ + url: string; + /** A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16. */ + size: number; + } + + interface UninstallOptions { + /** + * Optional. + * Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false for self uninstalls. If an extension uninstalls another extension, this parameter is ignored and the dialog is always shown. + */ + showConfirmDialog?: boolean; + } + + interface ManagementDisabledEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( ExtensionInfo info) {...}; + */ + addListener(callback: (info: ExtensionInfo) => void): void; + } + + interface ManagementUninstalledEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string id) {...}; + * Parameter id: The id of the extension, app, or theme that was uninstalled. + */ + addListener(callback: (id: string) => void): void; + } + + interface ManagementInstalledEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( ExtensionInfo info) {...}; + */ + addListener(callback: (info: ExtensionInfo) => void): void; + } + + interface ManagementEnabledEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( ExtensionInfo info) {...}; + */ + addListener(callback: (info: ExtensionInfo) => void): void; + } + + /** + * Enables or disables an app or extension. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param enabled Whether this item should be enabled or disabled. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setEnabled(id: string, enabled: boolean, callback?: () => void): void; + /** + * Returns a list of permission warnings for the given extension id. + * @since Chrome 15. + * @param id The ID of an already installed extension. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(array of string permissionWarnings) {...}; + */ + export function getPermissionWarningsById(id: string, callback?: (permissionWarnings: string[]) => void): void; + /** + * Returns information about the installed extension, app, or theme that has the given ID. + * @since Chrome 9. + * @param id The ID from an item of management.ExtensionInfo. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; + */ + export function get(id: string, callback?: (result: ExtensionInfo) => void): void; + /** + * Returns a list of information about installed extensions and apps. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(array of ExtensionInfo result) {...}; + */ + export function getAll(callback?: (result: ExtensionInfo[]) => void): void; + /** + * Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 15. + * @param manifestStr Extension manifest JSON string. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(array of string permissionWarnings) {...}; + */ + export function getPermissionWarningsByManifest(manifestStr: string, callback?: (permissionwarnings: string[]) => void): void; + /** + * Launches an application. + * @param id The extension id of the application. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function launchApp(id: string, callback?: () => void): void; + /** + * Uninstalls a currently installed app or extension. + * @since Chrome 21. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function uninstall(id: string, options?: UninstallOptions, callback?: () => void): void; + /** + * Uninstalls a currently installed app or extension. + * @deprecated since Chrome 21. The options parameter was added to this function. + * @param id This should be the id from an item of management.ExtensionInfo. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function uninstall(id: string, callback?: () => void): void; + /** + * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 39. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; + */ + export function getSelf(callback?: (result: ExtensionInfo) => void): void; + /** + * Uninstalls the calling extension. + * Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 26. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function uninstallSelf(options?: UninstallOptions, callback?: () => void): void; + /** + * Uninstalls the calling extension. + * Note: This function can be used without requesting the 'management' permission in the manifest. + * @since Chrome 26. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function uninstallSelf(callback?: () => void): void; + /** + * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created. + * @since Chrome 37. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function createAppShortcut(id: string, callback?: () => void): void; + /** + * Set the launch type of an app. + * @since Chrome 37. + * @param id This should be the id from an app item of management.ExtensionInfo. + * @param launchType The target launch type. Always check and make sure this launch type is in ExtensionInfo.availableLaunchTypes, because the available launch types vary on different platforms and configurations. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setLaunchType(id: string, launchType: string, callback?: () => void): void; + /** + * Generate an app for a URL. Returns the generated bookmark app. + * @since Chrome 37. + * @param url The URL of a web page. The scheme of the URL can only be "http" or "https". + * @param title The title of the generated app. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function( ExtensionInfo result) {...}; + */ + export function generateAppForLink(url: string, title: string, callback?: (result: ExtensionInfo) => void): void; + + /** Fired when an app or extension has been disabled. */ + var onDisabled: ManagementDisabledEvent; + /** Fired when an app or extension has been uninstalled. */ + var onUninstalled: ManagementUninstalledEvent; + /** Fired when an app or extension has been installed. */ + var onInstalled: ManagementInstalledEvent; + /** Fired when an app or extension has been enabled. */ + 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 +//////////////////// +/** + * Use the chrome.notifications API to create rich notifications using templates and show these notifications to users in the system tray. + * Permissions: "notifications" + * @since Chrome 28. + */ +declare module chrome.notifications { + interface ButtonOptions { + title: string; + iconUrl?: string; + } + + interface ItemOptions { + /** Title of one item of a list notification. */ + title: string; + /** Additional details about this item. */ + message: string; + } + + interface NotificationOptions { + /** Optional. Which type of notification to display. Required for notifications.create method. */ + type?: string; + /** + * Optional. + * A URL to the sender's avatar, app icon, or a thumbnail for image notifications. + * URLs can be a data URL, a blob URL, or a URL relative to a resource within this extension's .crx file Required for notifications.create method. + */ + iconUrl?: string; + /** Optional. Title of the notification (e.g. sender name for email). Required for notifications.create method. */ + title?: string; + /** Optional. Main notification content. Required for notifications.create method. */ + message?: string; + /** + * Optional. + * Alternate notification content with a lower-weight font. + * @since Chrome 31. + */ + contextMessage?: string; + /** Optional. Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default. */ + priority?: number; + /** Optional. A timestamp associated with the notification, in milliseconds past the epoch (e.g. Date.now() + n). */ + eventTime?: number; + /** Optional. Text and icons for up to two notification action buttons. */ + buttons?: ButtonOptions[]; + /** Optional. Items for multi-item notifications. */ + items?: ItemOptions[]; + /** + * Optional. + * Current progress ranges from 0 to 100. + * @since Chrome 30. + */ + progress?: number; + /** + * Optional. + * Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification. + * @since Chrome 32. + */ + isClickable?: boolean; + /** + * Optional. + * A URL to the app icon mask. URLs have the same restrictions as iconUrl. The app icon mask should be in alpha channel, as only the alpha channel of the image will be considered. + * @since Chrome 38. + */ + appIconMaskUrl?: string; + /** Optional. A URL to the image thumbnail for image-type notifications. URLs have the same restrictions as iconUrl. */ + imageUrl?: string; + } + + interface NotificationClosedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string notificationId, boolean byUser) {...}; + */ + addListener(callback: (notificationId: string, byUser: boolean) => void): void; + } + + interface NotificationClickedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string notificationId) {...}; + */ + addListener(callback: (notificationId: string) => void): void; + } + + interface NotificationButtonClickedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string notificationId, integer buttonIndex) {...}; + */ + addListener(callback: (notificationId: string, buttonIndex: number) => void): void; + } + + interface NotificationPermissionLevelChangedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( PermissionLevel level) {...}; + */ + addListener(callback: (level: string) => void): void; + } + + interface NotificationShowSettingsEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: () => void): void; + } + + /** The notification closed, either by the system or by user action. */ + export var onClosed: NotificationClosedEvent; + /** The user clicked in a non-button area of the notification. */ + export var onClicked: NotificationClickedEvent; + /** The user pressed a button in the notification. */ + export var onButtonClicked: NotificationButtonClickedEvent; + /** + * The user changes the permission level. + * @since Chrome 32. + */ + export var onPermissionLevelChanged: NotificationPermissionLevelChangedEvent; + /** + * The user clicked on a link for the app's notification settings. + * @since Chrome 32. + */ + export var onShowSettings: NotificationShowSettingsEvent; + + /** + * Creates and displays a notification. + * @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. + * The notificationId parameter is required before Chrome 42. + * @param options Contents of the notification. + * @param callback Returns the notification id (either supplied or generated) that represents the created notification. + * The callback is required before Chrome 42. + * If you specify the callback parameter, it should be a function that looks like this: + * function(string notificationId) {...}; + */ + export function create(notificationId: string, options: NotificationOptions, callback?: (notificationId: string) => void): void; + /** + * Creates and displays a notification. + * @param notificationId Identifier of the notification. If not set or empty, an ID will automatically be generated. If it matches an existing notification, this method first clears that notification before proceeding with the create operation. + * The notificationId parameter is required before Chrome 42. + * @param options Contents of the notification. + * @param callback Returns the notification id (either supplied or generated) that represents the created notification. + * The callback is required before Chrome 42. + * If you specify the callback parameter, it should be a function that looks like this: + * function(string notificationId) {...}; + */ + export function create(options: NotificationOptions, callback?: (notificationId: string) => void): void; + /** + * Updates an existing notification. + * @param notificationId The id of the notification to be updated. This is returned by notifications.create method. + * @param options Contents of the notification to update to. + * @param callback Called to indicate whether a matching notification existed. + * The callback is required before Chrome 42. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean wasUpdated) {...}; + */ + export function update(notificationId: string, options: NotificationOptions, callback?: (wasUpdated: boolean) => void): void; + /** + * Clears the specified notification. + * @param notificationId The id of the notification to be cleared. This is returned by notifications.create method. + * @param callback Called to indicate whether a matching notification existed. + * The callback is required before Chrome 42. + * If you specify the callback parameter, it should be a function that looks like this: + * function(boolean wasCleared) {...}; + */ + export function clear(notificationId: string, callback?: (wasCleared: boolean) => void): void; + /** + * Retrieves all the notifications. + * @since Chrome 29. + * @param callback Returns the set of notification_ids currently in the system. + * The callback parameter should be a function that looks like this: + * function(object notifications) {...}; + */ + export function getAll(callback: (notifications: Object) => void): void; + /** + * Retrieves whether the user has enabled notifications from this app or extension. + * @since Chrome 32. + * @param callback Returns the current permission level. + * The callback parameter should be a function that looks like this: + * function( PermissionLevel level) {...}; + */ + export function getPermissionLevel(callback: (level: string) => void): void; +} + +//////////////////// +// Omnibox +//////////////////// +/** + * The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox. + * Manifest: "omnibox": {...} + * @since Chrome 9. + */ +declare module chrome.omnibox { + /** A suggest result. */ + interface SuggestResult { + /** The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry. */ + content: string; + /** The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. You must escape the five predefined entities to display them as text: stackoverflow.com/a/1091953/89484 */ + description: string; + } + + interface Suggestion { + /** The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. dimmed match. */ + description: string; + } + + interface OmniboxInputEnteredEvent extends chrome.events.Event { + /** + * The callback parameter should be a function that looks like this: + * function(string text, OnInputEnteredDisposition disposition) {...}; + */ + addListener(callback: (text: string) => void): void; + } + + interface OmniboxInputChangedEvent extends chrome.events.Event { + /** + * The callback parameter should be a function that looks like this: + * function(string text, function suggest) {...}; + * Parameter suggest: A callback passed to the onInputChanged event used for sending suggestions back to the browser. + * The suggest parameter should be a function that looks like this: + * function(array of SuggestResult suggestResults) {...}; + */ + addListener(callback: (text: string, suggest: (suggestResults: SuggestResult[]) => void) => void): void; + } + + interface OmniboxInputStartedEvent extends chrome.events.Event { + /** + * The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: () => void): void; + } + + interface OmniboxInputCancelledEvent extends chrome.events.Event { + /** + * The callback parameter should be a function that looks like this: + * function() {...}; + */ + addListener(callback: () => void): void; + } + + /** + * Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar. + * @param suggestion A partial SuggestResult object, without the 'content' parameter. + */ + export function setDefaultSuggestion(suggestion: Suggestion): void; + + /** User has accepted what is typed into the omnibox. */ + var onInputEntered: OmniboxInputEnteredEvent; + /** User has changed what is typed into the omnibox. */ + var onInputChanged: OmniboxInputChangedEvent; + /** User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once per input session, and before any onInputChanged events. */ + var onInputStarted: OmniboxInputStartedEvent; + /** User has ended the keyword input session without accepting the input. */ + var onInputCancelled: OmniboxInputCancelledEvent; +} + +//////////////////// +// Page Action +//////////////////// +/** + * Use the chrome.pageAction API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages. + * Manifest: "page_action": {...} + * @since Chrome 5. + */ +declare module chrome.pageAction { + interface PageActionClickedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( tabs.Tab tab) {...}; + */ + addListener(callback: (tab: chrome.tabs.Tab) => void): void; + } + + interface TitleDetails { + /** The id of the tab for which you want to modify the page action. */ + tabId: number; + /** The tooltip string. */ + title: string; + } + + interface GetDetails { + /** Specify the tab to get the title from. */ + tabId: number; + } + + interface PopupDetails { + /** The id of the tab for which you want to modify the page action. */ + tabId: number; + /** The html file to show in a popup. If set to the empty string (''), no popup is shown. */ + popup: string; + } + + interface IconDetails { + /** The id of the tab for which you want to modify the page action. */ + tabId: number; + /** + * Optional. + * @deprecated This argument is ignored. + */ + iconIndex?: number; + /** + * Optional. + * Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' + */ + imageData?: ImageData; + /** + * Optional. + * Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' + */ + path?: any; + } + + /** + * Shows the page action. The page action is shown whenever the tab is selected. + * @param tabId The id of the tab for which you want to modify the page action. + */ + export function hide(tabId: number): void; + /** + * Shows the page action. The page action is shown whenever the tab is selected. + * @param tabId The id of the tab for which you want to modify the page action. + */ + export function show(tabId: number): void; + /** Sets the title of the page action. This is displayed in a tooltip over the page action. */ + export function setTitle(details: TitleDetails): void; + /** Sets the html document to be opened as a popup when the user clicks on the page action's icon. */ + export function setPopup(details: PopupDetails): void; + /** + * Gets the title of the page action. + * @since Chrome 19. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; + */ + export function getTitle(details: GetDetails, callback: (result: string) => void): void; + /** + * Gets the html document set as the popup for this page action. + * @since Chrome 19. + * @param callback The callback parameter should be a function that looks like this: + * function(string result) {...}; + */ + export function getPopup(details: GetDetails, callback: (result: string) => void): void; + /** + * Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function() {...}; + */ + export function setIcon(details: IconDetails, callback?: () => void): void; + + /** Fired when a page action icon is clicked. This event will not fire if the page action has a popup. */ + var onClicked: PageActionClickedEvent; +} + +//////////////////// +// Page Capture +//////////////////// +/** + * Use the chrome.pageCapture API to save a tab as MHTML. + * Permissions: "pageCapture" + * @since Chrome 18. + */ +declare module chrome.pageCapture { + interface SaveDetails { + /** The id of the tab to save as MHTML. */ + tabId: number; + } + + /** + * Saves the content of the tab with given id as MHTML. + * @param callback Called when the MHTML has been generated. + * The callback parameter should be a function that looks like this: + * function(binary mhtmlData) {...}; + * Parameter mhtmlData: The MHTML data as a Blob. + */ + export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData: any) => void): void; +} + +//////////////////// +// Permissions +//////////////////// +/** + * Use the chrome.permissions API to request declared optional permissions at run time rather than install time, so users understand why the permissions are needed and grant only those that are necessary. + * @since Chrome 16. + */ +declare module chrome.permissions { + interface Permissions { + /** + * Optional. + * List of named permissions (does not include hosts or origins). Anything listed here must appear in the optional_permissions list in the manifest. + */ + origins?: string[]; + /** + * Optional. + * List of origin permissions. Anything listed here must be a subset of a host that appears in the optional_permissions list in the manifest. For example, if http://*.example.com/ or http://* appears in optional_permissions, you can request an origin of http://help.example.com/. Any path is ignored. + */ + permissions?: string[]; + } + + interface PermissionsRemovedEvent { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( Permissions permissions) {...}; + * Parameter permissions: The permissions that have been removed. + */ + addListener(callback: (permissions: Permissions) => void): void; + } + + interface PermissionsAddedEvent { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( Permissions permissions) {...}; + * Parameter permissions: The newly acquired permissions. + */ + addListener(callback: (permissions: Permissions) => void): void; + } + + /** + * Checks if the extension has the specified permissions. + * @param callback The callback parameter should be a function that looks like this: + * function(boolean result) {...}; + * Parameter result: True if the extension has the specified permissions. + */ + export function contains(permissions: Permissions, callback: (result: boolean) => void): void; + /** + * Gets the extension's current set of permissions. + * @param callback The callback parameter should be a function that looks like this: + * function( Permissions permissions) {...}; + * Parameter permissions: The extension's active permissions. + */ + export function getAll(callback: (permissions: Permissions) => void): void; + /** + * Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, runtime.lastError will be set. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(boolean granted) {...}; + * Parameter granted: True if the user granted the specified permissions. + */ + export function request(permissions: Permissions, callback?: (granted: boolean) => void): void; + /** + * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set. + * @param callback If you specify the callback parameter, it should be a function that looks like this: + * function(boolean removed) {...}; + * Parameter removed: True if the permissions were removed. + */ + export function remove(permissions: Permissions, callback?: (removed: boolean) => void): void; + + /** Fired when access to permissions has been removed from the extension. */ + var onRemoved: PermissionsRemovedEvent; + /** Fired when the extension acquires new permissions. */ + var onAdded: PermissionsAddedEvent; +} + +//////////////////// +// Platform Keys +//////////////////// +/** + * Use the chrome.platformKeys API to access client certificates managed by the platform. If the user or policy grants the permission, an extension can use such a certficate in its custom authentication protocol. E.g. this allows usage of platform managed certificates in third party VPNs (see chrome.vpnProvider). + * Permissions: "platformKeys" + * Important: This API works only on Chrome OS. + * @since Chrome 45. + */ +declare module chrome.platformKeys { + interface Match { + /** The DER encoding of a X.509 certificate. */ + certificate: ArrayBuffer; + /** The KeyAlgorithm of the certified key. This contains algorithm parameters that are inherent to the key of the certificate (e.g. the key length). Other parameters like the hash function used by the sign function are not included. */ + keyAlgorithm: KeyAlgorithm; + } + + interface ClientCertificateSelectRequestDetails { + /** This field is a list of the types of certificates requested, sorted in order of the server's preference. Only certificates of a type contained in this list will be retrieved. If certificateTypes is the empty list, however, certificates of any type will be returned. */ + certificateTypes: string[]; + /** List of distinguished names of certificate authorities allowed by the server. Each entry must be a DER-encoded X.509 DistinguishedName. */ + certificateAuthorities: ArrayBuffer[]; + } + + interface ClientCertificateSelectDetails { + /** Only certificates that match this request will be returned. */ + request: ClientCertificateSelectRequestDetails; + /** + * Optional. + * If given, the selectClientCertificates operates on this list. Otherwise, obtains the list of all certificates from the platform's certificate stores that are available to this extensions. Entries that the extension doesn't have permission for or which doesn't match the request, are removed. + */ + clientCerts?: ArrayBuffer[]; + /** If true, the filtered list is presented to the user to manually select a certificate and thereby granting the extension access to the certificate(s) and key(s). Only the selected certificate(s) will be returned. If is false, the list is reduced to all certificates that the extension has been granted access to (automatically or manually). */ + interactive: boolean; + } + + interface ServerCertificateVerificationDetails { + /** Each chain entry must be the DER encoding of a X.509 certificate, the first entry must be the server certificate and each entry must certify the entry preceding it. */ + serverCertificateChain: ArrayBuffer[]; + /** The hostname of the server to verify the certificate for, e.g. the server that presented the serverCertificateChain. */ + hostname: string; + } + + interface ServerCertificateVerificationResult { + /** The result of the trust verification: true if trust for the given verification details could be established and false if trust is rejected for any reason. */ + trusted: boolean; + /** + * If the trust verification failed, this array contains the errors reported by the underlying network layer. Otherwise, this array is empty. + * Note: This list is meant for debugging only and may not contain all relevant errors. The errors returned may change in future revisions of this API, and are not guaranteed to be forwards or backwards compatible. + */ + debug_errors: string[]; + } + + /** + * This function filters from a list of client certificates the ones that are known to the platform, match request and for which the extension has permission to access the certificate and its private key. If interactive is true, the user is presented a dialog where he can select from matching certificates and grant the extension access to the certificate. The selected/filtered client certificates will be passed to callback. + * @param callback The callback parameter should be a function that looks like this: + * function(array of Match matches) {...}; + * Parameter matches: The list of certificates that match the request, that the extension has permission for and, if interactive is true, that were selected by the user. + */ + export function selectClientCertificates(details: ClientCertificateSelectDetails, callback: (matches: Match[]) => void): void; + /** + * Passes the key pair of certificate for usage with platformKeys.subtleCrypto to callback. + * @param certificate The certificate of a Match returned by selectClientCertificates. + * @param parameters Determines signature/hash algorithm parameters additionally to the parameters fixed by the key itself. The same parameters are accepted as by WebCrypto's importKey function, e.g. RsaHashedImportParams for a RSASSA-PKCS1-v1_5 key. For RSASSA-PKCS1-v1_5 keys, additionally the parameters { 'hash': { 'name': 'none' } } are supported. The sign function will then apply PKCS#1 v1.5 padding and but not hash the given data. + * @param callback The public and private CryptoKey of a certificate which can only be used with platformKeys.subtleCrypto. + * The callback parameter should be a function that looks like this: + * function(object publicKey, object privateKey) {...}; + * Optional parameter privateKey: Might be null if this extension does not have access to it. + */ + export function getKeyPair(certificate: ArrayBuffer, parameters: Object, callback: (publicKey: CryptoKey, privateKey?: CryptoKey) => void): void; + /** An implementation of WebCrypto's SubtleCrypto that allows crypto operations on keys of client certificates that are available to this extension. */ + export function subtleCrypto(): SubtleCrypto; + /** + * Checks whether details.serverCertificateChain can be trusted for details.hostname according to the trust settings of the platform. Note: The actual behavior of the trust verification is not fully specified and might change in the future. The API implementation verifies certificate expiration, validates the certification path and checks trust by a known CA. The implementation is supposed to respect the EKU serverAuth and to support subject alternative names. + * @param callback The callback parameter should be a function that looks like this: + * function(object result) {...}; + */ + export function verifyTLSServerCertificate(details: ServerCertificateVerificationDetails, callback: (result: ServerCertificateVerificationResult) => void): void; +} + +//////////////////// +// Power +//////////////////// +/** + * Use the chrome.power API to override the system's power management features. + * Permissions: "power" + * @since Chrome 27. + */ +declare module chrome.power { + /** Requests that power management be temporarily disabled. |level| describes the degree to which power management should be disabled. If a request previously made by the same app is still active, it will be replaced by the new request. */ + export function requestKeepAwake(level: string): void; + /** Releases a request previously made via requestKeepAwake(). */ + export function releaseKeepAwake(): void; +} + +//////////////////// +// Printer Provider +//////////////////// +/** + * The chrome.printerProvider API exposes events used by print manager to query printers controlled by extensions, to query their capabilities and to submit print jobs to these printers. + * Permissions: "printerProvider" + * @since Chrome 44. + */ +declare module chrome.printerProvider { + interface PrinterInfo { + /** Unique printer ID. */ + id: string; + /** Printer's human readable name. */ + name: string; + /** Optional. Printer's human readable description. */ + description?: string; + } + + interface PrinterCapabilities { + /** Device capabilities in CDD format. */ + capabilities: any; + } + + interface PrintJob { + /** ID of the printer which should handle the job. */ + printerId: string; + /** The print job title. */ + title: string; + /** Print ticket in CJT format. */ + ticket: Object; + /** The document content type. Supported formats are "application/pdf" and "image/pwg-raster". */ + contentType: string; + /** Blob containing the document data to print. Format must match |contentType|. */ + document: Blob; + } + + interface PrinterRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(function resultCallback) {...}; + * Parameter resultCallback: Callback to return printer list. Every listener must call callback exactly once. + */ + addListener(callback: (resultCallback: (printerInfo: PrinterInfo[]) => void) => void): void; + } + + interface PrinterInfoRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function( usb.Device device, function resultCallback) {...}; + * Parameter device: The USB device. + * Parameter resultCallback: Callback to return printer info. The receiving listener must call callback exactly once. If the parameter to this callback is undefined that indicates that the application has determined that the device is not supported. + */ + addListener(callback: (device: any, resultCallback: (printerInfo?: PrinterInfo) => void) => void): void; + } + + interface CapabilityRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(string printerId, function resultCallback) {...}; + * Parameter printerId: Unique ID of the printer whose capabilities are requested. + * Parameter resultCallback: Callback to return device capabilities in CDD format. The receiving listener must call callback exectly once. + */ + addListener(callback: (printerId: string, resultCallback: (capabilities: PrinterCapabilities) => void) => void): void; + } + + interface PrintRequestedEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object printJob, function resultCallback) {...}; + * Parameter printJob: The printing request parameters. + * Parameter resultCallback: Callback that should be called when the printing request is completed. + * Parameter result (for resultCallback): OK: Operation completed successfully. FAILED: General failure. INVALID_TICKET: Print ticket is invalid. For example, ticket is inconsistent with capabilities or extension is not able to handle all settings from the ticket. INVALID_DATA: Document is invalid. For example, data may be corrupted or the format is incompatible with the extension. + */ + addListener(callback: (printJob: PrintJob, resultCallback: (result: string) => void) => void): void; + } + + /** Event fired when print manager requests printers provided by extensions. */ + export var onGetPrintersRequested: PrinterRequestedEvent; + /** + * Event fired when print manager requests information about a USB device that may be a printer. + * Note: An application should not rely on this event being fired more than once per device. If a connected device is supported it should be returned in the onGetPrintersRequested event. + * @since Chrome 45. + */ + export var onGetUsbPrinterInfoRequested: PrinterInfoRequestedEvent; + /** Event fired when print manager requests printer capabilities. */ + export var onGetCapabilityRequested: CapabilityRequestedEvent; + /** Event fired when print manager requests printing. */ + export var onPrintRequested: PrintRequestedEvent; +} + +//////////////////// +// Privacy +//////////////////// +/** + * Use the chrome.privacy API to control usage of the features in Chrome that can affect a user's privacy. This API relies on the ChromeSetting prototype of the type API for getting and setting Chrome's configuration. + * Permissions: "privacy" + * The Chrome Privacy Whitepaper gives background detail regarding the features which this API can control. + * @since Chrome 18. + */ +declare module chrome.privacy { + interface Services { + /** since Chrome 20. */ + spellingServiceEnabled: chrome.types.ChromeSetting; + searchSuggestEnabled: chrome.types.ChromeSetting; + instantEnabled: chrome.types.ChromeSetting; + alternateErrorPagesEnabled: chrome.types.ChromeSetting; + safeBrowsingEnabled: chrome.types.ChromeSetting; + autofillEnabled: chrome.types.ChromeSetting; + translationServiceEnabled: chrome.types.ChromeSetting; + /** @since Chrome 38. */ + passwordSavingEnabled: chrome.types.ChromeSetting; + /** @since Chrome 42. */ + hotwordSearchEnabled: chrome.types.ChromeSetting; + /** @since Chrome 42. */ + safeBrowsingExtendedReportingEnabled: chrome.types.ChromeSetting; + } + + interface Network { + networkPredictionEnabled: chrome.types.ChromeSetting; + /** @since Chrome 42. */ + webRTCMultipleRoutesEnabled: chrome.types.ChromeSetting; + /** @since Chrome 47. Warning: this is the current Dev channel. */ + webRTCNonProxiedUdpEnabled: chrome.types.ChromeSetting; + } + + interface Websites { + thirdPartyCookiesAllowed: chrome.types.ChromeSetting; + referrersEnabled: chrome.types.ChromeSetting; + hyperlinkAuditingEnabled: chrome.types.ChromeSetting; + /** @since Chrome 21. */ + protectedContentEnabled: chrome.types.ChromeSetting; + } + + /** Settings that enable or disable features that require third-party network services provided by Google and your default search provider. */ + var services: Services; + /** Settings that influence Chrome's handling of network connections in general. */ + var network: Network; + /** Settings that determine what information Chrome makes available to websites. */ + var websites: Websites; +} + +//////////////////// +// Proxy +//////////////////// +/** + * Use the chrome.proxy API to manage Chrome's proxy settings. This API relies on the ChromeSetting prototype of the type API for getting and setting the proxy configuration. + * Permissions: "proxy" + * @since Chrome 13. + */ +declare module chrome.proxy { + /** An object holding proxy auto-config information. Exactly one of the fields should be non-empty. */ + interface PacScript { + /** Optional. URL of the PAC file to be used. */ + url?: string; + /** Optional. If true, an invalid PAC script will prevent the network stack from falling back to direct connections. Defaults to false. */ + mandatory?: boolean; + /** Optional. A PAC script. */ + data?: string; + } + + /** An object encapsulating a complete proxy configuration. */ + interface ProxyConfig { + /** Optional. The proxy rules describing this configuration. Use this for 'fixed_servers' mode. */ + rules?: ProxyRules; + /** Optional. The proxy auto-config (PAC) script for this configuration. Use this for 'pac_script' mode. */ + pacScript?: PacScript; + /** + * 'direct' = Never use a proxy + * 'auto_detect' = Auto detect proxy settings + * 'pac_script' = Use specified PAC script + * 'fixed_servers' = Manually specify proxy servers + * 'system' = Use system proxy settings + */ + mode: string; + } + + /** An object encapsulating a single proxy server's specification. */ + interface ProxyServer { + /** The URI of the proxy server. This must be an ASCII hostname (in Punycode format). IDNA is not supported, yet. */ + host: string; + /** Optional. The scheme (protocol) of the proxy server itself. Defaults to 'http'. */ + scheme?: string; + /** Optional. The port of the proxy server. Defaults to a port that depends on the scheme. */ + port?: number; + } + + /** An object encapsulating the set of proxy rules for all protocols. Use either 'singleProxy' or (a subset of) 'proxyForHttp', 'proxyForHttps', 'proxyForFtp' and 'fallbackProxy'. */ + interface ProxyRules { + /** Optional. The proxy server to be used for FTP requests. */ + proxyForFtp?: ProxyServer; + /** Optional. The proxy server to be used for HTTP requests. */ + proxyForHttp?: ProxyServer; + /** Optional. The proxy server to be used for everthing else or if any of the specific proxyFor... is not specified. */ + fallbackProxy?: ProxyServer; + /** Optional. The proxy server to be used for all per-URL requests (that is http, https, and ftp). */ + singleProxy?: ProxyServer; + /** Optional. The proxy server to be used for HTTPS requests. */ + proxyForHttps?: ProxyServer; + /** Optional. List of servers to connect to without a proxy server. */ + bypassList?: string[]; + } + + interface ErrorDetails { + /** Additional details about the error such as a JavaScript runtime error. */ + details: string; + /** The error description. */ + error: string; + /** If true, the error was fatal and the network transaction was aborted. Otherwise, a direct connection is used instead. */ + fatal: boolean; + } + + interface ProxyErrorEvent extends chrome.events.Event { + /** + * @param callback The callback parameter should be a function that looks like this: + * function(object details) {...}; + */ + addListener(callback: (details: ErrorDetails) => void): void; + } + + var settings: chrome.types.ChromeSetting; + /** Notifies about proxy errors. */ + var onProxyError: ProxyErrorEvent; +} + +//////////////////// +// Runtime +//////////////////// +/** + * Use the chrome.runtime API to retrieve the background page, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs. + * @since Chrome 22 + */ +declare module chrome.runtime { + /** This will be defined during an API method callback if there was an error */ + var lastError: LastError; + /** The ID of the extension/app. */ + var id: string; + + interface LastError { + /** Optional. Details about the error which occurred. */ + message?: string; + } + + interface ConnectInfo { + name?: string; + } + + interface InstalledDetails { + /** + * The reason that this event is being dispatched. + * One of: "install", "update", "chrome_update", or "shared_module_update" + */ + reason: string; + /** + * Optional. + * Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'. + */ + previousVersion?: string; + /** + * Optional. + * Indicates the ID of the imported shared module extension which updated. This is present only if 'reason' is 'shared_module_update'. + * @since Chrome 29. + */ + id?: string; + } + + interface MessageOptions { + /** Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event. */ + includeTlsChannelId?: boolean; + } + + /** + * An object containing information about the script context that sent a message or request. + * @since Chrome 26. + */ + interface MessageSender { + /** The ID of the extension or app that opened the connection, if any. */ + id?: string; + /** The tabs.Tab which opened the connection, if any. This property will only be present when the connection was opened from a tab (including content scripts), and only if the receiver is an extension, not an app. */ + tab?: chrome.tabs.Tab; + /** + * The frame that opened the connection. 0 for top-level frames, positive for child frames. This will only be set when tab is set. + * @since Chrome 41. + */ + frameId?: number; + /** + * The URL of the page or frame that opened the connection. If the sender is in an iframe, it will be iframe's URL not the URL of the page which hosts it. + * @since Chrome 28. + */ + url?: string; + /** + * The TLS channel ID of the page or frame that opened the connection, if requested by the extension or app, and if available. + * @since Chrome 32. + */ + tlsChannelId?: string; + } + + /** + * An object containing information about the current platform. + * @since Chrome 36. + */ + interface PlatformInfo { + /** + * The operating system chrome is running on. + * One of: "mac", "win", "android", "cros", "linux", or "openbsd" + */ + os: string; + /** + * The machine's processor architecture. + * One of: "arm", "x86-32", or "x86-64" + */ + arch: string; + /** + * The native client architecture. This may be different from arch on some platforms. + * One of: "arm", "x86-32", or "x86-64" + */ + nacl_arch: string; + } + + /** + * An object which allows two way communication with other pages. + * @since Chrome 26. + */ + interface Port { + postMessage: (message: Object) => void; + disconnect: () => void; + /** + * Optional. + * This property will only be present on ports passed to onConnect/onConnectExternal listeners. + */ + sender?: MessageSender; + /** An object which allows the addition and removal of listeners for a Chrome event. */ + onDisconnect: chrome.events.Event; + /** An object which allows the addition and removal of listeners for a Chrome event. */ + onMessage: PortMessageEvent; + name: string; + } + + interface UpdateAvailableDetails { + /** The version number of the available update. */ + version: string; + } + + interface UpdateCheckDetails { + /** The version of the available update. */ + version: string; + } + + interface PortMessageEvent extends chrome.events.Event { + addListener(callback: (message: Object, port: Port) => void): void; + } + + interface ExtensionMessageEvent extends chrome.events.Event { + /** + * @param callback + * Optional parameter message: The message sent by the calling script. + * Parameter sendResponse: Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object. If you have more than one onMessage listener in the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until sendResponse is called). + */ + addListener(callback: (message: any, sender: MessageSender, sendResponse: Function) => void): void; + } + + interface ExtensionConnectEvent extends chrome.events.Event { + addListener(callback: (port: Port) => void): void; + } + + interface RuntimeInstalledEvent extends chrome.events.Event { + addListener(callback: (details: InstalledDetails) => void): void; + } + + interface RuntimeEvent extends chrome.events.Event { + addListener(callback: () => void): void; + } + + interface RuntimeRestartRequiredEvent extends chrome.events.Event { + /** + * @param callback + * Parameter reason: The reason that the event is being dispatched. One of: "app_update", "os_update", or "periodic" + */ + addListener(callback: (reason: string) => void): void; + } + + interface RuntimeUpdateAvailableEvent extends chrome.events.Event { + /** + * @param callback + * Parameter details: The manifest details of the available update. + */ + addListener(callback: (details: UpdateAvailableDetails) => void): void; + } + + /** + * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via tabs.connect. + * @since Chrome 26. + */ + export function connect(connectInfo?: ConnectInfo): Port; + /** + * Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and web messaging. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via tabs.connect. + * @since Chrome 26. + * @param extensionId Optional. + * The ID of the extension or app to connect to. If omitted, a connection will be attempted with your own extension. Required if sending messages from a web page for web messaging. + */ + export function connect(extensionId: string, connectInfo?: ConnectInfo): Port; + /** + * Connects to a native application in the host machine. + * @since Chrome 28. + * @param application The name of the registered application to connect to. + */ + export function connectNative(application: string): Port; + /** Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set. */ + export function getBackgroundPage(callback: (backgroundPage?: Window) => void): void; + /** + * Returns details about the app or extension from the manifest. The object returned is a serialization of the full manifest file. + * @returns The manifest details. + */ + export function getManifest(): Object; + /** + * Returns a DirectoryEntry for the package directory. + * @since Chrome 29. + */ + export function getPackageDirectoryEntry(callback: (directoryEntry: DirectoryEntry) => void): void; + /** + * Returns information about the current platform. + * @since Chrome 29. + * @param callback Called with results + */ + export function getPlatformInfo(callback: (platformInfo: PlatformInfo) => void): void; + /** + * Converts a relative path within an app/extension install directory to a fully-qualified URL. + * @param path A path to a resource within an app/extension expressed relative to its install directory. + */ + export function getURL(path: string): string; + /** + * Reloads the app or extension. + * @since Chrome 25. + */ + export function reload(): void; + /** + * Requests an update check for this app/extension. + * @since Chrome 25. + * @param callback + * Parameter status: Result of the update check. One of: "throttled", "no_update", or "update_available" + * Optional parameter details: If an update is available, this contains more information about the available update. + */ + export function requestUpdateCheck(callback: (status: string, details?: UpdateCheckDetails) => void): void; + /** + * Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op. + * @since Chrome 32. + */ + export function restart(): void; + /** + * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. + * @since Chrome 26. + * @param responseCallback Optional + * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendMessage(message: any, responseCallback?: (response: any) => void): void; + /** + * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. + * @since Chrome 32. + * @param responseCallback Optional + * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendMessage(message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; + /** + * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. + * @since Chrome 26. + * @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging. + * @param responseCallback Optional + * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendMessage(extensionId: string, message: any, responseCallback?: (response: any) => void): void; + /** + * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage. + * @since Chrome 32. + * @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for web messaging. + * @param responseCallback Optional + * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendMessage(extensionId: string, message: any, options: MessageOptions, responseCallback?: (response: any) => void): void; + /** + * Send a single message to a native application. + * @since Chrome 28. + * @param application The of the native messaging host. + * @param message The message that will be passed to the native messaging host. + * @param responseCallback Optional. + * Parameter response: The response message sent by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendNativeMessage(application: string, message: Object, responseCallback?: (response: any) => void): void; + /** + * Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters. + * @since Chrome 41. + * @param url Since Chrome 34. + * URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation. + * @param callback Called when the uninstall URL is set. If the given URL is invalid, runtime.lastError will be set. + */ + export function setUninstallURL(url: string, callback?: () => void): void; + /** + * Open your Extension's options page, if possible. + * The precise behavior may depend on your manifest's options_ui or options_page key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, within chrome://extensions, within an App, or it may just focus an open options page. It will never cause the caller page to reload. + * If your Extension does not declare an options page, or Chrome failed to create one for some other reason, the callback will set lastError. + * @since Chrome 42. + */ + export function openOptionsPage(callback?: () => void): void; + + /** + * Fired when a connection is made from either an extension process or a content script. + * @since Chrome 26. + */ + var onConnect: ExtensionConnectEvent; + /** + * Fired when a connection is made from another extension. + * @since Chrome 26. + */ + var onConnectExternal: RuntimeEvent; + /** Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded. */ + var onSuspend: RuntimeEvent; + /** + * Fired when a profile that has this extension installed first starts up. This event is not fired when an incognito profile is started, even if this extension is operating in 'split' incognito mode. + * @since Chrome 23. + */ + var onStartup: RuntimeEvent; + /** Fired when the extension is first installed, when the extension is updated to a new version, and when Chrome is updated to a new version. */ + var onInstalled: RuntimeInstalledEvent; + /** Sent after onSuspend to indicate that the app won't be unloaded after all. */ + var onSuspendCanceled: RuntimeEvent; + /** + * Fired when a message is sent from either an extension process or a content script. + * @since Chrome 26. + */ + var onMessage: ExtensionMessageEvent; + /** + * Fired when a message is sent from another extension/app. Cannot be used in a content script. + * @since Chrome 26. + */ + var onMessageExternal: ExtensionMessageEvent; + /** + * Fired when an app or the device that it runs on needs to be restarted. The app should close all its windows at its earliest convenient time to let the restart to happen. If the app does nothing, a restart will be enforced after a 24-hour grace period has passed. Currently, this event is only fired for Chrome OS kiosk apps. + * @since Chrome 29. + */ + var onRestartRequired: RuntimeRestartRequiredEvent; + /** + * Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call chrome.runtime.reload(). If your extension is using a persistent background page, the background page of course never gets unloaded, so unless you call chrome.runtime.reload() manually in response to this event the update will not get installed until the next time chrome itself restarts. If no handlers are listening for this event, and your extension has a persistent background page, it behaves as if chrome.runtime.reload() is called in response to this event. + * @since Chrome 25. + */ + var onUpdateAvailable: RuntimeUpdateAvailableEvent; + /** + * @deprecated since Chrome 33. Please use chrome.runtime.onRestartRequired. + * Fired when a Chrome update is available, but isn't installed immediately because a browser restart is required. + */ + var onBrowserUpdateAvailable: RuntimeEvent; +} + +//////////////////// +// Script Badge +//////////////////// +declare module chrome.scriptBadge { + interface GetPopupDetails { + tabId: number; + } + + interface AttentionDetails { + tabId: number; + } + + interface SetPopupDetails { + tabId: number; + popup: string; + } + + interface ScriptBadgeClickedEvent extends chrome.events.Event { + addListener(callback: (tab: chrome.tabs.Tab) => void): void; + } + + export function getPopup(details: GetPopupDetails, callback: Function): void; + export function getAttention(details: AttentionDetails): void; + export function setPopup(details: SetPopupDetails): void; + + var onClicked: ScriptBadgeClickedEvent; +} + +//////////////////// +// Sessions +//////////////////// +/** + * Use the chrome.sessions API to query and restore tabs and windows from a browsing session. + * Permissions: "sessions" + * @since Chrome 37. + */ +declare module chrome.sessions { + interface Filter { + /** + * Optional. + * The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries (sessions.MAX_SESSION_RESULTS). + */ + maxResults?: number; + } + + interface Session { + /** The time when the window or tab was closed or modified, represented in milliseconds since the epoch. */ + lastModified: number; + /** + * Optional. + * The tabs.Tab, if this entry describes a tab. Either this or sessions.Session.window will be set. + */ + tab?: tabs.Tab; + /** + * Optional. + * The windows.Window, if this entry describes a window. Either this or sessions.Session.tab will be set. + */ + window?: windows.Window; + } + + interface Device { + /** The name of the foreign device. */ + deviceName: string; + /** A list of open window sessions for the foreign device, sorted from most recently to least recently modified session. */ + sessions: Session[]; + } + + interface SessionChangedEvent extends chrome.events.Event { + addListener(callback: () => void): void; + } + + /** The maximum number of sessions.Session that will be included in a requested list. */ + export var MAX_SESSION_RESULTS: number; + + /** + * Gets the list of recently closed tabs and/or windows. + * @param callback + * Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows. + */ + export function getRecentlyClosed(filter: Filter, callback: (sessions: Session[]) => void): void; + /** + * Gets the list of recently closed tabs and/or windows. + * @param callback + * Parameter sessions: The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index 0). The entries may contain either tabs or windows. + */ + export function getRecentlyClosed(callback: (sessions: Session[]) => void): void; + /** + * Retrieves all devices with synced sessions. + * @param callback + * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects. + */ + export function getDevices(filter: Filter, callback: (devices: Device[]) => void): void; + /** + * Retrieves all devices with synced sessions. + * @param callback + * Parameter devices: The list of sessions.Device objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. tabs.Tab objects are sorted by recency in the windows.Window of the sessions.Session objects. + */ + export function getDevices(callback: (devices: Device[]) => void): void; + /** + * Reopens a windows.Window or tabs.Tab, with an optional callback to run when the entry has been restored. + * @param sessionId Optional. + * The windows.Window.sessionId, or tabs.Tab.sessionId to restore. If this parameter is not specified, the most recently closed session is restored. + * @param callback Optional. + * Parameter restoredSession: A sessions.Session containing the restored windows.Window or tabs.Tab object. + */ + export function restore(sessionId?: string, callback?: (restoredSession: Session) => void): void; + + /** Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes. */ + export var onChanged: SessionChangedEvent; +} + +//////////////////// +// Storage +//////////////////// +/** + * Use the chrome.storage API to store, retrieve, and track changes to user data. + * Permissions: "storage" + * @since Chrome 20. + */ +declare module chrome.storage { + interface StorageArea { + /** + * Gets the amount of space (in bytes) being used by one or more items. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. + */ + getBytesInUse(callback: (bytesInUse: number) => void): void; + /** + * Gets the amount of space (in bytes) being used by one or more items. + * @param key A single key to get the total usage for. Pass in null to get the total usage of all of storage. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. + */ + getBytesInUse(key: string, callback: (bytesInUse: number) => void): void; + /** + * Gets the amount of space (in bytes) being used by one or more items. + * @param keys A list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage. + * @param callback Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set). + * Parameter bytesInUse: Amount of space being used in storage, in bytes. + */ + getBytesInUse(keys: string[], callback: (bytesInUse: number) => void): void; + /** + * Removes all items from storage. + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + clear(callback?: () => void): void; + /** + * Sets multiple items. + * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected. + * Primitive values such as numbers will serialize as expected. Values with a typeof "object" and "function" will typically serialize to {}, with the exception of Array (serializes as expected), Date, and Regex (serialize using their String representation). + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + set(items: Object, callback?: () => void): void; + /** + * Removes one item from storage. + * @param key A single key for items to remove. + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + remove(key: string, callback?: () => void): void; + /** + * Removes items from storage. + * @param keys A list of keys for items to remove. + * @param callback Optional. + * Callback on success, or on failure (in which case runtime.lastError will be set). + */ + remove(keys: string[], callback?: () => void): void; + /** + * Gets one or more items from storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(callback: (items: { [key: string]: any }) => void): void; + /** + * Gets one or more items from storage. + * @param key A single key to get. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(key: string, callback: (items: { [key: string]: any }) => void): void; + /** + * Gets one or more items from storage. + * @param keys A list of keys to get. An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(keys: string[], callback: (items: { [key: string]: any }) => void): void; + /** + * Gets one or more items from storage. + * @param keys A dictionary specifying default values. Pass in null to get the entire contents of storage. + * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set). + * Parameter items: Object with items in their key-value mappings. + */ + get(keys: Object, callback: (items: { [key: string]: any }) => void): void; + } + + interface StorageChange { + /** Optional. The new value of the item, if there is a new value. */ + newValue?: any; + /** Optional. The old value of the item, if there was an old value. */ + oldValue?: any; + } + + interface LocalStorageArea extends StorageArea { + /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ + QUOTA_BYTES: number; + } + + interface SyncStorageArea extends StorageArea { + /** @deprecated since Chrome 40. The storage.sync API no longer has a sustained write operation quota. */ + MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: number; + /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. */ + QUOTA_BYTES: number; + /** The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set runtime.lastError. */ + QUOTA_BYTES_PER_ITEM: number; + /** The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set runtime.lastError. */ + MAX_ITEMS: number; + /** + * The maximum number of set, remove, or clear operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit. + * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. + */ + MAX_WRITE_OPERATIONS_PER_HOUR: number; + /** + * The maximum number of set, remove, or clear operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time. + * Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError. + * @since Chrome 40. + */ + MAX_WRITE_OPERATIONS_PER_MINUTE: number; + } + + interface StorageChangedEvent extends chrome.events.Event { + /** + * @param callback + * Parameter changes: Object mapping each key that changed to its corresponding storage.StorageChange for that item. + * Parameter areaName: Since Chrome 22. The name of the storage area ("sync", "local" or "managed") the changes are for. + */ + addListener(callback: (changes: { [key: string]: StorageChange }, areaName: string) => void): void; + } + + /** Items in the local storage area are local to each machine. */ + var local: LocalStorageArea; + /** Items in the sync storage area are synced using Chrome Sync. */ + var sync: SyncStorageArea; + + /** + * Items in the managed storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. + * @since Chrome 33. + */ + var managed: StorageArea; + + /** Fired when one or more items change. */ + var onChanged: StorageChangedEvent; +} + +//////////////////// +// Socket +//////////////////// +declare module chrome.socket { + interface CreateInfo { + socketId: number; + } + + interface AcceptInfo { + resultCode: number; + socketId?: number; + } + + interface ReadInfo { + resultCode: number; + data: ArrayBuffer; + } + + interface WriteInfo { + bytesWritten: number; + } + + interface RecvFromInfo { + resultCode: number; + data: ArrayBuffer; + port: number; + address: string; + } + + interface SocketInfo { + socketType: string; + localPort?: number; + peerAddress?: string; + peerPort?: number; + localAddress?: string; + connected: boolean; + } + + interface NetworkInterface { + name: string; + address: string; + } + + export function create(type: string, options?: Object, callback?: (createInfo: CreateInfo) => void): void; + export function destroy(socketId: number): void; + export function connect(socketId: number, hostname: string, port: number, callback: (result: number) => void): void; + export function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void; + export function disconnect(socketId: number): void; + export function read(socketId: number, bufferSize?: number, callback?: (readInfo: ReadInfo) => void): void; + export function write(socketId: number, data: ArrayBuffer, callback?: (writeInfo: WriteInfo) => void): void; + export function recvFrom(socketId: number, bufferSize?: number, callback?: (recvFromInfo: RecvFromInfo) => void): void; + export function sendTo(socketId: number, data: ArrayBuffer, address: string, port: number, callback?: (writeInfo: WriteInfo) => void): void; + export function listen(socketId: number, address: string, port: number, backlog?: number, callback?: (result: number) => void): void; + export function accept(socketId: number, callback?: (acceptInfo: AcceptInfo) => void): void; + export function setKeepAlive(socketId: number, enable: boolean, delay?: number, callback?: (result: boolean) => void): void; + export function setNoDelay(socketId: number, noDelay: boolean, callback?: (result: boolean) => void): void; + export function getInfo(socketId: number, callback: (result: SocketInfo) => void): void; + export function getNetworkList(callback: (result: NetworkInterface[]) => void): void; +} + +//////////////////// +// System CPU +//////////////////// +/** + * Use the system.cpu API to query CPU metadata. + * Permissions: "system.cpu" + * @since Chrome 32. + */ +declare module chrome.system.cpu { + interface ProcessorUsage { + /** The cumulative time used by userspace programs on this processor. */ + user: number; + /** The cumulative time used by kernel programs on this processor. */ + kernel: number; + /** The cumulative time spent idle by this processor. */ + idle: number; + /** The total cumulative time for this processor. This value is equal to user + kernel + idle. */ + total: number; + } + + interface ProcessorInfo { + /** Cumulative usage info for this logical processor. */ + usage: ProcessorUsage; + } + + interface CpuInfo { + /** The number of logical processors. */ + numOfProcessors: number; + /** The architecture name of the processors. */ + archName: string; + /** The model name of the processors. */ + modelName: string; + /** + * A set of feature codes indicating some of the processor's capabilities. + * The currently supported codes are "mmx", "sse", "sse2", "sse3", "ssse3", "sse4_1", "sse4_2", and "avx". + */ + features: string[]; + /** Information about each logical processor. */ + processors: ProcessorInfo[]; + } + + /** Queries basic CPU information of the system. */ + export function getInfo(callback: (info: CpuInfo) => void): void; +} + +//////////////////// +// System Memory +//////////////////// +/** + * The chrome.system.memory API. + * Permissions: "system.memory" + * @since Chrome 32. + */ +declare module chrome.system.memory { + interface MemoryInfo { + /** The total amount of physical memory capacity, in bytes. */ + capacity: number; + /** The amount of available capacity, in bytes. */ + availableCapacity: number; + } + + /** Get physical memory information. */ + export function getInfo(callback: (info: MemoryInfo) => void): void; +} + +//////////////////// +// System Storage +//////////////////// +/** + * Use the chrome.system.storage API to query storage device information and be notified when a removable storage device is attached and detached. + * Permissions: "system.storage" + * @since Chrome 30. + */ +declare module chrome.system.storage { + interface StorageUnitInfo { + /** The transient ID that uniquely identifies the storage device. This ID will be persistent within the same run of a single application. It will not be a persistent identifier between different runs of an application, or between different applications. */ + id: string; + /** The name of the storage unit. */ + name: string; + /** + * The media type of the storage unit. + * fixed: The storage has fixed media, e.g. hard disk or SSD. + * removable: The storage is removable, e.g. USB flash drive. + * unknown: The storage type is unknown. + */ + type: string; + /** The total amount of the storage space, in bytes. */ + capacity: number; + } + + interface StorageCapacityInfo { + /** A copied |id| of getAvailableCapacity function parameter |id|. */ + id: string; + /** The available capacity of the storage device, in bytes. */ + availableCapacity: number; + } + + interface SystemStorageAttachedEvent extends chrome.events.Event { + addListener(callback: (info: StorageUnitInfo) => void): void; + } + + interface SystemStorageDetachedEvent extends chrome.events.Event { + addListener(callback: (id: string) => void): void; + } + + /** Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects. */ + export function getInfo(callback: (info: StorageUnitInfo[]) => void): void; + /** + * Ejects a removable storage device. + * @param callback + * Parameter result: success: The ejection command is successful -- the application can prompt the user to remove the device; in_use: The device is in use by another application. The ejection did not succeed; the user should not remove the device until the other application is done with the device; no_such_device: There is no such device known. failure: The ejection command failed. + */ + export function ejectDevice(id: string, callback: (result: string) => void): void; + /** + * Get the available capacity of a specified |id| storage device. The |id| is the transient device ID from StorageUnitInfo. + * @since Dev channel only. + */ + export function getAvailableCapacity(id: string, callback: (info: StorageCapacityInfo) => void): void; + + /** Fired when a new removable storage is attached to the system. */ + export var onAttached: SystemStorageAttachedEvent; + /** Fired when a removable storage is detached from the system. */ + export var onDetached: SystemStorageDetachedEvent; +} + +//////////////////// +// TabCapture +//////////////////// +/** + * Use the chrome.tabCapture API to interact with tab media streams. + * Permissions: "tabCapture" + * @since Chrome 31. + */ +declare module chrome.tabCapture { + interface CaptureInfo { + /** The id of the tab whose status changed. */ + tabId: number; + /** + * The new capture status of the tab. + * One of: "pending", "active", "stopped", or "error" + */ + status: string; + /** Whether an element in the tab being captured is in fullscreen mode. */ + fullscreen: boolean; + } + + interface CaptureOptions { + /** Optional. */ + audio?: boolean; + /** Optional. */ + video?: boolean; + /** Optional. */ + audioConstraints?: MediaStreamConstraints; + /** Optional. */ + videoConstraints?: MediaStreamConstraints; + } + + interface CaptureStatusChangedEvent extends chrome.events.Event { + /** + * @param callback + * Parameter info: CaptureInfo with new capture status for the tab. + */ + addListener(callback: (info: CaptureInfo) => void): void; + } + + /** + * Captures the visible area of the currently active tab. Capture can only be started on the currently active tab after the extension has been invoked. Capture is maintained across page navigations within the tab, and stops when the tab is closed, or the media stream is closed by the extension. + * @param options Configures the returned media stream. + * @param callback Callback with either the tab capture stream or null. + */ + export function capture(options: CaptureOptions, callback: (stream: MediaStream) => void): void; + /** + * Returns a list of tabs that have requested capture or are being captured, i.e. status != stopped and status != error. This allows extensions to inform the user that there is an existing tab capture that would prevent a new tab capture from succeeding (or to prevent redundant requests for the same tab). + * @param callback Callback invoked with CaptureInfo[] for captured tabs. + */ + export function getCapturedTabs(callback: (result: CaptureInfo[]) => void): void; + + /** Event fired when the capture status of a tab changes. This allows extension authors to keep track of the capture status of tabs to keep UI elements like page actions in sync. */ + var onStatusChanged: CaptureStatusChangedEvent; +} + +//////////////////// +// Tabs +//////////////////// +/** + * Use the chrome.tabs API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser. + * Permissions: The majority of the chrome.tabs API can be used without declaring any permission. However, the "tabs" permission is required in order to populate the url, title, and favIconUrl properties of Tab. + * @since Chrome 5. + */ +declare module chrome.tabs { + /** + * Tab muted state and the reason for the last state change. + * @since Chrome 46. Warning: this is the current Beta channel. + */ + interface MutedInfo { + /** Whether the tab is prevented from playing sound (but hasn't necessarily recently produced sound). Equivalent to whether the muted audio indicator is showing. */ + muted: boolean; + /** + * Optional. + * The reason the tab was muted or unmuted. Not set if the tab's mute state has never been changed. + * "user": A user input action has set/overridden the muted state. + * "capture": Tab capture started, forcing a muted state change. + * "extension": An extension, identified by the extensionId field, set the muted state. + */ + reason?: string; + /** + * Optional. + * The ID of the extension that changed the muted state. Not set if an extension was not the reason the muted state last changed. + */ + extensionId?: string; + } + + interface Tab { + /** + * Optional. + * Either loading or complete. + */ + status?: string; + /** The zero-based index of the tab within its window. */ + index: number; + /** + * Optional. + * The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists. + * @since Chrome 18. + */ + openerTabId?: number; + /** + * Optional. + * The title of the tab. This property is only present if the extension's manifest includes the "tabs" permission. + */ + title?: string; + /** + * Optional. + * The URL the tab is displaying. This property is only present if the extension's manifest includes the "tabs" permission. + */ + url?: string; + /** + * Whether the tab is pinned. + * @since Chrome 9. + */ + pinned: boolean; + /** + * Whether the tab is highlighted. + * @since Chrome 16. + */ + highlighted: boolean; + /** The ID of the window the tab is contained within. */ + windowId: number; + /** + * Whether the tab is active in its window. (Does not necessarily mean the window is focused.) + * @since Chrome 16. + */ + active: boolean; + /** + * Optional. + * The URL of the tab's favicon. This property is only present if the extension's manifest includes the "tabs" permission. It may also be an empty string if the tab is loading. + */ + favIconUrl?: string; + /** + * Optional. + * The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the sessions API, in which case a session ID may be present. Tab ID can also be set to chrome.tabs.TAB_ID_NONE for apps and devtools windows. + */ + id?: number; + /** Whether the tab is in an incognito window. */ + incognito: boolean; + /** + * Whether the tab is selected. + * @deprecated since Chrome 33. Please use tabs.Tab.highlighted. + */ + selected: boolean; + /** + * Optional. + * Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the speaker audio indicator is showing. + * @since Chrome 45. + */ + audible?: boolean; + /** + * Optional. + * Current tab muted state and the reason for the last state change. + * @since Chrome 46. Warning: this is the current Beta channel. + */ + mutedInfo?: MutedInfo; + /** + * Optional. The width of the tab in pixels. + * @since Chrome 31. + */ + width?: number; + /** + * Optional. The height of the tab in pixels. + * @since Chrome 31. + */ + height?: number; + /** + * Optional. The session ID used to uniquely identify a Tab obtained from the sessions API. + * @since Chrome 31. + */ + sessionId?: string; + } + + /** + * Defines how zoom changes in a tab are handled and at what scope. + * @since Chrome 38. + */ + interface ZoomSettings { + /** + * Optional. + * Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to "automatic". + * "automatic": Zoom changes are handled automatically by the browser. + * "manual": Overrides the automatic handling of zoom changes. The onZoomChange event will still be dispatched, and it is the responsibility of the extension to listen for this event and manually scale the page. This mode does not support per-origin zooming, and will thus ignore the scope zoom setting and assume per-tab. + * "disabled": Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom changes will be ignored. + */ + mode?: string; + /** + * Optional. + * Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to per-origin when in automatic mode, and per-tab otherwise. + * "per-origin": Zoom changes will persist in the zoomed page's origin, i.e. all other tabs navigated to that same origin will be zoomed as well. Moreover, per-origin zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. The per-origin scope is only available in the automatic mode. + * "per-tab": Zoom changes only take effect in this tab, and zoom changes in other tabs will not affect the zooming of this tab. Also, per-tab zoom changes are reset on navigation; navigating a tab will always load pages with their per-origin zoom factors. + */ + scope?: string; + /** + * Optional. + * Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings. + * @since Chrome 43. + */ + defaultZoomFactor?: number; + } + + interface InjectDetails { + /** + * Optional. + * If allFrames is true, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's false and is only injected into the top frame. + */ + allFrames?: boolean; + /** + * Optional. JavaScript or CSS code to inject. + * Warning: Be careful using the code parameter. Incorrect use of it may open your extension to cross site scripting attacks. + */ + code?: string; + /** + * Optional. The soonest that the JavaScript or CSS will be injected into the tab. + * One of: "document_start", "document_end", or "document_idle" + * @since Chrome 20. + */ + runAt?: string; + /** Optional. JavaScript or CSS file to inject. */ + file?: string; + /** + * Optional. + * If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is false. + * @since Chrome 39. + */ + matchAboutBlank?: boolean; + } + + interface CreateProperties { + /** Optional. The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window. */ + index?: number; + /** + * Optional. + * The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as the newly created tab. + * @since Chrome 18. + */ + openerTabId?: number; + /** + * Optional. + * The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page. + */ + url?: string; + /** + * Optional. Whether the tab should be pinned. Defaults to false + * @since Chrome 9. + */ + pinned?: boolean; + /** Optional. The window to create the new tab in. Defaults to the current window. */ + windowId?: number; + /** + * Optional. + * Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see windows.update). Defaults to true. + * @since Chrome 16. + */ + active?: boolean; + /** + * Optional. Whether the tab should become the selected tab in the window. Defaults to true + * @deprecated since Chrome 33. Please use active. + */ + selected?: boolean; + } + + interface MoveProperties { + /** The position to move the window to. -1 will place the tab at the end of the window. */ + index: number; + /** Optional. Defaults to the window the tab is currently in. */ + windowId?: number; + } + + interface UpdateProperties { + /** + * Optional. Whether the tab should be pinned. + * @since Chrome 9. + */ + pinned?: boolean; + /** + * Optional. The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab. + * @since Chrome 18. + */ + openerTabId?: number; + /** Optional. A URL to navigate the tab to. */ + url?: string; + /** + * Optional. Adds or removes the tab from the current selection. + * @since Chrome 16. + */ + highlighted?: boolean; + /** + * Optional. Whether the tab should be active. Does not affect whether the window is focused (see windows.update). + * @since Chrome 16. + */ + active?: boolean; + /** + * Optional. Whether the tab should be selected. + * @deprecated since Chrome 33. Please use highlighted. + */ + selected?: boolean; + /** + * Optional. Whether the tab should be muted. + * @since Chrome 45. + */ + muted?: boolean; + } + + interface CaptureVisibleTabOptions { + /** + * Optional. + * When format is "jpeg", controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease. + */ + quality?: number; + /** + * Optional. The format of an image. + * One of: "jpeg", or "png" + */ + format?: string; + } + + interface ReloadProperties { + /** Optional. Whether using any local cache. Default is false. */ + bypassCache?: boolean; + } + + interface ConnectInfo { + /** Optional. Will be passed into onConnect for content scripts that are listening for the connection event. */ + name?: string; + /** + * Open a port to a specific frame identified by frameId instead of all frames in the tab. + * @since Chrome 41. + */ + frameId?: number; + } + + interface MessageSendOptions { + /** Optional. Send a message to a specific frame identified by frameId instead of all frames in the tab. */ + frameId?: number; + } + + interface HighlightInfo { + /** One or more tab indices to highlight. */ + tabs: number | number[]; + /** Optional. The window that contains the tabs. */ + windowId?: number; + } + + interface QueryInfo { + /** + * Optional. Whether the tabs have completed loading. + * One of: "loading", or "complete" + */ + status?: string; + /** + * Optional. Whether the tabs are in the last focused window. + * @since Chrome 19. + */ + lastFocusedWindow?: boolean; + /** Optional. The ID of the parent window, or windows.WINDOW_ID_CURRENT for the current window. */ + windowId?: number; + /** + * Optional. The type of window the tabs are in. + * One of: "normal", "popup", "panel", "app", or "devtools" + */ + windowType?: string; + /** Optional. Whether the tabs are active in their windows. */ + active?: boolean; + /** + * Optional. The position of the tabs within their windows. + * @since Chrome 18. + */ + index?: number; + /** Optional. Match page titles against a pattern. */ + title?: string; + /** Optional. Match tabs against one or more URL patterns. Note that fragment identifiers are not matched. */ + url?: string | string[]; + /** + * Optional. Whether the tabs are in the current window. + * @since Chrome 19. + */ + currentWindow?: boolean; + /** Optional. Whether the tabs are highlighted. */ + highlighted?: boolean; + /** Optional. Whether the tabs are pinned. */ + pinned?: boolean; + /** + * Optional. Whether the tabs are audible. + * @since Chrome 45. + */ + audible?: boolean; + /** + * Optional. Whether the tabs are muted. + * @since Chrome 45. + */ + muted?: boolean; + } + + interface TabHighlightInfo { + windowId: number; + tabIds: number[]; + } + + interface TabRemoveInfo { + /** + * The window whose tab is closed. + * @since Chrome 25. + */ + windowId: number; + /** True when the tab is being closed because its window is being closed. */ + isWindowClosing: boolean; + } + + interface TabAttachInfo { + newPosition: number; + newWindowId: number; + } + + interface TabChangeInfo { + /** Optional. The status of the tab. Can be either loading or complete. */ + status?: string; + /** + * The tab's new pinned state. + * @since Chrome 9. + */ + pinned?: boolean; + /** Optional. The tab's URL if it has changed. */ + url?: string; + /** + * The tab's new audible state. + * @since Chrome 45. + */ + audible?: boolean; + /** + * The tab's new muted state and the reason for the change. + * @since Chrome 46. Warning: this is the current Beta channel. + */ + mutedInfo?: MutedInfo; + /** + * The tab's new favicon URL. + * @since Chrome 27. + */ + faviconUrl?: string; + } + + interface TabMoveInfo { + toIndex: number; + windowId: number; + fromIndex: number; + } + + interface TabDetachInfo { + oldWindowId: number; + oldPosition: number; + } + + interface TabActiveInfo { + /** The ID of the tab that has become active. */ + tabId: number; + /** The ID of the window the active tab changed inside of. */ + windowId: number; + } + + interface TabWindowInfo { + /** The ID of the window of where the tab is located. */ + windowId: number; + } + + interface ZoomChangeInfo { + tabId: number; + oldZoomFactor: number; + newZoomFactor: number; + zoomSettings: ZoomSettings; + } + + interface TabHighlightedEvent extends chrome.events.Event { + addListener(callback: (highlightInfo: HighlightInfo) => void): void; + } + + interface TabRemovedEvent extends chrome.events.Event { + addListener(callback: (tabId: number, removeInfo: TabRemoveInfo) => void): void; + } + + interface TabUpdatedEvent extends chrome.events.Event { + /** + * @param callback + * Parameter changeInfo: Lists the changes to the state of the tab that was updated. + * Parameter tab: Gives the state of the tab that was updated. + */ + addListener(callback: (tabId: number, changeInfo: TabChangeInfo, tab: Tab) => void): void; + } + + interface TabAttachedEvent extends chrome.events.Event { + addListener(callback: (tabId: number, attachInfo: TabAttachInfo) => void): void; + } + + interface TabMovedEvent extends chrome.events.Event { + addListener(callback: (tabId: number, moveInfo: TabMoveInfo) => void): void; + } + + interface TabDetachedEvent extends chrome.events.Event { + addListener(callback: (tabId: number, detachInfo: TabDetachInfo) => void): void; + } + + interface TabCreatedEvent extends chrome.events.Event { + /** + * @param callback + * Parameter tab: Details of the tab that was created. + */ + addListener(callback: (tab: Tab) => void): void; + } + + interface TabActivatedEvent extends chrome.events.Event { + addListener(callback: (activeInfo: TabActiveInfo) => void): void; + } + + interface TabReplacedEvent extends chrome.events.Event { + addListener(callback: (addedTabId: number, removedTabId: number) => void): void; + } + + interface TabSelectedEvent extends chrome.events.Event { + addListener(callback: (tabId: number, selectInfo: TabWindowInfo) => void): void; + } + + interface TabZoomChangeEvent extends chrome.events.Event { + addListener(callback: (ZoomChangeInfo: ZoomChangeInfo) => void): void; + } + + /** + * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc. + * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. + * @param callback Optional. Called after all the JavaScript has been executed. + * Parameter result: The result of the script in every injected frame. + */ + export function executeScript(details: InjectDetails, callback?: (result: any[]) => void): void; + /** + * Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc. + * @param tabId Optional. The ID of the tab in which to run the script; defaults to the active tab of the current window. + * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. + * @param callback Optional. Called after all the JavaScript has been executed. + * Parameter result: The result of the script in every injected frame. + */ + export function executeScript(tabId: number, details: InjectDetails, callback?: (result: any[]) => void): void; + /** Retrieves details about the specified tab. */ + export function get(tabId: number, callback: (tab: Tab) => void): void; + /** + * Gets details about all tabs in the specified window. + * @deprecated since Chrome 33. Please use tabs.query {windowId: windowId}. + */ + export function getAllInWindow(callback: (tab: Tab) => void): void; + /** + * Gets details about all tabs in the specified window. + * @deprecated since Chrome 33. Please use tabs.query {windowId: windowId}. + * @param windowId Optional. Defaults to the current window. + */ + export function getAllInWindow(windowId: number, callback: (tab: Tab) => void): void; + /** Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a background page or popup view). */ + export function getCurrent(callback: (tab?: Tab) => void): void; + /** + * Gets the tab that is selected in the specified window. + * @deprecated since Chrome 33. Please use tabs.query {active: true}. + */ + export function getSelected(callback: (tab: Tab) => void): void; + /** + * Gets the tab that is selected in the specified window. + * @deprecated since Chrome 33. Please use tabs.query {active: true}. + * @param windowId Optional. Defaults to the current window. + */ + export function getSelected(windowId: number, callback: (tab: Tab) => void): void; + /** + * Creates a new tab. + * @param callback Optional. + * Parameter tab: Details about the created tab. Will contain the ID of the new tab. + */ + export function create(createProperties: CreateProperties, callback?: (tab: Tab) => void): void; + /** + * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows. + * @param tabId The tab to move. + * @param callback Optional. + * Parameter tab: Details about the moved tab. + */ + export function move(tabId: number, moveProperties: MoveProperties, callback?: (tab: Tab) => void): void; + /** + * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows. + * @param tabIds The tabs to move. + * @param callback Optional. + * Parameter tabs: Details about the moved tabs. + */ + export function move(tabIds: number[], moveProperties: MoveProperties, callback?: (tabs: Tab[]) => void): void; + /** + * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified. + * @param callback Optional. + * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested. + */ + export function update(updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void; + /** + * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified. + * @param tabId Defaults to the selected tab of the current window. + * @param callback Optional. + * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested. + */ + export function update(tabId: number, updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void; + /** + * Closes a tab. + * @param tabId The tab to close. + */ + export function remove(tabId: number, callback?: Function): void; + /** + * Closes several tabs. + * @param tabIds The list of tabs to close. + */ + export function remove(tabIds: number[], callback?: Function): void; + /** + * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method. + * @param callback + * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display. + */ + export function captureVisibleTab(callback: (dataUrl: string) => void): void; + /** + * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method. + * @param windowId Optional. The target window. Defaults to the current window. + * @param callback + * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display. + */ + export function captureVisibleTab(windowId: number, callback: (dataUrl: string) => void): void; + /** + * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method. + * @param options Optional. Details about the format and quality of an image. + * @param callback + * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display. + */ + export function captureVisibleTab(options: CaptureVisibleTabOptions, callback: (dataUrl: string) => void): void; + /** + * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method. + * @param windowId Optional. The target window. Defaults to the current window. + * @param options Optional. Details about the format and quality of an image. + * @param callback + * Parameter dataUrl: A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display. + */ + export function captureVisibleTab(windowId: number, options: CaptureVisibleTabOptions, callback: (dataUrl: string) => void): void; + /** + * Reload a tab. + * @since Chrome 16. + * @param tabId The ID of the tab to reload; defaults to the selected tab of the current window. + */ + export function reload(tabId: number, reloadProperties?: ReloadProperties, callback?: () => void): void; + /** + * Reload the selected tab of the current window. + * @since Chrome 16. + */ + export function reload(reloadProperties: ReloadProperties, callback?: () => void): void; + /** + * Reload the selected tab of the current window. + * @since Chrome 16. + */ + export function reload(callback?: () => void): void; + /** + * Duplicates a tab. + * @since Chrome 23. + * @param tabId The ID of the tab which is to be duplicated. + * @param callback Optional. + * Optional parameter tab: Details about the duplicated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested. + */ + export function duplicate(tabId: number, callback?: (tab?: Tab) => void): void; + /** + * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension. + * @since Chrome 20. + */ + export function sendMessage(tabId: number, message: any, responseCallback?: (response: any) => void): void; + /** + * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension. + * @since Chrome 41. + * @param responseCallback Optional. + * Parameter response: The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendMessage(tabId: number, message: any, options: MessageSendOptions, responseCallback?: (response: any) => void): void; + /** + * Sends a single request to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The extension.onRequest event is fired in each content script running in the specified tab for the current extension. + * @deprecated since Chrome 33. Please use runtime.sendMessage. + * @param responseCallback Optional. + * Parameter response: The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and runtime.lastError will be set to the error message. + */ + export function sendRequest(tabId: number, request: any, responseCallback?: (response: any) => void): void; + /** Connects to the content script(s) in the specified tab. The runtime.onConnect event is fired in each content script running in the specified tab for the current extension. */ + export function connect(tabId: number, connectInfo?: ConnectInfo): runtime.Port; + /** + * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc. + * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. + * @param callback Optional. Called when all the CSS has been inserted. + */ + export function insertCSS(details: InjectDetails, callback?: Function): void; + /** + * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc. + * @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window. + * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. + * @param callback Optional. Called when all the CSS has been inserted. + */ + export function insertCSS(tabId: number, details: InjectDetails, callback?: Function): void; + /** + * Highlights the given tabs. + * @since Chrome 16. + * @param callback Optional. + * Parameter window: Contains details about the window whose tabs were highlighted. + */ + export function highlight(highlightInfo: HighlightInfo, callback: (window: chrome.windows.Window) => void): void; + /** + * Gets all tabs that have the specified properties, or all tabs if no properties are specified. + * @since Chrome 16. + */ + export function query(queryInfo: QueryInfo, callback: (result: Tab[]) => void): void; + /** + * Detects the primary language of the content in a tab. + * @param callback + * Parameter language: An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, und will be returned. + */ + export function detectLanguage(callback: (language: string) => void): void; + /** + * Detects the primary language of the content in a tab. + * @param tabId Optional. Defaults to the active tab of the current window. + * @param callback + * Parameter language: An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, und will be returned. + */ + export function detectLanguage(tabId: number, callback: (language: string) => void): void; + /** + * Zooms a specified tab. + * @since Chrome 42. + * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab. + * @param callback Optional. Called after the zoom factor has been changed. + */ + export function setZoom(zoomFactor: number, callback?: () => void): void; + /** + * Zooms a specified tab. + * @since Chrome 42. + * @param tabId Optional. The ID of the tab to zoom; defaults to the active tab of the current window. + * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab. + * @param callback Optional. Called after the zoom factor has been changed. + */ + export function setZoom(tabId: number, zoomFactor: number, callback?: () => void): void; + /** + * Gets the current zoom factor of a specified tab. + * @since Chrome 42. + * @param callback Called with the tab's current zoom factor after it has been fetched. + * Parameter zoomFactor: The tab's current zoom factor. + */ + export function getZoom(callback: (zoomFactor: number) => void): void; + /** + * Gets the current zoom factor of a specified tab. + * @since Chrome 42. + * @param tabId Optional. The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window. + * @param callback Called with the tab's current zoom factor after it has been fetched. + * Parameter zoomFactor: The tab's current zoom factor. + */ + export function getZoom(tabId: number, callback: (zoomFactor: number) => void): void; + /** + * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab. + * @since Chrome 42. + * @param zoomSettings Defines how zoom changes are handled and at what scope. + * @param callback Optional. Called after the zoom settings have been changed. + */ + export function setZoomSettings(zoomSettings: ZoomSettings, callback?: () => void): void; + /** + * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab. + * @since Chrome 42. + * @param tabId Optional. The ID of the tab to change the zoom settings for; defaults to the active tab of the current window. + * @param zoomSettings Defines how zoom changes are handled and at what scope. + * @param callback Optional. Called after the zoom settings have been changed. + */ + export function setZoomSettings(tabId: number, zoomSettings: ZoomSettings, callback?: () => void): void; + /** + * Gets the current zoom settings of a specified tab. + * @since Chrome 42. + * @param callback Called with the tab's current zoom settings. + * Paramater zoomSettings: The tab's current zoom settings. + */ + export function getZoomSettings(callback: (zoomSettings: ZoomSettings) => void): void; + /** + * Gets the current zoom settings of a specified tab. + * @since Chrome 42. + * @param tabId Optional. The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window. + * @param callback Called with the tab's current zoom settings. + * Paramater zoomSettings: The tab's current zoom settings. + */ + export function getZoomSettings(tabId: number, callback: (zoomSettings: ZoomSettings) => void): void; + + /** + * Fired when the highlighted or selected tabs in a window changes. + * @since Chrome 18. + */ + var onHighlighted: TabHighlightedEvent; + /** Fired when a tab is closed. */ + var onRemoved: TabRemovedEvent; + /** Fired when a tab is updated. */ + var onUpdated: TabUpdatedEvent; + /** Fired when a tab is attached to a window, for example because it was moved between windows. */ + var onAttached: TabAttachedEvent; + /** + * Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see tabs.onDetached. + */ + var onMoved: TabMovedEvent; + /** Fired when a tab is detached from a window, for example because it is being moved between windows. */ + var onDetached: TabDetachedEvent; + /** Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set. */ + var onCreated: TabCreatedEvent; + /** + * Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set. + * @since Chrome 18. + */ + var onActivated: TabActivatedEvent; + /** + * Fired when a tab is replaced with another tab due to prerendering or instant. + * @since Chrome 26. + */ + var onReplaced: TabReplacedEvent; + /** + * @deprecated since Chrome 33. Please use tabs.onActivated. + * Fires when the selected tab in a window changes. + */ + var onSelectionChanged: TabSelectedEvent; + /** + * @deprecated since Chrome 33. Please use tabs.onActivated. + * Fires when the selected tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to tabs.onUpdated events to be notified when a URL is set. + */ + var onActiveChanged: TabSelectedEvent; + /** + * @deprecated since Chrome 33. Please use tabs.onHighlighted. + * Fired when the highlighted or selected tabs in a window changes. + */ + var onHighlightChanged: TabHighlightedEvent; + /** + * Fired when a tab is zoomed. + * @since Chrome 38. + */ + var onZoomChange: TabZoomChangeEvent; +} + +//////////////////// +// Top Sites +//////////////////// +/** + * Use the chrome.topSites API to access the top sites that are displayed on the new tab page. + * Permissions: "topSites" + * @since Chrome 19. + */ +declare module chrome.topSites { + /** An object encapsulating a most visited URL, such as the URLs on the new tab page. */ + interface MostVisitedURL { + /** The most visited URL. */ + url: string; + /** The title of the page */ + title: string; + } + + /** Gets a list of top sites. */ + export function get(callback: (data: MostVisitedURL[]) => void): void; +} + +//////////////////// +// Text to Speech +//////////////////// +/** + * Use the chrome.tts API to play synthesized text-to-speech (TTS). See also the related ttsEngine API, which allows an extension to implement a speech engine. + * Permissions: "tts" + * @since Chrome 14. + */ +declare module chrome.tts { + /** An event from the TTS engine to communicate the status of an utterance. */ + interface TtsEvent { + /** Optional. The index of the current character in the utterance. */ + charIndex?: number; + /** Optional. The error description, if the event type is 'error'. */ + errorMessage?: string; + /** + * The type can be 'start' as soon as speech has started, 'word' when a word boundary is reached, 'sentence' when a sentence boundary is reached, 'marker' when an SSML mark element is reached, 'end' when the end of the utterance is reached, 'interrupted' when the utterance is stopped or interrupted before reaching the end, 'cancelled' when it's removed from the queue before ever being synthesized, or 'error' when any other error occurs. When pausing speech, a 'pause' event is fired if a particular utterance is paused in the middle, and 'resume' if an utterance resumes speech. Note that pause and resume events may not fire if speech is paused in-between utterances. + * One of: "start", "end", "word", "sentence", "marker", "interrupted", "cancelled", "error", "pause", or "resume" + */ + type: string; + } + + /** A description of a voice available for speech synthesis. */ + interface TtsVoice { + /** Optional. The language that this voice supports, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ + lang?: string; + /** + * Optional. This voice's gender. + * One of: "male", or "female" + */ + gender?: string; + /** Optional. The name of the voice. */ + voiceName?: string; + /** The ID of the extension providing this voice. */ + extensionsId?: string; + /** All of the callback event types that this voice is capable of sending. */ + eventTypes?: string[]; + /** + * If true, the synthesis engine is a remote network resource. It may be higher latency and may incur bandwidth costs. + * @since Chrome 33. + */ + remote?: boolean; + } + + interface SpeakOptions { + /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */ + volume?: number; + /** + * Optional. + * If true, enqueues this utterance if TTS is already in progress. If false (the default), interrupts any current speech and flushes the speech queue before speaking this new utterance. + */ + enqueue?: boolean; + /** + * Optional. + * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. Values below 0.1 or above 10.0 are strictly disallowed, but many voices will constrain the minimum and maximum rates further—for example a particular voice may not actually speak faster than 3 times normal even if you specify a value larger than 3.0. + */ + rate?: number; + /** + * Optional. This function is called with events that occur in the process of speaking the utterance. + * @param event The update event from the text-to-speech engine indicating the status of this utterance. + */ + onEvent?: (event: TtsEvent) => void; + /** + * Optional. + * Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to a voice's default pitch. + */ + pitch?: number; + /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ + lang?: string; + /** Optional. The name of the voice to use for synthesis. If empty, uses any available voice. */ + voiceName?: string; + /** Optional. The extension ID of the speech engine to use, if known. */ + extensionId?: string; + /** + * Optional. Gender of voice for synthesized speech. + * One of: "male", or "female" + */ + gender?: string; + /** Optional. The TTS event types the voice must support. */ + requiredEventTypes?: string[]; + /** Optional. The TTS event types that you are interested in listening to. If missing, all event types may be sent. */ + desiredEventTypes?: string[]; + } + + /** Checks whether the engine is currently speaking. On Mac OS X, the result is true whenever the system speech engine is speaking, even if the speech wasn't initiated by Chrome. */ + export function isSpeaking(callback?: (speaking: boolean) => void): void; + /** Stops any current speech and flushes the queue of any pending utterances. In addition, if speech was paused, it will now be un-paused for the next call to speak. */ + export function stop(): void; + /** Gets an array of all available voices. */ + export function getVoices(callback?: (voices: TtsVoice[]) => void): void; + /** + * Speaks text using a text-to-speech engine. + * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. + * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. + */ + export function speak(utterance: string, callback?: Function): void; + /** + * Speaks text using a text-to-speech engine. + * @param utterance The text to speak, either plain text or a complete, well-formed SSML document. Speech engines that do not support SSML will strip away the tags and speak the text. The maximum length of the text is 32,768 characters. + * @param options Optional. The speech options. + * @param callback Optional. Called right away, before speech finishes. Check chrome.runtime.lastError to make sure there were no errors. Use options.onEvent to get more detailed feedback. + */ + export function speak(utterance: string, options: SpeakOptions, callback?: Function): void; + /** + * Pauses speech synthesis, potentially in the middle of an utterance. A call to resume or stop will un-pause speech. + * @since Chrome 29. + */ + export function pause(): void; + /** + * If speech was paused, resumes speaking where it left off. + * @since Chrome 29. + */ + export function resume(): void; +} + +//////////////////// +// Text to Speech Engine +//////////////////// +/** + * Use the chrome.ttsEngine API to implement a text-to-speech(TTS) engine using an extension. If your extension registers using this API, it will receive events containing an utterance to be spoken and other parameters when any extension or Chrome App uses the tts API to generate speech. Your extension can then use any available web technology to synthesize and output the speech, and send events back to the calling function to report the status. + * Permissions: "ttsEngine" + * @since Chrome 14. + */ +declare module chrome.ttsEngine { + interface SpeakOptions { + /** Optional. The language to be used for synthesis, in the form language-region. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'. */ + lang?: string; + /** Optional. The name of the voice to use for synthesis. */ + voiceName?: string; + /** + * Optional. Gender of voice for synthesized speech. + * One of: "male", or "female" + */ + gender?: string; + /** Optional. Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0. */ + volume?: number; + /** + * Optional. + * Speaking rate relative to the default rate for this voice. 1.0 is the default rate, normally around 180 to 220 words per minute. 2.0 is twice as fast, and 0.5 is half as fast. This value is guaranteed to be between 0.1 and 10.0, inclusive. When a voice does not support this full range of rates, don't return an error. Instead, clip the rate to the range the voice supports. + */ + rate?: number; + /** Optional. Speaking pitch between 0 and 2 inclusive, with 0 being lowest and 2 being highest. 1.0 corresponds to this voice's default pitch. */ + pitch?: number; + } + + interface TtsEngineSpeakEvent extends chrome.events.Event { + /** + * @param callback + * Parameter utterance: The text to speak, specified as either plain text or an SSML document. If your engine does not support SSML, you should strip out all XML markup and synthesize only the underlying text content. The value of this parameter is guaranteed to be no more than 32,768 characters. If this engine does not support speaking that many characters at a time, the utterance should be split into smaller chunks and queued internally without returning an error. + * Parameter options: Options specified to the tts.speak() method. + * Parameter sendTtsEvent: Call this function with events that occur in the process of speaking the utterance. + */ + addListener(callback: (utterance: string, options: SpeakOptions, sendTtsEvent: (event: chrome.tts.TtsEvent) => void) => void): void; + } + + /** Called when the user makes a call to tts.speak() and one of the voices from this extension's manifest is the first to match the options object. */ + var onSpeak: TtsEngineSpeakEvent; + /** Fired when a call is made to tts.stop and this extension may be in the middle of speaking. If an extension receives a call to onStop and speech is already stopped, it should do nothing (not raise an error). If speech is in the paused state, this should cancel the paused state. */ + var onStop: chrome.events.Event; + /** + * Optional: if an engine supports the pause event, it should pause the current utterance being spoken, if any, until it receives a resume event or stop event. Note that a stop event should also clear the paused state. + * @since Chrome 29. + */ + var onPause: chrome.events.Event; + /** + * Optional: if an engine supports the pause event, it should also support the resume event, to continue speaking the current utterance, if any. Note that a stop event should also clear the paused state. + * @since Chrome 29. + */ + var onResume: chrome.events.Event; +} + +//////////////////// +// Types +//////////////////// +/** + * The chrome.types API contains type declarations for Chrome. + * @since Chrome 13. + */ +declare module chrome.types { + interface ChromeSettingClearDetails { + /** + * Optional. + * The scope of the ChromeSetting. One of + * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), + * • regular_only: setting for the regular profile only (not inherited by the incognito profile), + * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), + * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). + */ + scope?: string; + } + + interface ChromeSettingSetDetails extends ChromeSettingClearDetails { + /** + * The value of the setting. + * Note that every setting has a specific value type, which is described together with the setting. An extension should not set a value of a different type. + */ + value: any; + /** + * Optional. + * The scope of the ChromeSetting. One of + * • regular: setting for the regular profile (which is inherited by the incognito profile if not overridden elsewhere), + * • regular_only: setting for the regular profile only (not inherited by the incognito profile), + * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences), + * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences). + */ + scope?: string; + } + + interface ChromeSettingGetDetails { + /** Optional. Whether to return the value that applies to the incognito session (default false). */ + incognito?: boolean; + } + + /** + * @param details Details of the currently effective value. + */ + type DetailsCallback = (details: ChromeSettingGetResultDetails) => void; + + interface ChromeSettingGetResultDetails { + /** + * One of + * • not_controllable: cannot be controlled by any extension + * • controlled_by_other_extensions: controlled by extensions with higher precedence + * • controllable_by_this_extension: can be controlled by this extension + * • controlled_by_this_extension: controlled by this extension + */ + levelOfControl: string; + /** The value of the setting. */ + value: any; + /** + * Optional. + * Whether the effective value is specific to the incognito session. + * This property will only be present if the incognito property in the details parameter of get() was true. + */ + incognitoSpecific?: boolean; + } + + interface ChromeSettingChangedEvent extends chrome.events.Event { + addListener(callback: DetailsCallback): void; + } + + /** An interface that allows access to a Chrome browser setting. See accessibilityFeatures for an example. */ + interface ChromeSetting { + /** + * Sets the value of a setting. + * @param details Which setting to change. + * @param callback Optional. Called at the completion of the set operation. + */ + set(details: ChromeSettingSetDetails, callback?: Function): void; + /** + * Gets the value of a setting. + * @param details Which setting to consider. + */ + get(details: ChromeSettingGetDetails, callback?: DetailsCallback): void; + /** + * Clears the setting, restoring any default value. + * @param details Which setting to clear. + * @param callback Optional. Called at the completion of the clear operation. + */ + clear(details: ChromeSettingClearDetails, callback?: Function): void; + /** Fired after the setting changes. */ + onChange: ChromeSettingChangedEvent; + } +} + +//////////////////// +// VPN Provider +//////////////////// +/** + * Use the chrome.vpnProvider API to implement a VPN client. + * Permissions: "vpnProvider" + * Important: This API works only on Chrome OS. + * @since Chrome 43. + */ +declare module chrome.vpnProvider { + interface VpnSessionParameters { + /** IP address for the VPN interface in CIDR notation. IPv4 is currently the only supported mode. */ + address: string; + /** Optional. Broadcast address for the VPN interface. (default: deduced from IP address and mask) */ + broadcastAddress?: string; + /** Optional. MTU setting for the VPN interface. (default: 1500 bytes) */ + mtu?: string; + /** + * Exclude network traffic to the list of IP blocks in CIDR notation from the tunnel. This can be used to bypass traffic to and from the VPN server. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. + */ + exclusionList: string[]; + /** + * Include network traffic to the list of IP blocks in CIDR notation to the tunnel. This parameter can be used to set up a split tunnel. By default no traffic is directed to the tunnel. Adding the entry "0.0.0.0/0" to this list gets all the user traffic redirected to the tunnel. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. + */ + inclusionList: string[]; + /** Optional. A list of search domains. (default: no search domain) */ + domainSearch?: string[]; + /** A list of IPs for the DNS servers. */ + dnsServer: string[]; + } + + interface VpnPlatformMessageEvent extends chrome.events.Event { + /** + * @param callback + * Parameter id: ID of the configuration the message is intended for. + * Parameter message: The message received from the platform. + * * connected: VPN configuration connected. + * * disconnected: VPN configuration disconnected. + * * error: An error occurred in VPN connection, for example a timeout. A description of the error is give as the error argument to onPlatformMessage. + * Parameter error: Error message when there is an error. + */ + addListener(callback: (id: string, message: string, error: string) => void): void; + } + + interface VpnPacketReceptionEvent extends chrome.events.Event { + /** + * @param callback + * Parameter data: The IP packet received from the platform. + */ + addListener(callback: (data: ArrayBuffer) => void): void; + } + + interface VpnConfigRemovalEvent extends chrome.events.Event { + /** + * @param callback + * Parameter id: ID of the removed configuration. + */ + addListener(callback: (id: string) => void): void; + } + + interface VpnConfigCreationEvent extends chrome.events.Event { + /** + * @param callback + * Parameter id: ID of the configuration created. + * Parameter name: Name of the configuration created. + * Parameter data: Configuration data provided by the administrator. + */ + addListener(callback: (id: string, name: string, data: Object) => void): void; + } + + interface VpnUiEvent extends chrome.events.Event { + /** + * @param callback + * Parameter event: The UI event that is triggered. + * * showAddDialog: Request the VPN client to show add configuration dialog to the user. + * * showConfigureDialog: Request the VPN client to show configuration settings dialog to the user. + * Optional parameter id: ID of the configuration for which the UI event was triggered. + */ + addListener(callback: (event: string, id?: string) => void): void; + } + + /** + * Creates a new VPN configuration that persists across multiple login sessions of the user. + * @param name The name of the VPN configuration. + * @param callback Called when the configuration is created or if there is an error. + * Parameter id: A unique ID for the created configuration, empty string on failure. + */ + export function createConfig(name: string, callback: (id: string) => void): void; + /** + * Destroys a VPN configuration created by the extension. + * @param id ID of the VPN configuration to destroy. + * @param callback Optional. Called when the configuration is destroyed or if there is an error. + */ + export function destroyConfig(id: string, callback?: Function): void; + /** + * Sets the parameters for the VPN session. This should be called immediately after "connected" is received from the platform. This will succeed only when the VPN session is owned by the extension. + * @param parameters The parameters for the VPN session. + * @param callback Called when the parameters are set or if there is an error. + */ + export function setParameters(parameters: VpnSessionParameters, callback: Function): void; + /** + * Sends an IP packet through the tunnel created for the VPN session. This will succeed only when the VPN session is owned by the extension. + * @param data The IP packet to be sent to the platform. + * @param callback Optional. Called when the packet is sent or if there is an error. + */ + export function sendPacket(data: ArrayBuffer, callback?: Function): void; + /** + * Notifies the VPN session state to the platform. This will succeed only when the VPN session is owned by the extension. + * @param state The VPN session state of the VPN client. + * connected: VPN connection was successful. + * failure: VPN connection failed. + * @param callback Optional. Called when the notification is complete or if there is an error. + */ + export function notifyConnectionStateChanged(state: string, callback?: Function): void; + + /** Triggered when a message is received from the platform for a VPN configuration owned by the extension. */ + var onPlatformMessage: VpnPlatformMessageEvent; + /** Triggered when an IP packet is received via the tunnel for the VPN session owned by the extension. */ + var onPacketReceived: VpnPacketReceptionEvent; + /** Triggered when a configuration created by the extension is removed by the platform. */ + var onConfigRemoved: VpnConfigRemovalEvent; + /** Triggered when a configuration is created by the platform for the extension. */ + var onConfigCreated: VpnConfigCreationEvent; + /** Triggered when there is a UI event for the extension. UI events are signals from the platform that indicate to the app that a UI dialog needs to be shown to the user. */ + var onUIEvent: VpnUiEvent; +} + +//////////////////// +// Wallpaper +//////////////////// +/** + * Use the chrome.wallpaper API to change the ChromeOS wallpaper. + * Permissions: "wallpaper" + * Important: This API works only on Chrome OS. + * @since Chrome 43. + */ +declare module chrome.wallpaper { + interface WallpaperDetails { + /** Optional. The jpeg or png encoded wallpaper image. */ + data?: any; + /** Optional. The URL of the wallpaper to be set. */ + url?: string; + /** + * The supported wallpaper layouts. + * One of: "STRETCH", "CENTER", or "CENTER_CROPPED" + */ + layout: string; + /** The file name of the saved wallpaper. */ + filename: string; + /** Optional. True if a 128x60 thumbnail should be generated. */ + thumbnail?: boolean; + } + + /** + * Sets wallpaper to the image at url or wallpaperData with the specified layout + * @param callback + * Optional parameter thumbnail: The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60. + */ + export function setWallpaper(details: WallpaperDetails, callback: (thumbnail: any) => void): void; +} + +//////////////////// +// Web Navigation +//////////////////// +/** + * Use the chrome.webNavigation API to receive notifications about the status of navigation requests in-flight. + * Permissions: "webNavigation" + * @since Chrome 16. + */ +declare module chrome.webNavigation { + interface GetFrameDetails { + /** + * The ID of the process runs the renderer for this tab. + * @since Chrome 22. + */ + processId: number; + /** The ID of the tab in which the frame is. */ + tabId: number; + /** The ID of the frame in the given tab. */ + frameId: number; + } + + interface GetFrameResultDetails { + /** The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists. */ + url: string; + /** True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. */ + errorOccurred: boolean; + /** ID of frame that wraps the frame. Set to -1 of no parent frame exists. */ + parentFrameId: number; + } + + interface GetAllFrameDetails { + /** The ID of the tab. */ + tabId: number; + } + + interface GetAllFrameResultDetails extends GetFrameResultDetails { + /** The ID of the process runs the renderer for this tab. */ + processId: number; + /** The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe. */ + frameId: number; + } + + interface WebNavigationCallbackDetails { + /** The ID of the tab in which the navigation is about to occur. */ + tabId: number; + /** The time when the browser was about to start the navigation, in milliseconds since the epoch. */ + timeStamp: number; + } + + interface WebNavigationUrlCallbackDetails extends WebNavigationCallbackDetails { + url: string; + } + + interface WebNavigationReplacementCallbackDetails extends WebNavigationCallbackDetails { + /** The ID of the tab that was replaced. */ + replacedTabId: number; + } + + interface WebNavigationFramedCallbackDetails extends WebNavigationUrlCallbackDetails { + /** 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process. */ + frameId: number; + /** + * The ID of the process runs the renderer for this tab. + * @since Chrome 22. + */ + processId: number; + } + + interface WebNavigationFramedErrorCallbackDetails extends WebNavigationFramedCallbackDetails { + /** The error description. */ + error: string; + } + + interface WebNavigationSourceCallbackDetails extends WebNavigationUrlCallbackDetails { + /** The ID of the tab in which the navigation is triggered. */ + sourceTabId: number; + /** + * The ID of the process runs the renderer for the source tab. + * @since Chrome 22. + */ + sourceProcessId: number; + /** The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame. */ + sourceFrameId: number; + } + + interface WebNavigationParentedCallbackDetails extends WebNavigationFramedCallbackDetails { + /** + * ID of frame that wraps the frame. Set to -1 of no parent frame exists. + * @since Chrome 24. + */ + parentFrameId: number; + } + + interface WebNavigationTransitionCallbackDetails extends WebNavigationFramedCallbackDetails { + /** + * Cause of the navigation. + * One of: "link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", or "keyword_generated" + */ + transitionType: string; + /** + * A list of transition qualifiers. + * Each element one of: "client_redirect", "server_redirect", "forward_back", or "from_address_bar" + */ + transitionQualifiers: string[]; + } + + interface WebNavigationEventFilter { + /** Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event. */ + url: chrome.events.UrlFilter[]; + } + + interface WebNavigationEvent extends chrome.events.Event { + addListener(callback: (details: WebNavigationCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + } + + interface WebNavigationFramedEvent extends WebNavigationEvent { + addListener(callback: (details: WebNavigationFramedCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + } + + interface WebNavigationFramedErrorEvent extends WebNavigationFramedEvent { + addListener(callback: (details: WebNavigationFramedErrorCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + } + + interface WebNavigationSourceEvent extends WebNavigationEvent { + addListener(callback: (details: WebNavigationSourceCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + } + + interface WebNavigationParentedEvent extends WebNavigationEvent { + addListener(callback: (details: WebNavigationParentedCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + } + + interface WebNavigationTransitionalEvent extends WebNavigationEvent { + addListener(callback: (details: WebNavigationTransitionCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + } + + interface WebNavigationReplacementEvent extends WebNavigationEvent { + addListener(callback: (details: WebNavigationReplacementCallbackDetails, filters?: WebNavigationEventFilter) => void): void; + } + + /** + * Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID. + * @param details Information about the frame to retrieve information about. + * @param callback + * Optional parameter details: Information about the requested frame, null if the specified frame ID and/or tab ID are invalid. + */ + export function getFrame(details: GetFrameDetails, callback: (details?: GetFrameResultDetails) => void): void; + /** + * Retrieves information about all frames of a given tab. + * @param details Information about the tab to retrieve all frames from. + * @param callback + * Optional parameter details: A list of frames in the given tab, null if the specified tab ID is invalid. + */ + export function getAllFrames(details: GetAllFrameDetails, callback: (details?: GetAllFrameResultDetails[]) => void): void; + + /** Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL. */ + var onReferenceFragmentUpdated: WebNavigationTransitionalEvent; + /** Fired when a document, including the resources it refers to, is completely loaded and initialized. */ + var onCompleted: WebNavigationFramedEvent; + /** + * Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL. + * @since Chrome 22. + */ + var onHistoryStateUpdated: WebNavigationTransitionalEvent; + /** Fired when a new window, or a new tab in an existing window, is created to host a navigation. */ + var onCreatedNavigationTarget: WebNavigationSourceEvent; + /** + * Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab. + * @since Chrome 22. + */ + var onTabReplaced: WebNavigationReplacementEvent; + /** Fired when a navigation is about to occur. */ + var onBeforeNavigate: WebNavigationParentedEvent; + /** Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) might still be downloading, but at least part of the document has been received from the server and the browser has decided to switch to the new document. */ + var onCommitted: WebNavigationTransitionalEvent; + /** Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading. */ + var onDOMContentLoaded: WebNavigationFramedEvent; + /** Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation. */ + var onErrorOccurred: WebNavigationFramedErrorEvent; +} + +//////////////////// +// Web Request +//////////////////// +/** + * Use the chrome.webRequest API to observe and analyze traffic and to intercept, block, or modify requests in-flight. + * Permissions: "webRequest", host permissions + * @since Chrome 17. + */ +declare module chrome.webRequest { + interface AuthCredentials { + username: string; + password: string; + } + + /** An HTTP Header, represented as an object containing a key and either a value or a binaryValue. */ + interface HttpHeader { + name: string; + value?: string; + binaryValue?: ArrayBuffer; + } + + /** Returns value for event handlers that have the 'blocking' extraInfoSpec applied. Allows the event handler to modify network requests. */ + interface BlockingResponse { + /** Optional. If true, the request is cancelled. Used in onBeforeRequest, this prevents the request from being sent. */ + cancel?: boolean; + /** + * Optional. + * Only used as a response to the onBeforeRequest and onHeadersReceived events. If set, the original request is prevented from being sent/completed and is instead redirected to the given URL. Redirections to non-HTTP schemes such as data: are allowed. Redirects initiated by a redirect action use the original request method for the redirect, with one exception: If the redirect is initiated at the onHeadersReceived stage, then the redirect will be issued using the GET method. + */ + redirectUrl?: string; + /** + * Optional. + * Only used as a response to the onHeadersReceived event. If set, the server is assumed to have responded with these response headers instead. Only return responseHeaders if you really want to modify the headers in order to limit the number of conflicts (only one extension may modify responseHeaders for each request). + */ + responseHeaders?: HttpHeader[]; + /** Optional. Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials. */ + authCredentials?: AuthCredentials; + /** + * Optional. + * Only used as a response to the onBeforeSendHeaders event. If set, the request is made with these request headers instead. + */ + requestHeaders?: HttpHeader[]; + } + + /** An object describing filters to apply to webRequest events. */ + interface RequestFilter { + /** Optional. */ + tabId?: number; + /** + * A list of request types. Requests that cannot match any of the types will be filtered out. + * Each element one of: "main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", or "other" + */ + types?: string[]; + /** A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out. */ + urls: string[]; + /** Optional. */ + windowId?: number; + } + + /** + * Contains data uploaded in a URL request. + * @since Chrome 23. + */ + interface UploadData { + /** Optional. An ArrayBuffer with a copy of the data. */ + bytes?: ArrayBuffer; + /** Optional. A string with the file's path and name. */ + file?: string; + } + + interface WebRequestBody { + /** Optional. Errors when obtaining request body data. */ + error?: string; + /** + * Optional. + * If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': ['value1', 'value2']}. + */ + formData?: Object; + /** + * Optional. + * If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array. + */ + raw?: UploadData[]; + } + + interface WebAuthChallenger { + host: string; + port: number; + } + + interface ResourceRequest { + /** The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request. */ + requestId: string; + /** The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab. */ + frameId: number; + /** ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists. */ + parentFrameId: number; + /** The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab. */ + tabId: number; + /** + * How the requested resource will be used. + * One of: "main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", or "other" + */ + type: string; + /** The time when this signal is triggered, in milliseconds since the epoch. */ + timeStamp: number; + } + + interface WebRequestDetails extends ResourceRequest { + url: string; + /** Standard HTTP method. */ + method: string; + } + + interface WebRequestHeadersDetails extends WebRequestDetails { + /** Optional. The HTTP request headers that are going to be sent out with this request. */ + requestHeaders?: HttpHeader[]; + } + + interface WebRequestBodyDetails extends WebRequestDetails { + /** + * Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'. + * @since Chrome 23. + */ + requestBody: WebRequestBody; + } + + interface WebRequestFullDetails extends WebRequestHeadersDetails, WebRequestBodyDetails { + } + + interface WebResponseDetails extends ResourceRequest { + /** HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line). */ + statusLine: string; + /** + * Standard HTTP status code returned by the server. + * @since Chrome 43. + */ + statusCode: number; + } + + interface WebResponseHeadersDetails extends WebResponseDetails { + /** Optional. The HTTP response headers that have been received with this response. */ + responseHeaders?: HttpHeader[]; + } + + interface WebResponseCacheDetails extends WebResponseHeadersDetails { + /** + * Optional. + * The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address. + */ + ip?: string; + /** Indicates if this response was fetched from disk cache. */ + fromCache: boolean; + } + + interface WebRedirectionResponseDetails extends WebResponseCacheDetails { + /** The new URL. */ + redirectUrl: string; + } + + interface WebAuthenticationChallengeDetails extends WebResponseHeadersDetails { + /** The authentication scheme, e.g. Basic or Digest. */ + schema: string; + /** The authentication realm provided by the server, if there is one. */ + realm?: string; + /** The server requesting authentication. */ + challenger: WebAuthChallenger; + /** True for Proxy-Authenticate, false for WWW-Authenticate. */ + isProxy: boolean; + } + + interface WebResponseErrorDetails extends WebResponseCacheDetails { + /** The error description. This string is not guaranteed to remain backwards compatible between releases. You must not parse and act based upon its content. */ + error: string; + } + + interface WebRequestBodyEvent extends chrome.events.Event { + addListener(callback: (details: WebRequestBodyDetails) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void; + } + + interface WebRequestHeadersEvent extends chrome.events.Event { + addListener(callback: (details: WebRequestHeadersDetails) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void; + } + + interface WebResponseHeadersEvent extends chrome.events.Event { + addListener(callback: (details: WebResponseHeadersDetails) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void; + } + + interface WebResponseCacheEvent extends WebResponseHeadersEvent { + addListener(callback: (details: WebResponseCacheDetails) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void; + } + + interface WebRedirectionResponseEvent extends WebResponseCacheEvent { + addListener(callback: (details: WebRedirectionResponseDetails) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void; + } + + interface WebAuthenticationChallengeEvent extends chrome.events.Event { + addListener(callback: (details: WebAuthenticationChallengeDetails, callback?: (response: BlockingResponse) => void) => void): void; + } + + interface WebResponseErrorEvent extends WebResponseCacheEvent { + addListener(callback: (details: WebResponseErrorDetails) => void, filter?: RequestFilter, opt_extraInfoSpec?: string[]): void; + } + + /** + * The maximum number of times that handlerBehaviorChanged can be called per 10 minute sustained interval. handlerBehaviorChanged is an expensive function call that shouldn't be called often. + * @since Chrome 23. + */ + var MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES: number; + + /** Needs to be called when the behavior of the webRequest handlers has changed to prevent incorrect handling due to caching. This function call is expensive. Don't call it often. */ + export function handlerBehaviorChanged(callback?: Function): void; + + /** Fired when a request is about to occur. */ + var onBeforeRequest: WebRequestBodyEvent; + /** Fired before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is made to the server, but before any HTTP data is sent. */ + var onBeforeSendHeaders: WebRequestHeadersEvent; + /** Fired just before a request is going to be sent to the server (modifications of previous onBeforeSendHeaders callbacks are visible by the time onSendHeaders is fired). */ + var onSendHeaders: WebRequestHeadersEvent; + /** Fired when HTTP response headers of a request have been received. */ + var onHeadersReceived: WebResponseHeadersEvent; + /** Fired when an authentication failure is received. The listener has three options: it can provide authentication credentials, it can cancel the request and display the error page, or it can take no action on the challenge. If bad user credentials are provided, this may be called multiple times for the same request. */ + var onAuthRequired: WebAuthenticationChallengeEvent; + /** Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available. */ + var onResponseStarted: WebResponseCacheEvent; + /** Fired when a server-initiated redirect is about to occur. */ + var onBeforeRedirect: WebRedirectionResponseEvent; + /** Fired when a request is completed. */ + var onCompleted: WebResponseCacheEvent; + /** Fired when an error occurs. */ + var onErrorOccurred: WebResponseErrorEvent; +} + +//////////////////// +// Web Store +//////////////////// +/** + * Use the chrome.webstore API to initiate app and extension installations "inline" from your site. + * @since Chrome 15. + */ +declare module chrome.webstore { + /** + * @param url Optional. If you have more than one <link> tag on your page with the chrome-webstore-item relation, you can choose which item you'd like to install by passing in its URL here. If it is omitted, then the first (or only) link will be used. An exception will be thrown if the passed in URL does not exist on the page. + * @param successCallback Optional. This function is invoked when inline installation successfully completes (after the dialog is shown and the user agrees to add the item to Chrome). You may wish to use this to hide the user interface element that prompted the user to install the app or extension. + * @param failureCallback Optional. This function is invoked when inline installation does not successfully complete. Possible reasons for this include the user canceling the dialog, the linked item not being found in the store, or the install being initiated from a non-verified site. + * Parameter error: The failure detail. You may wish to inspect or log this for debugging purposes, but you should not rely on specific strings being passed back. + * Optional parameter errorCode: The error code from the stable set of possible errors. + * * Enum of the possible install results, including error codes sent back in the event that an inline installation has failed. + * * * "otherError": An uncommon, unrecognized, or unexpected error. In some cases, the readable error string can provide more information. + * * * "aborted": The operation was aborted as the requestor is no longer alive. + * * * "installInProgress": An installation of the same extension is in progress. + * * * "notPermitted": The installation is not permitted. + * * * "invalidId": Invalid Chrome Web Store item ID. + * * * "webstoreRequestError": Failed to retrieve extension metadata from the Web Store. + * * * "invalidWebstoreResponse": The extension metadata retrieved from the Web Store was invalid. + * * * "invalidManifest": An error occurred while parsing the extension manifest retrieved from the Web Store. + * * * "iconError": Failed to retrieve the extension's icon from the Web Store, or the icon was invalid. + * * * "userCanceled": The user canceled the operation. + * * * "blacklisted": The extension is blacklisted. + * * * "missingDependencies": Unsatisfied dependencies, such as shared modules. + * * * "requirementViolations": Unsatisfied requirements, such as webgl. + * * * "blockedByPolicy": The extension is blocked by management policies. + * * * "launchFeatureDisabled": The launch feature is not available. + * * * "launchUnsupportedExtensionType": The launch feature is not supported for the extension type. + * * * "launchInProgress": A launch of the same extension is in progress. + */ + export function install(url: string, successCallback?: Function, failureCallback?: (error: string, errorCode?: string) => void): void; + /** + * @param successCallback Optional. This function is invoked when inline installation successfully completes (after the dialog is shown and the user agrees to add the item to Chrome). You may wish to use this to hide the user interface element that prompted the user to install the app or extension. + * @param failureCallback Optional. This function is invoked when inline installation does not successfully complete. Possible reasons for this include the user canceling the dialog, the linked item not being found in the store, or the install being initiated from a non-verified site. + * Parameter error: The failure detail. You may wish to inspect or log this for debugging purposes, but you should not rely on specific strings being passed back. + * Optional parameter errorCode: The error code from the stable set of possible errors. + * * Enum of the possible install results, including error codes sent back in the event that an inline installation has failed. + * * * "otherError": An uncommon, unrecognized, or unexpected error. In some cases, the readable error string can provide more information. + * * * "aborted": The operation was aborted as the requestor is no longer alive. + * * * "installInProgress": An installation of the same extension is in progress. + * * * "notPermitted": The installation is not permitted. + * * * "invalidId": Invalid Chrome Web Store item ID. + * * * "webstoreRequestError": Failed to retrieve extension metadata from the Web Store. + * * * "invalidWebstoreResponse": The extension metadata retrieved from the Web Store was invalid. + * * * "invalidManifest": An error occurred while parsing the extension manifest retrieved from the Web Store. + * * * "iconError": Failed to retrieve the extension's icon from the Web Store, or the icon was invalid. + * * * "userCanceled": The user canceled the operation. + * * * "blacklisted": The extension is blacklisted. + * * * "missingDependencies": Unsatisfied dependencies, such as shared modules. + * * * "requirementViolations": Unsatisfied requirements, such as webgl. + * * * "blockedByPolicy": The extension is blocked by management policies. + * * * "launchFeatureDisabled": The launch feature is not available. + * * * "launchUnsupportedExtensionType": The launch feature is not supported for the extension type. + * * * "launchInProgress": A launch of the same extension is in progress. + */ + export function install(successCallback: Function, failureCallback?: (error: string, errorCode?: string) => void): void; + /** + * @param failureCallback Optional. This function is invoked when inline installation does not successfully complete. Possible reasons for this include the user canceling the dialog, the linked item not being found in the store, or the install being initiated from a non-verified site. + * Parameter error: The failure detail. You may wish to inspect or log this for debugging purposes, but you should not rely on specific strings being passed back. + * Optional parameter errorCode: The error code from the stable set of possible errors. + * * Enum of the possible install results, including error codes sent back in the event that an inline installation has failed. + * * * "otherError": An uncommon, unrecognized, or unexpected error. In some cases, the readable error string can provide more information. + * * * "aborted": The operation was aborted as the requestor is no longer alive. + * * * "installInProgress": An installation of the same extension is in progress. + * * * "notPermitted": The installation is not permitted. + * * * "invalidId": Invalid Chrome Web Store item ID. + * * * "webstoreRequestError": Failed to retrieve extension metadata from the Web Store. + * * * "invalidWebstoreResponse": The extension metadata retrieved from the Web Store was invalid. + * * * "invalidManifest": An error occurred while parsing the extension manifest retrieved from the Web Store. + * * * "iconError": Failed to retrieve the extension's icon from the Web Store, or the icon was invalid. + * * * "userCanceled": The user canceled the operation. + * * * "blacklisted": The extension is blacklisted. + * * * "missingDependencies": Unsatisfied dependencies, such as shared modules. + * * * "requirementViolations": Unsatisfied requirements, such as webgl. + * * * "blockedByPolicy": The extension is blocked by management policies. + * * * "launchFeatureDisabled": The launch feature is not available. + * * * "launchUnsupportedExtensionType": The launch feature is not supported for the extension type. + * * * "launchInProgress": A launch of the same extension is in progress. + */ + export function install(failureCallback?: (error: string, errorCode?: string) => void): void; + + interface InstallationStageEvent extends chrome.events.Event { + /** + * @param callback + * Parameter stage: The InstallStage that just began. + * * One of: "installing", or "downloading" + */ + addListener(callback: (stage: string) => void): void; + } + + interface DownloadProgressEvent extends chrome.events.Event { + /** + * @param callback + * Parameter percentDownloaded: The progress of the download, between 0 and 1. 0 indicates no progress; 1.0 indicates complete. + */ + addListener(callback: (percentDownloaded: number) => void): void; + } + + /** + * Fired when an inline installation enters a new InstallStage. In order to receive notifications about this event, listeners must be registered before the inline installation begins. + * @since Chrome 35. + */ + var onInstallStageChanged: InstallationStageEvent; + /** + * Fired periodically with the download progress of an inline install. In order to receive notifications about this event, listeners must be registered before the inline installation begins. + * @since Chrome 35. + */ + var onDownloadProgress: DownloadProgressEvent; +} + +//////////////////// +// Windows +//////////////////// +/** + * Use the chrome.windows API to interact with browser windows. You can use this API to create, modify, and rearrange windows in the browser. + * Permissions: The chrome.windows API can be used without declaring any permission. However, the "tabs" permission is required in order to populate the url, title, and favIconUrl properties of Tab objects. + * @since Chrome 5. + */ +declare module chrome.windows { + interface Window { + /** Array of tabs.Tab objects representing the current tabs in the window. */ + tabs?: chrome.tabs.Tab[]; + /** Optional. The offset of the window from the top edge of the screen in pixels. Under some circumstances a Window may not be assigned top property, for example when querying closed windows from the sessions API. */ + top?: number; + /** Optional. The height of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned height property, for example when querying closed windows from the sessions API. */ + height?: number; + /** Optional. The width of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned width property, for example when querying closed windows from the sessions API. */ + width?: number; + /** + * The state of this browser window. + * One of: "normal", "minimized", "maximized", "fullscreen", or "docked" + * @since Chrome 17. + */ + state: string; + /** Whether the window is currently the focused window. */ + focused: boolean; + /** + * Whether the window is set to be always on top. + * @since Chrome 19. + */ + alwaysOnTop: boolean; + /** Whether the window is incognito. */ + incognito: boolean; + /** + * The type of browser window this is. + * One of: "normal", "popup", "panel", "app", or "devtools" + */ + type: string; + /** Optional. The ID of the window. Window IDs are unique within a browser session. Under some circumstances a Window may not be assigned an ID, for example when querying windows using the sessions API, in which case a session ID may be present. */ + id: number; + /** Optional. The offset of the window from the left edge of the screen in pixels. Under some circumstances a Window may not be assigned left property, for example when querying closed windows from the sessions API. */ + left?: number; + /** + * The session ID used to uniquely identify a Window obtained from the sessions API. + * @since Chrome 31. + */ + sessionId?: string; + } + + interface GetInfo { + /** + * Optional. + * If true, the windows.Window object will have a tabs property that contains a list of the tabs.Tab objects. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the "tabs" permission. + */ + populate?: boolean; + /** + * If set, the windows.Window returned will be filtered based on its type. If unset the default filter is set to ['app', 'normal', 'panel', 'popup'], with 'app' and 'panel' window types limited to the extension's own windows. + * Each one of: "normal", "popup", "panel", "app", or "devtools" + * @since Chrome 46. Warning: this is the current Beta channel. + */ + windowTypes?: string[]; + } + + interface CreateData { + /** + * Optional. The id of the tab for which you want to adopt to the new window. + * @since Chrome 10. + */ + tabId?: number; + /** + * Optional. + * A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page. + */ + url?: string | string[]; + /** + * Optional. + * The number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels. + */ + top?: number; + /** + * Optional. + * The height in pixels of the new window, including the frame. If not specified defaults to a natural height. + */ + height?: number; + /** + * Optional. + * The width in pixels of the new window, including the frame. If not specified defaults to a natural width. + */ + width?: number; + /** + * Optional. If true, opens an active window. If false, opens an inactive window. + * @since Chrome 12. + */ + focused?: boolean; + /** Optional. Whether the new window should be an incognito window. */ + incognito?: boolean; + /** + * Optional. Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set. + * One of: "normal", "popup", "panel", or "detached_panel" + */ + type?: string; + /** + * Optional. + * The number of pixels to position the new window from the left edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels. + */ + left?: number; + /** + * Optional. The initial state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. + * One of: "normal", "minimized", "maximized", "fullscreen", or "docked" + * @since Chrome 44. + */ + state?: string; + } + + interface UpdateInfo { + /** Optional. The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels. */ + top?: number; + /** + * Optional. If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request. + * @since Chrome 14. + */ + drawAttention?: boolean; + /** Optional. The height to resize the window to in pixels. This value is ignored for panels. */ + height?: number; + /** Optional. The width to resize the window to in pixels. This value is ignored for panels. */ + width?: number; + /** + * Optional. The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. + * One of: "normal", "minimized", "maximized", "fullscreen", or "docked" + * @since Chrome 17. + */ + state?: string; + /** + * Optional. If true, brings the window to the front. If false, brings the next window in the z-order to the front. + * @since Chrome 8. + */ + focused?: boolean; + /** Optional. The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels. */ + left?: number; + } + + interface WindowEventFilter { + /** + * Conditions that the window's type being created must satisfy. By default it will satisfy ['app', 'normal', 'panel', 'popup'], with 'app' and 'panel' window types limited to the extension's own windows. + * Each one of: "normal", "popup", "panel", "app", or "devtools" + */ + windowTypes: string[]; + } + + interface WindowIdEvent extends chrome.events.Event { + /** + * @param callback + * Parameter windowId: The id of the window associated with this event. + */ + addListener(callback: (windowId: number, filters?: WindowEventFilter) => void): void; + } + + interface WindowReferenceEvent extends chrome.events.Event { + /** + * @param callback + * Parameter window: The window object associated with this event. + */ + addListener(callback: (window: Window, filters?: WindowEventFilter) => void): void; + } + + /** + * The windowId value that represents the current window. + * @since Chrome 18. + */ + var WINDOW_ID_CURRENT: number; + /** + * The windowId value that represents the absence of a chrome browser window. + * @since Chrome 6. + */ + var WINDOW_ID_NONE: number; + + /** Gets details about a window. */ + export function get(windowId: number, callback: (window: chrome.windows.Window) => void): void; + /** + * Gets details about a window. + * @since Chrome 18. + */ + export function get(windowId: number, getInfo: GetInfo, callback: (window: chrome.windows.Window) => void): void; + /** + * Gets the current window. + */ + export function getCurrent(callback: (window: chrome.windows.Window) => void): void; + /** + * Gets the current window. + * @since Chrome 18. + */ + export function getCurrent(getInfo: GetInfo, callback: (window: chrome.windows.Window) => void): void; + /** + * Creates (opens) a new browser with any optional sizing, position or default URL provided. + * @param callback + * Optional parameter window: Contains details about the created window. + */ + export function create(callback?: (window?: chrome.windows.Window) => void): void; + /** + * Creates (opens) a new browser with any optional sizing, position or default URL provided. + * @param callback + * Optional parameter window: Contains details about the created window. + */ + export function create(createData: CreateData, callback?: (window?: chrome.windows.Window) => void): void; + /** + * Gets all windows. + */ + export function getAll(callback: (windows: chrome.windows.Window[]) => void): void; + /** + * Gets all windows. + * @since Chrome 18. + */ + export function getAll(getInfo: GetInfo, callback: (windows: chrome.windows.Window[]) => void): void; + /** Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged. */ + export function update(windowId: number, updateInfo: UpdateInfo, callback?: (window: chrome.windows.Window) => void): void; + /** Removes (closes) a window, and all the tabs inside it. */ + export function remove(windowId: number, callback?: Function): void; + /** + * Gets the window that was most recently focused — typically the window 'on top'. + */ + export function getLastFocused(callback: (window: chrome.windows.Window) => void): void; + /** + * Gets the window that was most recently focused — typically the window 'on top'. + * @since Chrome 18. + */ + export function getLastFocused(getInfo: GetInfo, callback: (window: chrome.windows.Window) => void): void; + + /** Fired when a window is removed (closed). */ + var onRemoved: WindowIdEvent; + /** Fired when a window is created. */ + var onCreated: WindowReferenceEvent; + /** + * Fired when the currently focused window changes. Will be chrome.windows.WINDOW_ID_NONE if all chrome windows have lost focus. + * Note: On some Linux window managers, WINDOW_ID_NONE will always be sent immediately preceding a switch from one chrome window to another. + */ + var onFocusChanged: WindowIdEvent; +} diff --git a/lib/decl/filesystem/filesystem.d.ts b/lib/decl/filesystem/filesystem.d.ts new file mode 100644 index 000000000..1b76846b4 --- /dev/null +++ b/lib/decl/filesystem/filesystem.d.ts @@ -0,0 +1,548 @@ +// Type definitions for File System API +// Project: http://www.w3.org/TR/file-system-api/ +// Definitions by: Kon <http://phyzkit.net/> +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// <reference path="../filewriter/filewriter.d.ts" /> + +interface LocalFileSystem { + + /** + * Used for storage with no guarantee of persistence. + */ + TEMPORARY:number; + + /** + * Used for storage that should not be removed by the user agent without application or user permission. + */ + PERSISTENT:number; + + /** + * Requests a filesystem in which to store application data. + * @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT. + * @param size This is an indicator of how much storage space, in bytes, the application expects to need. + * @param successCallback The callback that is called when the user agent provides a filesystem. + * @param errorCallback A callback that is called when errors happen, or when the request to obtain the filesystem is denied. + */ + requestFileSystem(type:number, size:number, successCallback:FileSystemCallback, errorCallback?:ErrorCallback):void; + + /** + * Allows the user to look up the Entry for a file or directory referred to by a local URL. + * @param url A URL referring to a local file in a filesystem accessable via this API. + * @param successCallback A callback that is called to report the Entry to which the supplied URL refers. + * @param errorCallback A callback that is called when errors happen, or when the request to obtain the Entry is denied. + */ + resolveLocalFileSystemURL(url:string, successCallback:EntryCallback, errorCallback?:ErrorCallback):void; + + /** + * see requestFileSystem. + */ + webkitRequestFileSystem(type:number, size:number, successCallback:FileSystemCallback, errorCallback?:ErrorCallback):void; +} + +interface LocalFileSystemSync { + /** + * Used for storage with no guarantee of persistence. + */ + TEMPORARY:number; + + /** + * Used for storage that should not be removed by the user agent without application or user permission. + */ + PERSISTENT:number; + + /** + * Requests a filesystem in which to store application data. + * @param type Whether the filesystem requested should be persistent, as defined above. Use one of TEMPORARY or PERSISTENT. + * @param size This is an indicator of how much storage space, in bytes, the application expects to need. + */ + requestFileSystemSync(type:number, size:number):FileSystemSync; + + /** + * Allows the user to look up the Entry for a file or directory referred to by a local URL. + * @param url A URL referring to a local file in a filesystem accessable via this API. + */ + resolveLocalFileSystemSyncURL(url:string):EntrySync; + + /** + * see requestFileSystemSync + */ + webkitRequestFileSystemSync(type:number, size:number):FileSystemSync; +} + +interface Metadata { + /** + * This is the time at which the file or directory was last modified. + * @readonly + */ + modificationTime:Date; + + /** + * The size of the file, in bytes. This must return 0 for directories. + * @readonly + */ + size:number; +} + +interface Flags { + /** + * Used to indicate that the user wants to create a file or directory if it was not previously there. + */ + create?:boolean; + + /** + * By itself, exclusive must have no effect. Used with create, it must cause getFile and getDirectory to fail if the target path already exists. + */ + exclusive?:boolean; +} + +/** + * This interface represents a file system. + */ +interface FileSystem{ + /** + * This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems. + * @readonly + */ + name: string; + + /** + * The root directory of the file system. + * @readonly + */ + root: DirectoryEntry; +} + +interface Entry { + + /** + * Entry is a file. + */ + isFile:boolean; + + /** + * Entry is a directory. + */ + isDirectory:boolean; + + /** + * Look up metadata about this entry. + * @param successCallback A callback that is called with the time of the last modification. + * @param errorCallback ErrorCallback A callback that is called when errors happen. + */ + getMetadata(successCallback:MetadataCallback, errorCallback?:ErrorCallback):void; + + /** + * The name of the entry, excluding the path leading to it. + */ + name:string; + + /** + * The full absolute path from the root to the entry. + */ + fullPath:string; + + /** + * The file system on which the entry resides. + */ + filesystem:FileSystem; + + /** + * Move an entry to a different location on the file system. It is an error to try to: + * + * <ui> + * <li>move a directory inside itself or to any child at any depth;</li> + * <li>move an entry into its parent if a name different from its current one isn't provided;</li> + * <li>move a file to a path occupied by a directory;</li> + * <li>move a directory to a path occupied by a file;</li> + * <li>move any element to a path occupied by a directory which is not empty.</li> + * <ul> + * + * A move of a file on top of an existing file must attempt to delete and replace that file. + * A move of a directory on top of an existing empty directory must attempt to delete and replace that directory. + */ + moveTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):string; + + /** + * Copy an entry to a different location on the file system. It is an error to try to: + * + * <ul> + * <li> copy a directory inside itself or to any child at any depth;</li> + * <li> copy an entry into its parent if a name different from its current one isn't provided;</li> + * <li> copy a file to a path occupied by a directory;</li> + * <li> copy a directory to a path occupied by a file;</li> + * <li> copy any element to a path occupied by a directory which is not empty.</li> + * <li> A copy of a file on top of an existing file must attempt to delete and replace that file.</li> + * <li> A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory.</li> + * </ul> + * + * Directory copies are always recursive--that is, they copy all contents of the directory. + */ + copyTo(parent:DirectoryEntry, newName?:string, successCallback?:EntryCallback, errorCallback?:ErrorCallback):string; + + /** + * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists. + */ + toURL():string; + + /** + * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem. + * @param successCallback A callback that is called on success. + * @param errorCallback A callback that is called when errors happen. + */ + remove(successCallback:VoidCallback, errorCallback?:ErrorCallback):void; + + /** + * Look up the parent DirectoryEntry containing this Entry. If this Entry is the root of its filesystem, its parent is itself. + * @param successCallback A callback that is called to return the parent Entry. + * @param errorCallback A callback that is called when errors happen. + */ + getParent(successCallback:DirectoryEntryCallback, errorCallback?:ErrorCallback):void; +} + +/** + * This interface represents a directory on a file system. + */ +interface DirectoryEntry extends Entry { + /** + * Creates a new DirectoryReader to read Entries from this Directory. + */ + createReader():DirectoryReader; + + /** + * Creates or looks up a file. + * @param path Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist. + * @param options + * <ul> + * <li>If create and exclusive are both true, and the path already exists, getFile must fail.</li> + * <li>If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li> + * <li>If create is not true and the path doesn't exist, getFile must fail.</li> + * <li>If create is not true and the path exists, but is a directory, getFile must fail.</li> + * <li>Otherwise, if no other error occurs, getFile must return a FileEntry corresponding to path.</li> + * </ul> + * @param successCallback A callback that is called to return the File selected or created. + * @param errorCallback A callback that is called when errors happen. + */ + getFile(path:string, options?:Flags, successCallback?:FileEntryCallback, errorCallback?:ErrorCallback):void; + + /** + * Creates or looks up a directory. + * @param path Either an absolute path or a relative path from this DirectoryEntry to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist. + * @param options + * <ul> + * <li>If create and exclusive are both true and the path already exists, getDirectory must fail.</li> + * <li>If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li> + * <li>If create is not true and the path doesn't exist, getDirectory must fail.</li> + * <li>If create is not true and the path exists, but is a file, getDirectory must fail.</li> + * <li>Otherwise, if no other error occurs, getDirectory must return a DirectoryEntry corresponding to path.</li> + * </ul> + * @param successCallback A callback that is called to return the DirectoryEntry selected or created. + * @param errorCallback A callback that is called when errors happen. + * + */ + getDirectory(path:string, options?:Flags, successCallback?:DirectoryEntryCallback, errorCallback?:ErrorCallback):void; + + /** + * Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem. + * @param successCallback A callback that is called on success. + * @param errorCallback A callback that is called when errors happen. + */ + removeRecursively(successCallback:VoidCallback, errorCallback?:ErrorCallback):void; +} + +/** + * This interface lets a user list files and directories in a directory. If there are no additions to or deletions from a directory between the first and last call to readEntries, and no errors occur, then: + * <ul> + * <li> A series of calls to readEntries must return each entry in the directory exactly once.</li> + * <li> Once all entries have been returned, the next call to readEntries must produce an empty array.</li> + * <li> If not all entries have been returned, the array produced by readEntries must not be empty.</li> + * <li> The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].</li> + * </ul> + */ +interface DirectoryReader { + /** + * Read the next block of entries from this directory. + * @param successCallback Called once per successful call to readEntries to deliver the next previously-unreported set of Entries in the associated Directory. If all Entries have already been returned from previous invocations of readEntries, successCallback must be called with a zero-length array as an argument. + * @param errorCallback A callback indicating that there was an error reading from the Directory. + */ + readEntries(successCallback:EntriesCallback, errorCallback?:ErrorCallback):void; +} + +/** + * This interface represents a file on a file system. + */ +interface FileEntry extends Entry { + /** + * Creates a new FileWriter associated with the file that this FileEntry represents. + * @param successCallback A callback that is called with the new FileWriter. + * @param errorCallback A callback that is called when errors happen. + */ + createWriter(successCallback:FileWriterCallback, errorCallback?:ErrorCallback):void; + + /** + * Returns a File that represents the current state of the file that this FileEntry represents. + * @param successCallback A callback that is called with the File. + * @param errorCallback A callback that is called when errors happen. + */ + file(successCallback:FileCallback, errorCallback?:ErrorCallback):void; +} + +/** + * When requestFileSystem() succeeds, the following callback is made. + */ +interface FileSystemCallback { + /** + * @param filesystem The file systems to which the app is granted access. + */ + (filesystem:FileSystem):void; +} + +/** + * This interface is the callback used to look up Entry objects. + */ +interface EntryCallback { + /** + * @param entry + */ + (entry:Entry):void; +} + +/** + * This interface is the callback used to look up FileEntry objects. + */ +interface FileEntryCallback { + /** + * @param entry + */ + (entry:FileEntry):void; +} + +/** + * This interface is the callback used to look up DirectoryEntry objects. + */ +interface DirectoryEntryCallback { + /** + * @param entry + */ + (entry:DirectoryEntry):void; +} + +/** + * When readEntries() succeeds, the following callback is made. + */ +interface EntriesCallback { + (entries:Entry[]):void; +} + +/** + * This interface is the callback used to look up file and directory metadata. + */ +interface MetadataCallback { + (metadata:Metadata):void; +} + +/** + * This interface is the callback used to create a FileWriter. + */ +interface FileWriterCallback { + (fileWriter:FileWriter):void; +} + +/** + * This interface is the callback used to obtain a File. + */ +interface FileCallback { + (file:File):void; +} + +/** + * This interface is the generic callback used to indicate success of an asynchronous method. + */ +interface VoidCallback { + ():void; +} + +/** + * When an error occurs, the following callback is made. + */ +interface ErrorCallback { + (err:DOMError):void; +} + + +/** + * This interface represents a file system. + */ +interface FileSystemSync { + /** + * This is the name of the file system. The specifics of naming filesystems is unspecified, but a name must be unique across the list of exposed file systems. + */ + name:string; + + /** + * root The root directory of the file system. + */ + root:DirectoryEntrySync; +} + +/** + * An abstract interface representing entries in a file system, each of which may be a FileEntrySync or DirectoryEntrySync. + */ +interface EntrySync{ + /** + * EntrySync is a file. + * @readonly + */ + isFile:boolean; + + /** + * EntrySync is a directory. + * @readonly + */ + isDirectory:boolean; + + /** + * Look up metadata about this entry. + */ + getMetadata():Metadata; + + /** + * The name of the entry, excluding the path leading to it. + */ + name:string; + + /** + * The full absolute path from the root to the entry. + */ + fullPath:string; + + /** + * The file system on which the entry resides. + */ + filesystem:FileSystemSync; + + /** + * Move an entry to a different location on the file system. It is an error to try to: + * <ul> + * <li> move a directory inside itself or to any child at any depth;</li> + * <li> move an entry into its parent if a name different from its current one isn't provided;</li> + * <li> move a file to a path occupied by a directory;</li> + * <li> move a directory to a path occupied by a file;</li> + * <li> move any element to a path occupied by a directory which is not empty.</li> + * </ui> + * A move of a file on top of an existing file must attempt to delete and replace that file. A move of a directory on top of an existing empty directory must attempt to delete and replace that directory. + * @param parent The directory to which to move the entry. + * @param newName The new name of the entry. Defaults to the EntrySync's current name if unspecified. + */ + moveTo(parent:DirectoryEntrySync, newName?:string):EntrySync; + + /** + * Copy an entry to a different location on the file system. It is an error to try to: + * <ul> + * <li> copy a directory inside itself or to any child at any depth;</li> + * <li> copy an entry into its parent if a name different from its current one isn't provided;</li> + * <li> copy a file to a path occupied by a directory;</li> + * <li> copy a directory to a path occupied by a file;</li> + * <li> copy any element to a path occupied by a directory which is not empty.</li> + * </ui> + * A copy of a file on top of an existing file must attempt to delete and replace that file. + * A copy of a directory on top of an existing empty directory must attempt to delete and replace that directory. + * Directory copies are always recursive--that is, they copy all contents of the directory. + */ + copyTo(parent:DirectoryEntrySync, newName?:string):EntrySync; + + /** + * Returns a URL that can be used to identify this entry. Unlike the URN defined in [FILE-API-ED], it has no specific expiration; as it describes a location on disk, it should be valid at least as long as that location exists. + */ + toURL():string; + + /** + * Deletes a file or directory. It is an error to attempt to delete a directory that is not empty. It is an error to attempt to delete the root directory of a filesystem. + */ + remove ():void; + + /** + * Look up the parent DirectoryEntrySync containing this Entry. If this EntrySync is the root of its filesystem, its parent is itself. + */ + getParent():DirectoryEntrySync; +} + +/** + * This interface represents a directory on a file system. + */ +interface DirectoryEntrySync extends EntrySync { + /** + * Creates a new DirectoryReaderSync to read EntrySyncs from this DirectorySync. + */ + createReader():DirectoryReaderSync; + + /** + * Creates or looks up a directory. + * @param path Either an absolute path or a relative path from this DirectoryEntrySync to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist. + * @param options + * <ul> + * <li> If create and exclusive are both true and the path already exists, getFile must fail.</li> + * <li> If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li> + * <li> If create is not true and the path doesn't exist, getFile must fail.</li> + * <li> If create is not true and the path exists, but is a directory, getFile must fail.</li> + * <li> Otherwise, if no other error occurs, getFile must return a FileEntrySync corresponding to path.</li> + * </ul> + */ + getFile(path:string, options?:Flags):FileEntrySync; + + /** + * Creates or looks up a directory. + * @param path Either an absolute path or a relative path from this DirectoryEntrySync to the directory to be looked up or created. It is an error to attempt to create a directory whose immediate parent does not yet exist. + * @param options + * <ul> + * <li> If create and exclusive are both true and the path already exists, getDirectory must fail.</li> + * <li> If create is true, the path doesn't exist, and no other error occurs, getDirectory must create and return a corresponding DirectoryEntry.</li> + * <li> If create is not true and the path doesn't exist, getDirectory must fail.</li> + * <li> If create is not true and the path exists, but is a file, getDirectory must fail.</li> + * <li> Otherwise, if no other error occurs, getDirectory must return a DirectoryEntrySync corresponding to path.</li> + * </ul> + */ + getDirectory(path:string, options?:Flags):DirectoryEntrySync; + + /** + * Deletes a directory and all of its contents, if any. In the event of an error [e.g. trying to delete a directory that contains a file that cannot be removed], some of the contents of the directory may be deleted. It is an error to attempt to delete the root directory of a filesystem. + */ + removeRecursively():void; +} + +/** + * This interface lets a user list files and directories in a directory. If there are no additions to or deletions from a directory between the first and last call to readEntries, and no errors occur, then: + * <ul> + * <li> A series of calls to readEntries must return each entry in the directory exactly once.</li> + * <li> Once all entries have been returned, the next call to readEntries must produce an empty array.</li> + * <li> If not all entries have been returned, the array produced by readEntries must not be empty.</li> + * <li> The entries produced by readEntries must not include the directory itself ["."] or its parent [".."].</li> + * </ul> + */ +interface DirectoryReaderSync { + /** + * Read the next block of entries from this directory. + */ + readEntries():EntrySync[]; +} + +/** + * This interface represents a file on a file system. + */ +interface FileEntrySync extends EntrySync { + /** + * Creates a new FileWriterSync associated with the file that this FileEntrySync represents. + */ + createWriter():FileWriterSync; + + /** + * Returns a File that represents the current state of the file that this FileEntrySync represents. + */ + file():File; +} + +interface Window extends LocalFileSystem, LocalFileSystemSync{ +} + +interface WorkerGlobalScope extends LocalFileSystem, LocalFileSystemSync{ +} diff --git a/lib/decl/filewriter/filewriter.d.ts b/lib/decl/filewriter/filewriter.d.ts new file mode 100644 index 000000000..a4910d0b1 --- /dev/null +++ b/lib/decl/filewriter/filewriter.d.ts @@ -0,0 +1,176 @@ +// Type definitions for File API: Writer +// Project: http://www.w3.org/TR/file-writer-api/ +// Definitions by: Kon <http://phyzkit.net/> +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * This interface provides methods to monitor the asynchronous writing of blobs to disk using progress events [PROGRESS-EVENTS] and event handler attributes. + * This interface is specified to be used within the context of the global object (Window [HTML5]) and within Web Workers (WorkerUtils [WEBWORKERS-ED]). + */ +interface FileSaver extends EventTarget { + /** + * When the abort method is called, user agents must run the steps below: + * <ol> + * <li> If readyState == DONE or readyState == INIT, terminate this overall series of steps without doing anything else. </li> + * <li> Set readyState to DONE. </li> + * <li> If there are any tasks from the object's FileSaver task source in one of the task queues, then remove those tasks. </li> + * <li> Terminate the write algorithm being processed. </li> + * <li> Set the error attribute to a DOMError object of type "AbortError". </li> + * <li> Fire a progress event called abort </li> + * <li> Fire a progress event called writeend </li> + * <li> Terminate this algorithm. </li> + * </ol> + */ + abort():void; + + /** + * The blob is being written. + * @readonly + */ + INIT:number; + + /** + * The object has been constructed, but there is no pending write. + * @readonly + */ + WRITING:number; + + /** + * The entire Blob has been written to the file, an error occurred during the write, or the write was aborted using abort(). The FileSaver is no longer writing the blob. + * @readonly + */ + DONE:number; + + /** + * The FileSaver object can be in one of 3 states. The readyState attribute, on getting, must return the current state, which must be one of the following values: + * <ul> + * <li>INIT</li> + * <li>WRITING</li> + * <li>DONE</li> + * <ul> + * @readonly + */ + readyState:number; + + /** + * The last error that occurred on the FileSaver. + * @readonly + */ + error:DOMError; + + /** + * Handler for writestart events + */ + onwritestart:Function; + + /** + * Handler for progress events. + */ + onprogress:Function; + + /** + * Handler for write events. + */ + onwrite:Function; + + /** + * Handler for abort events. + */ + onabort:Function; + + /** + * Handler for error events. + */ + onerror:Function; + + /** + * Handler for writeend events. + */ + onwriteend:Function; +} + +declare var FileSaver: { + /** + * When the FileSaver constructor is called, the user agent must return a new FileSaver object with readyState set to INIT. + * This constructor must be visible when the script's global object is either a Window object or an object implementing the WorkerUtils interface. + */ + new(data:Blob): FileSaver; +} + +/** + * This interface expands on the FileSaver interface to allow for multiple write actions, rather than just saving a single Blob. + */ +interface FileWriter extends FileSaver { + /** + * The byte offset at which the next write to the file will occur. This must be no greater than length. + * A newly-created FileWriter must have position set to 0. + */ + position:number; + + /** + * The length of the file. If the user does not have read access to the file, this must be the highest byte offset at which the user has written. + */ + length:number; + + /** + * Write the supplied data to the file at position. + * @param data The blob to write. + */ + write(data:Blob):void; + + /** + * Seek sets the file position at which the next write will occur. + * @param offset If nonnegative, an absolute byte offset into the file. If negative, an offset back from the end of the file. + */ + seek(offset:number):void; + + /** + * Changes the length of the file to that specified. If shortening the file, data beyond the new length must be discarded. If extending the file, the existing data must be zero-padded up to the new length. + * @param size The size to which the length of the file is to be adjusted, measured in bytes. + */ + truncate(size:number):void; +} + +/** + * This interface lets users write, truncate, and append to files using simple synchronous calls. + * This interface is specified to be used only within Web Workers (WorkerUtils [WEBWORKERS]). + */ +interface FileWriterSync { + /** + * The byte offset at which the next write to the file will occur. This must be no greater than length. + */ + position:number; + + /** + * The length of the file. If the user does not have read access to the file, this must be the highest byte offset at which the user has written. + */ + length:number; + + /** + * Write the supplied data to the file at position. Upon completion, position will increase by data.size. + * @param data The blob to write. + */ + write(data:Blob):void; + + /** + * Seek sets the file position at which the next write will occur. + * @param offset An absolute byte offset into the file. If offset is greater than length, length is used instead. If offset is less than zero, length is added to it, so that it is treated as an offset back from the end of the file. If it is still less than zero, zero is used. + */ + seek(offset:number):void; + + /** + * Changes the length of the file to that specified. If shortening the file, data beyond the new length must be discarded. If extending the file, the existing data must be zero-padded up to the new length. + * Upon successful completion: + * <ul> + * <li>length must be equal to size.</li> + * <li>position must be the lesser of + * <ul> + * <li>its pre-truncate value,</li> + * <li>size.</li> + * </ul> + * </li> + * </ul> + * @param size The size to which the length of the file is to be adjusted, measured in bytes. + */ + truncate(size:number):void; +} diff --git a/lib/decl/handlebars/handlebars-1.0.0.d.ts b/lib/decl/handlebars/handlebars-1.0.0.d.ts new file mode 100644 index 000000000..c118760c5 --- /dev/null +++ b/lib/decl/handlebars/handlebars-1.0.0.d.ts @@ -0,0 +1,184 @@ +// Type definitions for Handlebars 1.0
+// Project: http://handlebarsjs.com/
+// Definitions by: Boris Yankov <https://github.com/borisyankov/>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+// Use either HandlebarsStatic or HandlebarsRuntimeStatic
+declare var Handlebars: HandlebarsStatic;
+//declare var Handlebars: HandlebarsRuntimeStatic;
+
+/**
+* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View
+**/
+interface HandlebarsTemplatable {
+ template: HandlebarsTemplateDelegate;
+}
+
+interface HandlebarsTemplateDelegate {
+ (context: any, options?: any): string;
+}
+
+interface HandlebarsCommon {
+ registerHelper(name: string, fn: Function, inverse?: boolean): void;
+ registerPartial(name: string, str: any): void;
+ K(): void;
+ createFrame(object: any): any;
+
+ Exception(message: string): void;
+ SafeString: typeof hbs.SafeString;
+ Utils: typeof hbs.Utils;
+
+ logger: Logger;
+ log(level: number, obj: any): void;
+}
+
+interface HandlebarsStatic extends HandlebarsCommon {
+ parse(input: string): hbs.AST.ProgramNode;
+ compile(input: any, options?: any): HandlebarsTemplateDelegate;
+}
+
+interface HandlebarsTemplates {
+ [index: string]: HandlebarsTemplateDelegate;
+}
+
+interface HandlebarsRuntimeStatic extends HandlebarsCommon {
+ // Handlebars.templates is the default template namespace in precompiler.
+ templates: HandlebarsTemplates;
+}
+
+declare module hbs {
+ class SafeString {
+ constructor(str: string);
+ static toString(): string;
+ }
+
+ module Utils {
+ function escapeExpression(str: string): string;
+ }
+}
+
+interface Logger {
+ DEBUG: number;
+ INFO: number;
+ WARN: number;
+ ERROR: number;
+ level: number;
+
+ methodMap: { [level: number]: string };
+
+ log(level: number, obj: string): void;
+}
+
+declare module hbs {
+ module AST {
+ interface IStripInfo {
+ left?: boolean;
+ right?: boolean;
+ inlineStandalone?: boolean;
+ }
+
+ class NodeBase {
+ firstColumn: number;
+ firstLine: number;
+ lastColumn: number;
+ lastLine: number;
+ type: string;
+ }
+
+ class ProgramNode extends NodeBase {
+ statements: NodeBase[];
+ }
+
+ class IdNode extends NodeBase {
+ original: string;
+ parts: string[];
+ string: string;
+ depth: number;
+ idName: string;
+ isSimple: boolean;
+ stringModeValue: string;
+ }
+
+ class HashNode extends NodeBase {
+ pairs: {0: string;
+ 1: NodeBase}[];
+ }
+
+ class SexprNode extends NodeBase {
+ hash: HashNode;
+ id: NodeBase;
+ params: NodeBase[];
+ isHelper: boolean;
+ eligibleHelper: boolean;
+ }
+
+ class MustacheNode extends NodeBase {
+ strip: IStripInfo;
+ escaped: boolean;
+ sexpr: SexprNode;
+
+ }
+
+ class BlockNode extends NodeBase {
+ mustache: MustacheNode;
+ program: ProgramNode;
+ inverse: ProgramNode;
+ strip: IStripInfo;
+ isInverse: boolean;
+ }
+
+ class PartialNameNode extends NodeBase {
+ name: string;
+ }
+
+ class PartialNode extends NodeBase {
+ partialName: PartialNameNode;
+ context: NodeBase;
+ hash: HashNode;
+ strip: IStripInfo;
+ }
+
+ class RawBlockNode extends NodeBase {
+ mustache: MustacheNode;
+ program: ProgramNode;
+ }
+
+ class ContentNode extends NodeBase {
+ original: string;
+ string: string;
+ }
+
+ class DataNode extends NodeBase {
+ id: IdNode;
+ stringModeValue: string;
+ idName: string;
+ }
+
+ class StringNode extends NodeBase {
+ original: string;
+ string: string;
+ stringModeValue: string;
+ }
+
+ class NumberNode extends NodeBase {
+ original: string;
+ number: string;
+ stringModeValue: number;
+ }
+
+ class BooleanNode extends NodeBase {
+ bool: string;
+ stringModeValue: boolean;
+ }
+
+ class CommentNode extends NodeBase {
+ comment: string;
+ strip: IStripInfo;
+ }
+ }
+}
+
+declare module "handlebars" {
+ export = Handlebars;
+}
diff --git a/lib/decl/handlebars/handlebars.d.ts b/lib/decl/handlebars/handlebars.d.ts new file mode 100644 index 000000000..54dc7e9ae --- /dev/null +++ b/lib/decl/handlebars/handlebars.d.ts @@ -0,0 +1,227 @@ +// Type definitions for Handlebars v3.0.3
+// Project: http://handlebarsjs.com/
+// Definitions by: Boris Yankov <https://github.com/borisyankov/>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+declare module Handlebars {
+ export function registerHelper(name: string, fn: Function, inverse?: boolean): void;
+ export function registerPartial(name: string, str: any): void;
+ export function unregisterHelper(name: string): void;
+ export function unregisterPartial(name: string): void;
+ export function K(): void;
+ export function createFrame(object: any): any;
+ export function Exception(message: string): void;
+ export function log(level: number, obj: any): void;
+ export function parse(input: string): hbs.AST.Program;
+ export function compile(input: any, options?: any): HandlebarsTemplateDelegate;
+
+ export var SafeString: typeof hbs.SafeString;
+ export var Utils: typeof hbs.Utils;
+ export var logger: Logger;
+ export var templates: HandlebarsTemplates;
+ export var helpers: any;
+
+ export module AST {
+ export var helpers: hbs.AST.helpers;
+ }
+
+ interface ICompiler {
+ accept(node: hbs.AST.Node): void;
+ Program(program: hbs.AST.Program): void;
+ BlockStatement(block: hbs.AST.BlockStatement): void;
+ PartialStatement(partial: hbs.AST.PartialStatement): void;
+ MustacheStatement(mustache: hbs.AST.MustacheStatement): void;
+ ContentStatement(content: hbs.AST.ContentStatement): void;
+ CommentStatement(comment?: hbs.AST.CommentStatement): void;
+ SubExpression(sexpr: hbs.AST.SubExpression): void;
+ PathExpression(path: hbs.AST.PathExpression): void;
+ StringLiteral(str: hbs.AST.StringLiteral): void;
+ NumberLiteral(num: hbs.AST.NumberLiteral): void;
+ BooleanLiteral(bool: hbs.AST.BooleanLiteral): void;
+ UndefinedLiteral(): void;
+ NullLiteral(): void;
+ Hash(hash: hbs.AST.Hash): void;
+ }
+
+ export class Visitor implements ICompiler {
+ accept(node: hbs.AST.Node): void;
+ acceptKey(node: hbs.AST.Node, name: string): void;
+ acceptArray(arr: hbs.AST.Expression[]): void;
+ Program(program: hbs.AST.Program): void;
+ BlockStatement(block: hbs.AST.BlockStatement): void;
+ PartialStatement(partial: hbs.AST.PartialStatement): void;
+ MustacheStatement(mustache: hbs.AST.MustacheStatement): void;
+ ContentStatement(content: hbs.AST.ContentStatement): void;
+ CommentStatement(comment?: hbs.AST.CommentStatement): void;
+ SubExpression(sexpr: hbs.AST.SubExpression): void;
+ PathExpression(path: hbs.AST.PathExpression): void;
+ StringLiteral(str: hbs.AST.StringLiteral): void;
+ NumberLiteral(num: hbs.AST.NumberLiteral): void;
+ BooleanLiteral(bool: hbs.AST.BooleanLiteral): void;
+ UndefinedLiteral(): void;
+ NullLiteral(): void;
+ Hash(hash: hbs.AST.Hash): void;
+ }
+}
+
+/**
+* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View
+**/
+interface HandlebarsTemplatable {
+ template: HandlebarsTemplateDelegate;
+}
+
+interface HandlebarsTemplateDelegate {
+ (context: any, options?: any): string;
+}
+
+interface HandlebarsTemplates {
+ [index: string]: HandlebarsTemplateDelegate;
+}
+
+declare module hbs {
+ class SafeString {
+ constructor(str: string);
+ static toString(): string;
+ }
+
+ module Utils {
+ function escapeExpression(str: string): string;
+ }
+}
+
+interface Logger {
+ DEBUG: number;
+ INFO: number;
+ WARN: number;
+ ERROR: number;
+ level: number;
+
+ methodMap: { [level: number]: string };
+
+ log(level: number, obj: string): void;
+}
+
+declare module hbs {
+ module AST {
+ interface Node {
+ type: string;
+ loc: SourceLocation;
+ }
+
+ interface SourceLocation {
+ source: string;
+ start: Position;
+ end: Position;
+ }
+
+ interface Position {
+ line: number;
+ column: number;
+ }
+
+ interface Program extends Node {
+ body: Statement[];
+ blockParams: string[];
+ }
+
+ interface Statement extends Node {}
+
+ interface MustacheStatement extends Statement {
+ path: PathExpression | Literal;
+ params: Expression[];
+ hash: Hash;
+ escaped: boolean;
+ strip: StripFlags;
+ }
+
+ interface BlockStatement extends Statement {
+ path: PathExpression;
+ params: Expression[];
+ hash: Hash;
+ program: Program;
+ inverse: Program;
+ openStrip: StripFlags;
+ inverseStrip: StripFlags;
+ closeStrip: StripFlags;
+ }
+
+ interface PartialStatement extends Statement {
+ name: PathExpression | SubExpression;
+ params: Expression[];
+ hash: Hash;
+ indent: string;
+ strip: StripFlags;
+ }
+
+ interface ContentStatement extends Statement {
+ value: string;
+ original: StripFlags;
+ }
+
+ interface CommentStatement extends Statement {
+ value: string;
+ strip: StripFlags;
+ }
+
+ interface Expression extends Node {}
+
+ interface SubExpression extends Expression {
+ path: PathExpression;
+ params: Expression[];
+ hash: Hash;
+ }
+
+ interface PathExpression extends Expression {
+ data: boolean;
+ depth: number;
+ parts: string[];
+ original: string;
+ }
+
+ interface Literal extends Expression {}
+ interface StringLiteral extends Literal {
+ value: string;
+ original: string;
+ }
+
+ interface BooleanLiteral extends Literal {
+ value: boolean;
+ original: boolean;
+ }
+
+ interface NumberLiteral extends Literal {
+ value: number;
+ original: number;
+ }
+
+ interface UndefinedLiteral extends Literal {}
+
+ interface NullLiteral extends Literal {}
+
+ interface Hash extends Node {
+ pairs: HashPair[];
+ }
+
+ interface HashPair extends Node {
+ key: string;
+ value: Expression;
+ }
+
+ interface StripFlags {
+ open: boolean;
+ close: boolean;
+ }
+
+ interface helpers {
+ helperExpression(node: Node): boolean;
+ scopeId(path: PathExpression): boolean;
+ simpleId(path: PathExpression): boolean;
+ }
+ }
+}
+
+declare module "handlebars" {
+ export = Handlebars;
+}
diff --git a/lib/decl/jquery/jquery.d.ts b/lib/decl/jquery/jquery.d.ts new file mode 100644 index 000000000..8401753e3 --- /dev/null +++ b/lib/decl/jquery/jquery.d.ts @@ -0,0 +1,3190 @@ +// Type definitions for jQuery 1.10.x / 2.0.x +// Project: http://jquery.com/ +// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christian Hoffmeister <https://github.com/choffmeister>, Steve Fenton <https://github.com/Steve-Fenton>, Diullei Gomes <https://github.com/Diullei>, Tass Iliopoulos <https://github.com/tasoili>, Jason Swearingen <https://github.com/jasons-novaleaf>, Sean Hill <https://github.com/seanski>, Guus Goossens <https://github.com/Guuz>, Kelly Summerlin <https://github.com/ksummerlin>, Basarat Ali Syed <https://github.com/basarat>, Nicholas Wolverson <https://github.com/nwolverson>, Derek Cicerone <https://github.com/derekcicerone>, Andrew Gaspar <https://github.com/AndrewGaspar>, James Harrison Fisher <https://github.com/jameshfisher>, Seikichi Kondo <https://github.com/seikichi>, Benjamin Jackman <https://github.com/benjaminjackman>, Poul Sorensen <https://github.com/s093294>, Josh Strobl <https://github.com/JoshStrobl>, John Reilly <https://github.com/johnnyreilly/>, Dick van den Brink <https://github.com/DickvdBrink> +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/* ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/** + * Interface for the AJAX setting that will configure the AJAX request + */ +interface JQueryAjaxSettings { + /** + * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. + */ + accepts?: any; + /** + * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). + */ + async?: boolean; + /** + * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. + */ + beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; + /** + * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. + */ + cache?: boolean; + /** + * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + complete? (jqXHR: JQueryXHR, textStatus: string): any; + /** + * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5) + */ + contents?: { [key: string]: any; }; + //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false" + // https://github.com/borisyankov/DefinitelyTyped/issues/742 + /** + * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. + */ + contentType?: any; + /** + * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). + */ + context?: any; + /** + * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5) + */ + converters?: { [key: string]: any; }; + /** + * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5) + */ + crossDomain?: boolean; + /** + * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). + */ + data?: any; + /** + * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. + */ + dataFilter? (data: any, ty: any): any; + /** + * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). + */ + dataType?: string; + /** + * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. + */ + error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; + /** + * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. + */ + global?: boolean; + /** + * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5) + */ + headers?: { [key: string]: any; }; + /** + * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. + */ + ifModified?: boolean; + /** + * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1) + */ + isLocal?: boolean; + /** + * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } + */ + jsonp?: any; + /** + * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. + */ + jsonpCallback?: any; + /** + * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0) + */ + method?: string; + /** + * A mime type to override the XHR mime type. (version added: 1.5.1) + */ + mimeType?: string; + /** + * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + password?: string; + /** + * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. + */ + processData?: boolean; + /** + * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. + */ + scriptCharset?: string; + /** + * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5) + */ + statusCode?: { [key: string]: any; }; + /** + * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + success? (data: any, textStatus: string, jqXHR: JQueryXHR): any; + /** + * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. + */ + timeout?: number; + /** + * Set this to true if you wish to use the traditional style of param serialization. + */ + traditional?: boolean; + /** + * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers. + */ + type?: string; + /** + * A string containing the URL to which the request is sent. + */ + url?: string; + /** + * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + username?: string; + /** + * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. + */ + xhr?: any; + /** + * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1) + */ + xhrFields?: { [key: string]: any; }; +} + +/** + * Interface for the jqXHR object + */ +interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> { + /** + * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). + */ + overrideMimeType(mimeType: string): any; + /** + * Cancel the request. + * + * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" + */ + abort(statusText?: string): void; + /** + * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. + */ + then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise<any>; + /** + * Property containing the parsed response if the response Content-Type is json + */ + responseJSON?: any; + /** + * A function to be called if the request fails. + */ + error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void; +} + +/** + * Interface for the JQuery callback + */ +interface JQueryCallback { + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + */ + add(callbacks: Function): JQueryCallback; + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + */ + add(callbacks: Function[]): JQueryCallback; + + /** + * Disable a callback list from doing anything more. + */ + disable(): JQueryCallback; + + /** + * Determine if the callbacks list has been disabled. + */ + disabled(): boolean; + + /** + * Remove all of the callbacks from a list. + */ + empty(): JQueryCallback; + + /** + * Call all of the callbacks with the given arguments + * + * @param arguments The argument or list of arguments to pass back to the callback list. + */ + fire(...arguments: any[]): JQueryCallback; + + /** + * Determine if the callbacks have already been called at least once. + */ + fired(): boolean; + + /** + * Call all callbacks in a list with the given context and arguments. + * + * @param context A reference to the context in which the callbacks in the list should be fired. + * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. + */ + fireWith(context?: any, args?: any[]): JQueryCallback; + + /** + * Determine whether a supplied callback is in a list + * + * @param callback The callback to search for. + */ + has(callback: Function): boolean; + + /** + * Lock a callback list in its current state. + */ + lock(): JQueryCallback; + + /** + * Determine if the callbacks list has been locked. + */ + locked(): boolean; + + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + */ + remove(callbacks: Function): JQueryCallback; + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + */ + remove(callbacks: Function[]): JQueryCallback; +} + +/** + * Allows jQuery Promises to interop with non-jQuery promises + */ +interface JQueryGenericPromise<T> { + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + */ + then<U>(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise<U>, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>; + + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + */ + then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<void>; +} + +/** + * Interface for the JQuery promise/deferred callbacks + */ +interface JQueryPromiseCallback<T> { + (value?: T, ...args: any[]): void; +} + +interface JQueryPromiseOperator<T, U> { + (callback1: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...callbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<U>; +} + +/** + * Interface for the JQuery promise, part of callbacks + */ +interface JQueryPromise<T> extends JQueryGenericPromise<T> { + /** + * Determine the current state of a Deferred object. + */ + state(): string; + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + */ + always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + */ + done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryPromise<T>; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + */ + fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. + */ + progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>; + + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>; +} + +/** + * Interface for the JQuery deferred, part of callbacks + */ +interface JQueryDeferred<T> extends JQueryGenericPromise<T> { + /** + * Determine the current state of a Deferred object. + */ + state(): string; + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + */ + always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + */ + done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryDeferred<T>; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + */ + fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. + */ + progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>; + + /** + * Call the progressCallbacks on a Deferred object with the given args. + * + * @param args Optional arguments that are passed to the progressCallbacks. + */ + notify(value?: any, ...args: any[]): JQueryDeferred<T>; + + /** + * Call the progressCallbacks on a Deferred object with the given context and args. + * + * @param context Context passed to the progressCallbacks as the this object. + * @param args Optional arguments that are passed to the progressCallbacks. + */ + notifyWith(context: any, value?: any[]): JQueryDeferred<T>; + + /** + * Reject a Deferred object and call any failCallbacks with the given args. + * + * @param args Optional arguments that are passed to the failCallbacks. + */ + reject(value?: any, ...args: any[]): JQueryDeferred<T>; + /** + * Reject a Deferred object and call any failCallbacks with the given context and args. + * + * @param context Context passed to the failCallbacks as the this object. + * @param args An optional array of arguments that are passed to the failCallbacks. + */ + rejectWith(context: any, value?: any[]): JQueryDeferred<T>; + + /** + * Resolve a Deferred object and call any doneCallbacks with the given args. + * + * @param value First argument passed to doneCallbacks. + * @param args Optional subsequent arguments that are passed to the doneCallbacks. + */ + resolve(value?: T, ...args: any[]): JQueryDeferred<T>; + + /** + * Resolve a Deferred object and call any doneCallbacks with the given context and args. + * + * @param context Context passed to the doneCallbacks as the this object. + * @param args An optional array of arguments that are passed to the doneCallbacks. + */ + resolveWith(context: any, value?: T[]): JQueryDeferred<T>; + + /** + * Return a Deferred's Promise object. + * + * @param target Object onto which the promise methods have to be attached + */ + promise(target?: any): JQueryPromise<T>; + + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>; +} + +/** + * Interface of the JQuery extension of the W3C event object + */ +interface BaseJQueryEventObject extends Event { + data: any; + delegateTarget: Element; + isDefaultPrevented(): boolean; + isImmediatePropagationStopped(): boolean; + isPropagationStopped(): boolean; + namespace: string; + originalEvent: Event; + preventDefault(): any; + relatedTarget: Element; + result: any; + stopImmediatePropagation(): void; + stopPropagation(): void; + target: Element; + pageX: number; + pageY: number; + which: number; + metaKey: boolean; +} + +interface JQueryInputEventObject extends BaseJQueryEventObject { + altKey: boolean; + ctrlKey: boolean; + metaKey: boolean; + shiftKey: boolean; +} + +interface JQueryMouseEventObject extends JQueryInputEventObject { + button: number; + clientX: number; + clientY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; +} + +interface JQueryKeyEventObject extends JQueryInputEventObject { + char: any; + charCode: number; + key: any; + keyCode: number; +} + +interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ +} + +/* + Collection of properties of the current browser +*/ + +interface JQuerySupport { + ajax?: boolean; + boxModel?: boolean; + changeBubbles?: boolean; + checkClone?: boolean; + checkOn?: boolean; + cors?: boolean; + cssFloat?: boolean; + hrefNormalized?: boolean; + htmlSerialize?: boolean; + leadingWhitespace?: boolean; + noCloneChecked?: boolean; + noCloneEvent?: boolean; + opacity?: boolean; + optDisabled?: boolean; + optSelected?: boolean; + scriptEval? (): boolean; + style?: boolean; + submitBubbles?: boolean; + tbody?: boolean; +} + +interface JQueryParam { + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @param obj An array or object to serialize. + */ + (obj: any): string; + + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @param obj An array or object to serialize. + * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. + */ + (obj: any, traditional: boolean): string; +} + +/** + * The interface used to construct jQuery events (with $.Event). It is + * defined separately instead of inline in JQueryStatic to allow + * overriding the construction function with specific strings + * returning specific event objects. + */ +interface JQueryEventConstructor { + (name: string, eventProperties?: any): JQueryEventObject; + new (name: string, eventProperties?: any): JQueryEventObject; +} + +/** + * The interface used to specify coordinates. + */ +interface JQueryCoordinates { + left: number; + top: number; +} + +/** + * Elements in the array returned by serializeArray() + */ +interface JQuerySerializeArrayElement { + name: string; + value: string; +} + +interface JQueryAnimationOptions { + /** + * A string or number determining how long the animation will run. + */ + duration?: any; + /** + * A string indicating which easing function to use for the transition. + */ + easing?: string; + /** + * A function to call once the animation is complete. + */ + complete?: Function; + /** + * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. + */ + step?: (now: number, tween: any) => any; + /** + * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) + */ + progress?: (animation: JQueryPromise<any>, progress: number, remainingMs: number) => any; + /** + * A function to call when the animation begins. (version added: 1.8) + */ + start?: (animation: JQueryPromise<any>) => any; + /** + * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) + */ + done?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any; + /** + * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) + */ + fail?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any; + /** + * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) + */ + always?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any; + /** + * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. + */ + queue?: any; + /** + * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) + */ + specialEasing?: Object; +} + +/** + * Static members of jQuery (those on $ and jQuery themselves) + */ +interface JQueryStatic { + + /** + * Perform an asynchronous HTTP (Ajax) request. + * + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). + */ + ajax(settings: JQueryAjaxSettings): JQueryXHR; + /** + * Perform an asynchronous HTTP (Ajax) request. + * + * @param url A string containing the URL to which the request is sent. + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). + */ + ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR; + + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * + * @param dataTypes An optional string containing one or more space-separated dataTypes + * @param handler A handler to set default values for future Ajax requests. + */ + ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * + * @param handler A handler to set default values for future Ajax requests. + */ + ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; + + ajaxSettings: JQueryAjaxSettings; + + /** + * Set default values for future Ajax requests. Its use is not recommended. + * + * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. + */ + ajaxSetup(options: JQueryAjaxSettings): void; + + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). + */ + get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). + */ + get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + */ + getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + */ + getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + /** + * Load a JavaScript file from the server using a GET HTTP request, then execute it. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + */ + getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + */ + param: JQueryParam; + + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + */ + post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + */ + post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + + /** + * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. + * + * @param flags An optional list of space-separated flags that change how the callback list behaves. + */ + Callbacks(flags?: string): JQueryCallback; + + /** + * Holds or releases the execution of jQuery's ready event. + * + * @param hold Indicates whether the ready hold is being requested or released + */ + holdReady(hold: boolean): void; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param selector A string containing a selector expression + * @param context A DOM Element, Document, or jQuery to use as context + */ + (selector: string, context?: Element|JQuery): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param element A DOM element to wrap in a jQuery object. + */ + (element: Element): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. + */ + (elementArray: Element[]): JQuery; + + /** + * Binds a function to be executed when the DOM has finished loading. + * + * @param callback A function to execute after the DOM is ready. + */ + (callback: (jQueryAlias?: JQueryStatic) => any): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param object A plain object to wrap in a jQuery object. + */ + (object: {}): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param object An existing jQuery object to clone. + */ + (object: JQuery): JQuery; + + /** + * Specify a function to execute when the DOM is fully loaded. + */ + (): JQuery; + + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * + * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. + * @param ownerDocument A document in which the new elements will be created. + */ + (html: string, ownerDocument?: Document): JQuery; + + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * + * @param html A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>). + * @param attributes An object of attributes, events, and methods to call on the newly-created element. + */ + (html: string, attributes: Object): JQuery; + + /** + * Relinquish jQuery's control of the $ variable. + * + * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). + */ + noConflict(removeAll?: boolean): Object; + + /** + * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. + * + * @param deferreds One or more Deferred objects, or plain JavaScript objects. + */ + when<T>(...deferreds: Array<T|JQueryPromise<T>/* as JQueryDeferred<T> */>): JQueryPromise<T>; + + /** + * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. + */ + cssHooks: { [key: string]: any; }; + cssNumber: any; + + /** + * Store arbitrary data associated with the specified element. Returns the value that was set. + * + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + * @param value The new data value. + */ + data<T>(element: Element, key: string, value: T): T; + /** + * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. + * + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + */ + data(element: Element, key: string): any; + /** + * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. + * + * @param element The DOM element to associate with the data. + */ + data(element: Element): any; + + /** + * Execute the next function on the queue for the matched element. + * + * @param element A DOM element from which to remove and execute a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + dequeue(element: Element, queueName?: string): void; + + /** + * Determine whether an element has any jQuery data associated with it. + * + * @param element A DOM element to be checked for data. + */ + hasData(element: Element): boolean; + + /** + * Show the queue of functions to be executed on the matched element. + * + * @param element A DOM element to inspect for an attached queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + queue(element: Element, queueName?: string): any[]; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element where the array of queued functions is attached. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(element: Element, queueName: string, newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element on which to add a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param callback The new function to add to the queue. + */ + queue(element: Element, queueName: string, callback: Function): JQuery; + + /** + * Remove a previously-stored piece of data. + * + * @param element A DOM element from which to remove data. + * @param name A string naming the piece of data to remove. + */ + removeData(element: Element, name?: string): JQuery; + + /** + * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. + * + * @param beforeStart A function that is called just before the constructor returns. + */ + Deferred<T>(beforeStart?: (deferred: JQueryDeferred<T>) => any): JQueryDeferred<T>; + + /** + * Effects + */ + fx: { + tick: () => void; + /** + * The rate (in milliseconds) at which animations fire. + */ + interval: number; + stop: () => void; + speeds: { slow: number; fast: number; }; + /** + * Globally disable all animations. + */ + off: boolean; + step: any; + }; + + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param fnction The function whose context will be changed. + * @param context The object to which the context (this) of the function should be set. + * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. + */ + proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any; + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param context The object to which the context (this) of the function should be set. + * @param name The name of the function whose context will be changed (should be a property of the context object). + * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. + */ + proxy(context: Object, name: string, ...additionalArguments: any[]): any; + + Event: JQueryEventConstructor; + + /** + * Takes a string and throws an exception containing it. + * + * @param message The message to send out. + */ + error(message: any): JQuery; + + expr: any; + fn: any; //TODO: Decide how we want to type this + + isReady: boolean; + + // Properties + support: JQuerySupport; + + /** + * Check to see if a DOM element is a descendant of another DOM element. + * + * @param container The DOM element that may contain the other element. + * @param contained The DOM element that may be contained by (a descendant of) the other element. + */ + contains(container: Element, contained: Element): boolean; + + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + */ + each<T>( + collection: T[], + callback: (indexInArray: number, valueOfElement: T) => any + ): any; + + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + */ + each( + collection: any, + callback: (indexInArray: any, valueOfElement: any) => any + ): any; + + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + */ + extend(target: any, object1?: any, ...objectN: any[]): any; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + */ + extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any; + + /** + * Execute some JavaScript code globally. + * + * @param code The JavaScript code to execute. + */ + globalEval(code: string): any; + + /** + * Finds the elements of an array which satisfy a filter function. The original array is not affected. + * + * @param array The array to search through. + * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. + * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. + */ + grep<T>(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[]; + + /** + * Search for a specified value within an array and return its index (or -1 if not found). + * + * @param value The value to search for. + * @param array An array through which to search. + * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array. + */ + inArray<T>(value: T, array: T[], fromIndex?: number): number; + + /** + * Determine whether the argument is an array. + * + * @param obj Object to test whether or not it is an array. + */ + isArray(obj: any): boolean; + /** + * Check to see if an object is empty (contains no enumerable properties). + * + * @param obj The object that will be checked to see if it's empty. + */ + isEmptyObject(obj: any): boolean; + /** + * Determine if the argument passed is a Javascript function object. + * + * @param obj Object to test whether or not it is a function. + */ + isFunction(obj: any): boolean; + /** + * Determines whether its argument is a number. + * + * @param obj The value to be tested. + */ + isNumeric(value: any): boolean; + /** + * Check to see if an object is a plain object (created using "{}" or "new Object"). + * + * @param obj The object that will be checked to see if it's a plain object. + */ + isPlainObject(obj: any): boolean; + /** + * Determine whether the argument is a window. + * + * @param obj Object to test whether or not it is a window. + */ + isWindow(obj: any): boolean; + /** + * Check to see if a DOM node is within an XML document (or is an XML document). + * + * @param node he DOM node that will be checked to see if it's in an XML document. + */ + isXMLDoc(node: Node): boolean; + + /** + * Convert an array-like object into a true JavaScript array. + * + * @param obj Any object to turn into a native Array. + */ + makeArray(obj: any): any[]; + + /** + * Translate all items in an array or object to new array of items. + * + * @param array The Array to translate. + * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. + */ + map<T, U>(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[]; + /** + * Translate all items in an array or object to new array of items. + * + * @param arrayOrObject The Array or Object to translate. + * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. + */ + map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any; + + /** + * Merge the contents of two arrays together into the first array. + * + * @param first The first array to merge, the elements of second added. + * @param second The second array to merge into the first, unaltered. + */ + merge<T>(first: T[], second: T[]): T[]; + + /** + * An empty function. + */ + noop(): any; + + /** + * Return a number representing the current time. + */ + now(): number; + + /** + * Takes a well-formed JSON string and returns the resulting JavaScript object. + * + * @param json The JSON string to parse. + */ + parseJSON(json: string): any; + + /** + * Parses a string into an XML document. + * + * @param data a well-formed XML string to be parsed + */ + parseXML(data: string): XMLDocument; + + /** + * Remove the whitespace from the beginning and end of a string. + * + * @param str Remove the whitespace from the beginning and end of a string. + */ + trim(str: string): string; + + /** + * Determine the internal JavaScript [[Class]] of an object. + * + * @param obj Object to get the internal JavaScript [[Class]] of. + */ + type(obj: any): string; + + /** + * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. + * + * @param array The Array of DOM elements. + */ + unique(array: Element[]): Element[]; + + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context DOM element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + */ + parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; + + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context DOM element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + */ + parseHTML(data: string, context?: Document, keepScripts?: boolean): any[]; +} + +/** + * The jQuery instance members + */ +interface JQuery { + /** + * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. + * + * @param handler The function to be invoked. + */ + ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; + /** + * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; + /** + * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; + /** + * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxStart(handler: () => any): JQuery; + /** + * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxStop(handler: () => any): JQuery; + /** + * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery; + + /** + * Load data from the server and place the returned HTML into the matched element. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param complete A callback function that is executed when the request completes. + */ + load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; + + /** + * Encode a set of form elements as a string for submission. + */ + serialize(): string; + /** + * Encode a set of form elements as an array of names and values. + */ + serializeArray(): JQuerySerializeArrayElement[]; + + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param className One or more space-separated classes to be added to the class attribute of each matched element. + */ + addClass(className: string): JQuery; + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param function A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + */ + addClass(func: (index: number, className: string) => string): JQuery; + + /** + * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. + */ + addBack(selector?: string): JQuery; + + /** + * Get the value of an attribute for the first element in the set of matched elements. + * + * @param attributeName The name of the attribute to get. + */ + attr(attributeName: string): string; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param value A value to set for the attribute. + */ + attr(attributeName: string, value: string|number): JQuery; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. + */ + attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributes An object of attribute-value pairs to set. + */ + attr(attributes: Object): JQuery; + + /** + * Determine whether any of the matched elements are assigned the given class. + * + * @param className The class name to search for. + */ + hasClass(className: string): boolean; + + /** + * Get the HTML contents of the first element in the set of matched elements. + */ + html(): string; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param htmlString A string of HTML to set as the content of each matched element. + */ + html(htmlString: string): JQuery; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + */ + html(func: (index: number, oldhtml: string) => string): JQuery; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + */ + + /** + * Get the value of a property for the first element in the set of matched elements. + * + * @param propertyName The name of the property to get. + */ + prop(propertyName: string): any; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param value A value to set for the property. + */ + prop(propertyName: string, value: string|number|boolean): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + */ + prop(properties: Object): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. + */ + prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery; + + /** + * Remove an attribute from each element in the set of matched elements. + * + * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. + */ + removeAttr(attributeName: string): JQuery; + + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param className One or more space-separated classes to be removed from the class attribute of each matched element. + */ + removeClass(className?: string): JQuery; + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param function A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + */ + removeClass(func: (index: number, className: string) => string): JQuery; + + /** + * Remove a property for the set of matched elements. + * + * @param propertyName The name of the property to remove. + */ + removeProp(propertyName: string): JQuery; + + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. + * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. + */ + toggleClass(className: string, swtch?: boolean): JQuery; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param swtch A boolean value to determine whether the class should be added or removed. + */ + toggleClass(swtch?: boolean): JQuery; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. + * @param swtch A boolean value to determine whether the class should be added or removed. + */ + toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery; + + /** + * Get the current value of the first element in the set of matched elements. + */ + val(): any; + /** + * Set the value of each element in the set of matched elements. + * + * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. + */ + val(value: string|string[]): JQuery; + /** + * Set the value of each element in the set of matched elements. + * + * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + */ + val(func: (index: number, value: string) => string): JQuery; + + + /** + * Get the value of style properties for the first element in the set of matched elements. + * + * @param propertyName A CSS property. + */ + css(propertyName: string): string; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A value to set for the property. + */ + css(propertyName: string, value: string|number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + */ + css(propertyName: string, value: (index: number, value: string) => string|number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + */ + css(properties: Object): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements. + */ + height(): number; + /** + * Set the CSS height of every matched element. + * + * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). + */ + height(value: number|string): JQuery; + /** + * Set the CSS height of every matched element. + * + * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. + */ + height(func: (index: number, height: number) => number|string): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements, including padding but not border. + */ + innerHeight(): number; + + /** + * Sets the inner height on elements in the set of matched elements, including padding but not border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + innerHeight(height: number|string): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements, including padding but not border. + */ + innerWidth(): number; + + /** + * Sets the inner width on elements in the set of matched elements, including padding but not border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + innerWidth(width: number|string): JQuery; + + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the document. + */ + offset(): JQueryCoordinates; + /** + * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * + * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + */ + offset(coordinates: JQueryCoordinates): JQuery; + /** + * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * + * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. + */ + offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + */ + outerHeight(includeMargin?: boolean): number; + + /** + * Sets the outer height on elements in the set of matched elements, including padding and border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + outerHeight(height: number|string): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements, including padding and border. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + */ + outerWidth(includeMargin?: boolean): number; + + /** + * Sets the outer width on elements in the set of matched elements, including padding and border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + outerWidth(width: number|string): JQuery; + + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. + */ + position(): JQueryCoordinates; + + /** + * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element. + */ + scrollLeft(): number; + /** + * Set the current horizontal position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + */ + scrollLeft(value: number): JQuery; + + /** + * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. + */ + scrollTop(): number; + /** + * Set the current vertical position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + */ + scrollTop(value: number): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements. + */ + width(): number; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + width(value: number|string): JQuery; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. + */ + width(func: (index: number, width: number) => number|string): JQuery; + + /** + * Remove from the queue all items that have not yet been run. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + clearQueue(queueName?: string): JQuery; + + /** + * Store arbitrary data associated with the matched elements. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; it can be any Javascript type including Array or Object. + */ + data(key: string, value: any): JQuery; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * + * @param key Name of the data stored. + */ + data(key: string): any; + /** + * Store arbitrary data associated with the matched elements. + * + * @param obj An object of key-value pairs of data to update. + */ + data(obj: { [key: string]: any; }): JQuery; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + */ + data(): any; + + /** + * Execute the next function on the queue for the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + dequeue(queueName?: string): JQuery; + + /** + * Remove a previously-stored piece of data. + * + * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete. + */ + removeData(name: string): JQuery; + /** + * Remove a previously-stored piece of data. + * + * @param list An array of strings naming the pieces of data to delete. + */ + removeData(list: string[]): JQuery; + /** + * Remove all previously-stored piece of data. + */ + removeData(): JQuery; + + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + * + * @param type The type of queue that needs to be observed. (default: fx) + * @param target Object onto which the promise methods have to be attached + */ + promise(type?: string, target?: Object): JQueryPromise<any>; + + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + animate(properties: Object, duration?: string|number, complete?: Function): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. (default: swing) + * @param complete A function to call once the animation is complete. + */ + animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param options A map of additional options to pass to the method. + */ + animate(properties: Object, options: JQueryAnimationOptions): JQuery; + + /** + * Set a timer to delay execution of subsequent items in the queue. + * + * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + delay(duration: number, queueName?: string): JQuery; + + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeIn(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param options A map of additional options to pass to the method. + */ + fadeIn(options: JQueryAnimationOptions): JQuery; + + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeOut(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param options A map of additional options to pass to the method. + */ + fadeOut(options: JQueryAnimationOptions): JQuery; + + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param complete A function to call once the animation is complete. + */ + fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery; + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery; + + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeToggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param options A map of additional options to pass to the method. + */ + fadeToggle(options: JQueryAnimationOptions): JQuery; + + /** + * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. + * + * @param queue The name of the queue in which to stop animations. + */ + finish(queue?: string): JQuery; + + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + hide(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + hide(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + hide(options: JQueryAnimationOptions): JQuery; + + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + show(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + show(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + show(options: JQueryAnimationOptions): JQuery; + + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideDown(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideDown(options: JQueryAnimationOptions): JQuery; + + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideToggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideToggle(options: JQueryAnimationOptions): JQuery; + + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideUp(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideUp(options: JQueryAnimationOptions): JQuery; + + /** + * Stop the currently-running animation on the matched elements. + * + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + */ + stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; + /** + * Stop the currently-running animation on the matched elements. + * + * @param queue The name of the queue in which to stop animations. + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + */ + stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; + + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + toggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + toggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + toggle(options: JQueryAnimationOptions): JQuery; + /** + * Display or hide the matched elements. + * + * @param showOrHide A Boolean indicating whether to show or hide the elements. + */ + toggle(showOrHide: boolean): JQuery; + + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + */ + bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + */ + bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + */ + bind(eventType: string, preventBubble: boolean): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param events An object containing one or more DOM event types and functions to execute for them. + */ + bind(events: any): JQuery; + + /** + * Trigger the "blur" event on an element + */ + blur(): JQuery; + /** + * Bind an event handler to the "blur" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + blur(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "blur" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "change" event on an element. + */ + change(): JQuery; + /** + * Bind an event handler to the "change" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + change(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "change" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "click" event on an element. + */ + click(): JQuery; + /** + * Bind an event handler to the "click" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + */ + click(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "click" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "dblclick" event on an element. + */ + dblclick(): JQuery; + /** + * Bind an event handler to the "dblclick" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "dblclick" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "focus" event on an element. + */ + focus(): JQuery; + /** + * Bind an event handler to the "focus" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + focus(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focus" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "focusin" event on an element. + */ + focusin(): JQuery; + /** + * Bind an event handler to the "focusin" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focusin" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "focusout" event on an element. + */ + focusout(): JQuery; + /** + * Bind an event handler to the "focusout" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focusout" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. + * + * @param handlerIn A function to execute when the mouse pointer enters the element. + * @param handlerOut A function to execute when the mouse pointer leaves the element. + */ + hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. + * + * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. + */ + hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "keydown" event on an element. + */ + keydown(): JQuery; + /** + * Bind an event handler to the "keydown" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keydown" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Trigger the "keypress" event on an element. + */ + keypress(): JQuery; + /** + * Bind an event handler to the "keypress" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keypress" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Trigger the "keyup" event on an element. + */ + keyup(): JQuery; + /** + * Bind an event handler to the "keyup" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keyup" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Bind an event handler to the "load" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + load(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "load" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "mousedown" event on an element. + */ + mousedown(): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseenter" event on an element. + */ + mouseenter(): JQuery; + /** + * Bind an event handler to be fired when the mouse enters an element. + * + * @param handler A function to execute when the event is triggered. + */ + mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to be fired when the mouse enters an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseleave" event on an element. + */ + mouseleave(): JQuery; + /** + * Bind an event handler to be fired when the mouse leaves an element. + * + * @param handler A function to execute when the event is triggered. + */ + mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to be fired when the mouse leaves an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mousemove" event on an element. + */ + mousemove(): JQuery; + /** + * Bind an event handler to the "mousemove" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mousemove" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseout" event on an element. + */ + mouseout(): JQuery; + /** + * Bind an event handler to the "mouseout" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseout" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseover" event on an element. + */ + mouseover(): JQuery; + /** + * Bind an event handler to the "mouseover" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseover" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseup" event on an element. + */ + mouseup(): JQuery; + /** + * Bind an event handler to the "mouseup" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseup" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Remove an event handler. + */ + off(): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @param handler A handler function previously attached for the event(s), or the special value false. + */ + off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param handler A handler function previously attached for the event(s), or the special value false. + */ + off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s). + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + */ + off(events: { [key: string]: any; }, selector?: string): JQuery; + + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). + */ + on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + on(events: { [key: string]: any; }, data?: any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute at the time the event is triggered. + */ + one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + * @param data An object containing data that will be passed to the event handler. + * @param handler A function to execute at the time the event is triggered. + */ + one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + one(events: { [key: string]: any; }, data?: any): JQuery; + + + /** + * Specify a function to execute when the DOM is fully loaded. + * + * @param handler A function to execute after the DOM is ready. + */ + ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery; + + /** + * Trigger the "resize" event on an element. + */ + resize(): JQuery; + /** + * Bind an event handler to the "resize" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + */ + resize(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "resize" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "scroll" event on an element. + */ + scroll(): JQuery; + /** + * Bind an event handler to the "scroll" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + */ + scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "scroll" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "select" event on an element. + */ + select(): JQuery; + /** + * Bind an event handler to the "select" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + */ + select(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "select" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "submit" event on an element. + */ + submit(): JQuery; + /** + * Bind an event handler to the "submit" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + submit(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "submit" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters Additional parameters to pass along to the event handler. + */ + trigger(eventType: string, extraParameters?: any[]|Object): JQuery; + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param event A jQuery.Event object. + * @param extraParameters Additional parameters to pass along to the event handler. + */ + trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery; + + /** + * Execute all handlers attached to an element for an event. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters An array of additional parameters to pass along to the event handler. + */ + triggerHandler(eventType: string, ...extraParameters: any[]): Object; + + /** + * Execute all handlers attached to an element for an event. + * + * @param event A jQuery.Event object. + * @param extraParameters An array of additional parameters to pass along to the event handler. + */ + triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object; + + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param handler The function that is to be no longer executed. + */ + unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). + */ + unbind(eventType: string, fls: boolean): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param evt A JavaScript event object as passed to an event handler. + */ + unbind(evt: any): JQuery; + + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + */ + undelegate(): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" + * @param handler A function to execute at the time the event is triggered. + */ + undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param events An object of one or more event types and previously bound functions to unbind from them. + */ + undelegate(selector: string, events: Object): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param namespace A string containing a namespace to unbind all events from. + */ + undelegate(namespace: string): JQuery; + + /** + * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) + * + * @param handler A function to execute when the event is triggered. + */ + unload(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) + * + * @param eventData A plain object of data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10) + */ + context: Element; + + jquery: string; + + /** + * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) + * + * @param handler A function to execute when the event is triggered. + */ + error(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) + * + * @param eventData A plain object of data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + */ + pushStack(elements: any[]): JQuery; + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @param name The name of a jQuery method that generated the array of elements. + * @param arguments The arguments that were passed in to the jQuery method (for serialization). + */ + pushStack(elements: any[], name: string, arguments: any[]): JQuery; + + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. + */ + after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + after(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. + */ + append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + */ + append(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert every element in the set of matched elements to the end of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. + */ + appendTo(target: JQuery|any[]|Element|string): JQuery; + + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. + */ + before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + before(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Create a deep copy of the set of matched elements. + * + * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. + * param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). + */ + clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; + + /** + * Remove the set of matched elements from the DOM. + * + * param selector A selector expression that filters the set of matched elements to be removed. + */ + detach(selector?: string): JQuery; + + /** + * Remove all child nodes of the set of matched elements from the DOM. + */ + empty(): JQuery; + + /** + * Insert every element in the set of matched elements after the target. + * + * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. + */ + insertAfter(target: JQuery|any[]|Element|Text|string): JQuery; + + /** + * Insert every element in the set of matched elements before the target. + * + * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. + */ + insertBefore(target: JQuery|any[]|Element|Text|string): JQuery; + + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. + */ + prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + */ + prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert every element in the set of matched elements to the beginning of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. + */ + prependTo(target: JQuery|any[]|Element|string): JQuery; + + /** + * Remove the set of matched elements from the DOM. + * + * @param selector A selector expression that filters the set of matched elements to be removed. + */ + remove(selector?: string): JQuery; + + /** + * Replace each target element with the set of matched elements. + * + * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. + */ + replaceAll(target: JQuery|any[]|Element|string): JQuery; + + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. + */ + replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery; + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * param func A function that returns content with which to replace the set of matched elements. + */ + replaceWith(func: () => Element|JQuery): JQuery; + + /** + * Get the combined text contents of each element in the set of matched elements, including their descendants. + */ + text(): string; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation. + */ + text(text: string|number|boolean): JQuery; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. + */ + text(func: (index: number, text: string) => string): JQuery; + + /** + * Retrieve all the elements contained in the jQuery set, as an array. + */ + toArray(): any[]; + + /** + * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. + */ + unwrap(): JQuery; + + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + */ + wrap(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + wrap(func: (index: number) => string|JQuery): JQuery; + + /** + * Wrap an HTML structure around all elements in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + */ + wrapAll(wrappingElement: JQuery|Element|string): JQuery; + wrapAll(func: (index: number) => string): JQuery; + + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. + */ + wrapInner(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + wrapInner(func: (index: number) => string): JQuery; + + /** + * Iterate over a jQuery object, executing a function for each matched element. + * + * @param func A function to execute for each matched element. + */ + each(func: (index: number, elem: Element) => any): JQuery; + + /** + * Retrieve one of the elements matched by the jQuery object. + * + * @param index A zero-based integer indicating which element to retrieve. + */ + get(index: number): HTMLElement; + /** + * Retrieve the elements matched by the jQuery object. + */ + get(): any[]; + + /** + * Search for a given element from among the matched elements. + */ + index(): number; + /** + * Search for a given element from among the matched elements. + * + * @param selector A selector representing a jQuery collection in which to look for an element. + */ + index(selector: string|JQuery|Element): number; + + /** + * The number of elements in the jQuery object. + */ + length: number; + /** + * A selector representing selector passed to jQuery(), if any, when creating the original set. + * version deprecated: 1.7, removed: 1.9 + */ + selector: string; + [index: string]: any; + [index: number]: HTMLElement; + + /** + * Add elements to the set of matched elements. + * + * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. + * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. + */ + add(selector: string, context?: Element): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param elements One or more elements to add to the set of matched elements. + */ + add(...elements: Element[]): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param html An HTML fragment to add to the set of matched elements. + */ + add(html: string): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param obj An existing jQuery object to add to the set of matched elements. + */ + add(obj: JQuery): JQuery; + + /** + * Get the children of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + children(selector?: string): JQuery; + + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + */ + closest(selector: string): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + */ + closest(selector: string, context?: Element): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param obj A jQuery object to match elements against. + */ + closest(obj: JQuery): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param element An element to match elements against. + */ + closest(element: Element): JQuery; + + /** + * Get an array of all the elements and selectors matched against the current element up through the DOM tree. + * + * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object). + * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + */ + closest(selectors: any, context?: Element): any[]; + + /** + * Get the children of each element in the set of matched elements, including text and comment nodes. + */ + contents(): JQuery; + + /** + * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. + */ + end(): JQuery; + + /** + * Reduce the set of matched elements to the one at the specified index. + * + * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set. + * + */ + eq(index: number): JQuery; + + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param selector A string containing a selector expression to match the current set of elements against. + */ + filter(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param func A function used as a test for each element in the set. this is the current DOM element. + */ + filter(func: (index: number, element: Element) => any): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param element An element to match the current set of elements against. + */ + filter(element: Element): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ + filter(obj: JQuery): JQuery; + + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param selector A string containing a selector expression to match elements against. + */ + find(selector: string): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param element An element to match elements against. + */ + find(element: Element): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param obj A jQuery object to match elements against. + */ + find(obj: JQuery): JQuery; + + /** + * Reduce the set of matched elements to the first in the set. + */ + first(): JQuery; + + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + */ + has(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param contained A DOM element to match elements against. + */ + has(contained: Element): JQuery; + + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + */ + is(selector: string): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. + */ + is(func: (index: number, element: Element) => boolean): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ + is(obj: JQuery): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + */ + is(elements: any): boolean; + + /** + * Reduce the set of matched elements to the final one in the set. + */ + last(): JQuery; + + /** + * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. + * + * @param callback A function object that will be invoked for each element in the current set. + */ + map(callback: (index: number, domElement: Element) => any): JQuery; + + /** + * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + next(selector?: string): JQuery; + + /** + * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + nextAll(selector?: string): JQuery; + + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + nextUntil(selector?: string, filter?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + nextUntil(element?: Element, filter?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + nextUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Remove elements from the set of matched elements. + * + * @param selector A string containing a selector expression to match elements against. + */ + not(selector: string): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param func A function used as a test for each element in the set. this is the current DOM element. + */ + not(func: (index: number, element: Element) => boolean): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param elements One or more DOM elements to remove from the matched set. + */ + not(elements: Element|Element[]): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ + not(obj: JQuery): JQuery; + + /** + * Get the closest ancestor element that is positioned. + */ + offsetParent(): JQuery; + + /** + * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + parent(selector?: string): JQuery; + + /** + * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + parents(selector?: string): JQuery; + + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ + parentsUntil(selector?: string, filter?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ + parentsUntil(element?: Element, filter?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ + parentsUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + prev(selector?: string): JQuery; + + /** + * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + prevAll(selector?: string): JQuery; + + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + prevUntil(selector?: string, filter?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + prevUntil(element?: Element, filter?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + prevUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + siblings(selector?: string): JQuery; + + /** + * Reduce the set of matched elements to a subset specified by a range of indices. + * + * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. + * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. + */ + slice(start: number, end?: number): JQuery; + + /** + * Show the queue of functions to be executed on the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + queue(queueName?: string): any[]; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. + */ + queue(callback: Function): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(queueName: string, newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. + */ + queue(queueName: string, callback: Function): JQuery; +} +declare module "jquery" { + export = $; +} +declare var jQuery: JQueryStatic; +declare var $: JQueryStatic; diff --git a/lib/decl/lib.es6.d.ts b/lib/decl/lib.es6.d.ts new file mode 100644 index 000000000..ef3399ba8 --- /dev/null +++ b/lib/decl/lib.es6.d.ts @@ -0,0 +1,18634 @@ +/*! *****************************************************************************
+Copyright (c) Microsoft Corporation. All rights reserved.
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+
+declare type PropertyKey = string | number | symbol;
+
+interface Symbol {
+ /** Returns a string representation of an object. */
+ toString(): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): Object;
+
+ [Symbol.toStringTag]: "Symbol";
+}
+
+interface SymbolConstructor {
+ /**
+ * A reference to the prototype.
+ */
+ prototype: Symbol;
+
+ /**
+ * Returns a new unique Symbol value.
+ * @param description Description of the new Symbol object.
+ */
+ (description?: string|number): symbol;
+
+ /**
+ * Returns a Symbol object from the global symbol registry matching the given key if found.
+ * Otherwise, returns a new symbol with this key.
+ * @param key key to search for.
+ */
+ for(key: string): symbol;
+
+ /**
+ * Returns a key from the global symbol registry matching the given Symbol if found.
+ * Otherwise, returns a undefined.
+ * @param sym Symbol to find the key for.
+ */
+ keyFor(sym: symbol): string;
+
+ // Well-known Symbols
+
+ /**
+ * A method that determines if a constructor object recognizes an object as one of the
+ * constructor’s instances. Called by the semantics of the instanceof operator.
+ */
+ hasInstance: symbol;
+
+ /**
+ * A Boolean value that if true indicates that an object should flatten to its array elements
+ * by Array.prototype.concat.
+ */
+ isConcatSpreadable: symbol;
+
+ /**
+ * A method that returns the default iterator for an object. Called by the semantics of the
+ * for-of statement.
+ */
+ iterator: symbol;
+
+ /**
+ * A regular expression method that matches the regular expression against a string. Called
+ * by the String.prototype.match method.
+ */
+ match: symbol;
+
+ /**
+ * A regular expression method that replaces matched substrings of a string. Called by the
+ * String.prototype.replace method.
+ */
+ replace: symbol;
+
+ /**
+ * A regular expression method that returns the index within a string that matches the
+ * regular expression. Called by the String.prototype.search method.
+ */
+ search: symbol;
+
+ /**
+ * A function valued property that is the constructor function that is used to create
+ * derived objects.
+ */
+ species: symbol;
+
+ /**
+ * A regular expression method that splits a string at the indices that match the regular
+ * expression. Called by the String.prototype.split method.
+ */
+ split: symbol;
+
+ /**
+ * A method that converts an object to a corresponding primitive value.
+ * Called by the ToPrimitive abstract operation.
+ */
+ toPrimitive: symbol;
+
+ /**
+ * A String value that is used in the creation of the default string description of an object.
+ * Called by the built-in method Object.prototype.toString.
+ */
+ toStringTag: symbol;
+
+ /**
+ * An Object whose own property names are property names that are excluded from the 'with'
+ * environment bindings of the associated objects.
+ */
+ unscopables: symbol;
+}
+declare var Symbol: SymbolConstructor;
+
+interface Object {
+ /**
+ * Determines whether an object has a property with the specified name.
+ * @param v A property name.
+ */
+ hasOwnProperty(v: PropertyKey): boolean;
+
+ /**
+ * Determines whether a specified property is enumerable.
+ * @param v A property name.
+ */
+ propertyIsEnumerable(v: PropertyKey): boolean;
+}
+
+interface ObjectConstructor {
+ /**
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
+ * target object. Returns the target object.
+ * @param target The target object to copy to.
+ * @param source The source object from which to copy properties.
+ */
+ assign<T, U>(target: T, source: U): T & U;
+
+ /**
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
+ * target object. Returns the target object.
+ * @param target The target object to copy to.
+ * @param source1 The first source object from which to copy properties.
+ * @param source2 The second source object from which to copy properties.
+ */
+ assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
+
+ /**
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
+ * target object. Returns the target object.
+ * @param target The target object to copy to.
+ * @param source1 The first source object from which to copy properties.
+ * @param source2 The second source object from which to copy properties.
+ * @param source3 The third source object from which to copy properties.
+ */
+ assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
+
+ /**
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
+ * target object. Returns the target object.
+ * @param target The target object to copy to.
+ * @param sources One or more source objects from which to copy properties
+ */
+ assign(target: any, ...sources: any[]): any;
+
+ /**
+ * Returns an array of all symbol properties found directly on object o.
+ * @param o Object to retrieve the symbols from.
+ */
+ getOwnPropertySymbols(o: any): symbol[];
+
+ /**
+ * Returns true if the values are the same value, false otherwise.
+ * @param value1 The first value.
+ * @param value2 The second value.
+ */
+ is(value1: any, value2: any): boolean;
+
+ /**
+ * Sets the prototype of a specified object o to object proto or null. Returns the object o.
+ * @param o The object to change its prototype.
+ * @param proto The value of the new prototype or null.
+ */
+ setPrototypeOf(o: any, proto: any): any;
+
+ /**
+ * Gets the own property descriptor of the specified object.
+ * An own property descriptor is one that is defined directly on the object and is not
+ * inherited from the object's prototype.
+ * @param o Object that contains the property.
+ * @param p Name of the property.
+ */
+ getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor;
+
+ /**
+ * Adds a property to an object, or modifies attributes of an existing property.
+ * @param o Object on which to add or modify the property. This can be a native JavaScript
+ * object (that is, a user-defined object or a built in object) or a DOM object.
+ * @param p The property name.
+ * @param attributes Descriptor for the property. It can be for a data property or an accessor
+ * property.
+ */
+ defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;
+}
+
+interface Function {
+ /**
+ * Returns the name of the function. Function names are read-only and can not be changed.
+ */
+ name: string;
+
+ /**
+ * Determines whether the given value inherits from this function if this function was used
+ * as a constructor function.
+ *
+ * A constructor function can control which objects are recognized as its instances by
+ * 'instanceof' by overriding this method.
+ */
+ [Symbol.hasInstance](value: any): boolean;
+}
+
+interface NumberConstructor {
+ /**
+ * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
+ * that is representable as a Number value, which is approximately:
+ * 2.2204460492503130808472633361816 x 10−16.
+ */
+ EPSILON: number;
+
+ /**
+ * Returns true if passed value is finite.
+ * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
+ * number. Only finite values of the type number, result in true.
+ * @param number A numeric value.
+ */
+ isFinite(number: number): boolean;
+
+ /**
+ * Returns true if the value passed is an integer, false otherwise.
+ * @param number A numeric value.
+ */
+ isInteger(number: number): boolean;
+
+ /**
+ * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
+ * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
+ * to a number. Only values of the type number, that are also NaN, result in true.
+ * @param number A numeric value.
+ */
+ isNaN(number: number): boolean;
+
+ /**
+ * Returns true if the value passed is a safe integer.
+ * @param number A numeric value.
+ */
+ isSafeInteger(number: number): boolean;
+
+ /**
+ * The value of the largest integer n such that n and n + 1 are both exactly representable as
+ * a Number value.
+ * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
+ */
+ MAX_SAFE_INTEGER: number;
+
+ /**
+ * The value of the smallest integer n such that n and n − 1 are both exactly representable as
+ * a Number value.
+ * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
+ */
+ MIN_SAFE_INTEGER: number;
+
+ /**
+ * Converts a string to a floating-point number.
+ * @param string A string that contains a floating-point number.
+ */
+ parseFloat(string: string): number;
+
+ /**
+ * Converts A string to an integer.
+ * @param s A string to convert into a number.
+ * @param radix A value between 2 and 36 that specifies the base of the number in numString.
+ * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
+ * All other strings are considered decimal.
+ */
+ parseInt(string: string, radix?: number): number;
+}
+
+interface Array<T> {
+ /** Iterator */
+ [Symbol.iterator](): IterableIterator<T>;
+
+ /**
+ * Returns an object whose properties have the value 'true'
+ * when they will be absent when used in a 'with' statement.
+ */
+ [Symbol.unscopables](): {
+ copyWithin: boolean;
+ entries: boolean;
+ fill: boolean;
+ find: boolean;
+ findIndex: boolean;
+ keys: boolean;
+ values: boolean;
+ };
+
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, T]>;
+
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<T>;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: T, start?: number, end?: number): T[];
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): T[];
+}
+
+interface IArguments {
+ /** Iterator */
+ [Symbol.iterator](): IterableIterator<any>;
+}
+
+interface ArrayConstructor {
+ /**
+ * Creates an array from an array-like object.
+ * @param arrayLike An array-like object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
+
+ /**
+ * Creates an array from an iterable object.
+ * @param iterable An iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from<T, U>(iterable: Iterable<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
+
+ /**
+ * Creates an array from an array-like object.
+ * @param arrayLike An array-like object to convert to an array.
+ */
+ from<T>(arrayLike: ArrayLike<T>): Array<T>;
+
+ /**
+ * Creates an array from an iterable object.
+ * @param iterable An iterable object to convert to an array.
+ */
+ from<T>(iterable: Iterable<T>): Array<T>;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of<T>(...items: T[]): Array<T>;
+}
+
+interface String {
+ /** Iterator */
+ [Symbol.iterator](): IterableIterator<string>;
+
+ /**
+ * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
+ * value of the UTF-16 encoded code point starting at the string element at position pos in
+ * the String resulting from converting this object to a String.
+ * If there is no element at that position, the result is undefined.
+ * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
+ */
+ codePointAt(pos: number): number;
+
+ /**
+ * Returns true if searchString appears as a substring of the result of converting this
+ * object to a String, at one or more positions that are
+ * greater than or equal to position; otherwise, returns false.
+ * @param searchString search string
+ * @param position If position is undefined, 0 is assumed, so as to search all of the String.
+ */
+ includes(searchString: string, position?: number): boolean;
+
+ /**
+ * Returns true if the sequence of elements of searchString converted to a String is the
+ * same as the corresponding elements of this object (converted to a String) starting at
+ * endPosition – length(this). Otherwise returns false.
+ */
+ endsWith(searchString: string, endPosition?: number): boolean;
+
+ /**
+ * Returns the String value result of normalizing the string into the normalization form
+ * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.
+ * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default
+ * is "NFC"
+ */
+ normalize(form?: string): string;
+
+ /**
+ * Returns a String value that is made from count copies appended together. If count is 0,
+ * T is the empty String is returned.
+ * @param count number of copies to append
+ */
+ repeat(count: number): string;
+
+ /**
+ * Returns true if the sequence of elements of searchString converted to a String is the
+ * same as the corresponding elements of this object (converted to a String) starting at
+ * position. Otherwise returns false.
+ */
+ startsWith(searchString: string, position?: number): boolean;
+
+ // Overloads for objects with methods of well-known symbols.
+
+ /**
+ * Matches a string an object that supports being matched against, and returns an array containing the results of that search.
+ * @param matcher An object that supports being matched against.
+ */
+ match(matcher: { [Symbol.match](string: string): RegExpMatchArray; }): RegExpMatchArray;
+
+ /**
+ * Replaces text in a string, using an object that supports replacement within a string.
+ * @param searchValue A object can search for and replace matches within a string.
+ * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
+ */
+ replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;
+
+ /**
+ * Replaces text in a string, using an object that supports replacement within a string.
+ * @param searchValue A object can search for and replace matches within a string.
+ * @param replacer A function that returns the replacement text.
+ */
+ replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string;
+
+ /**
+ * Finds the first substring match in a regular expression search.
+ * @param searcher An object which supports searching within a string.
+ */
+ search(searcher: { [Symbol.search](string: string): number; }): number;
+
+ /**
+ * Split a string into substrings using the specified separator and return them as an array.
+ * @param splitter An object that can split a string.
+ * @param limit A value used to limit the number of elements returned in the array.
+ */
+ split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[];
+
+ /**
+ * Returns an <a> HTML anchor element and sets the name attribute to the text value
+ * @param name
+ */
+ anchor(name: string): string;
+
+ /** Returns a <big> HTML element */
+ big(): string;
+
+ /** Returns a <blink> HTML element */
+ blink(): string;
+
+ /** Returns a <b> HTML element */
+ bold(): string;
+
+ /** Returns a <tt> HTML element */
+ fixed(): string
+
+ /** Returns a <font> HTML element and sets the color attribute value */
+ fontcolor(color: string): string
+
+ /** Returns a <font> HTML element and sets the size attribute value */
+ fontsize(size: number): string;
+
+ /** Returns a <font> HTML element and sets the size attribute value */
+ fontsize(size: string): string;
+
+ /** Returns an <i> HTML element */
+ italics(): string;
+
+ /** Returns an <a> HTML element and sets the href attribute value */
+ link(url: string): string;
+
+ /** Returns a <small> HTML element */
+ small(): string;
+
+ /** Returns a <strike> HTML element */
+ strike(): string;
+
+ /** Returns a <sub> HTML element */
+ sub(): string;
+
+ /** Returns a <sup> HTML element */
+ sup(): string;
+}
+
+interface StringConstructor {
+ /**
+ * Return the String value whose elements are, in order, the elements in the List elements.
+ * If length is 0, the empty string is returned.
+ */
+ fromCodePoint(...codePoints: number[]): string;
+
+ /**
+ * String.raw is intended for use as a tag function of a Tagged Template String. When called
+ * as such the first argument will be a well formed template call site object and the rest
+ * parameter will contain the substitution values.
+ * @param template A well-formed template string call site representation.
+ * @param substitutions A set of substitution values.
+ */
+ raw(template: TemplateStringsArray, ...substitutions: any[]): string;
+}
+
+interface IteratorResult<T> {
+ done: boolean;
+ value?: T;
+}
+
+interface Iterator<T> {
+ next(value?: any): IteratorResult<T>;
+ return?(value?: any): IteratorResult<T>;
+ throw?(e?: any): IteratorResult<T>;
+}
+
+interface Iterable<T> {
+ [Symbol.iterator](): Iterator<T>;
+}
+
+interface IterableIterator<T> extends Iterator<T> {
+ [Symbol.iterator](): IterableIterator<T>;
+}
+
+interface GeneratorFunction extends Function {
+ [Symbol.toStringTag]: "GeneratorFunction";
+}
+
+interface GeneratorFunctionConstructor {
+ /**
+ * Creates a new Generator function.
+ * @param args A list of arguments the function accepts.
+ */
+ new (...args: string[]): GeneratorFunction;
+ (...args: string[]): GeneratorFunction;
+ prototype: GeneratorFunction;
+}
+declare var GeneratorFunction: GeneratorFunctionConstructor;
+
+interface Math {
+ /**
+ * Returns the number of leading zero bits in the 32-bit binary representation of a number.
+ * @param x A numeric expression.
+ */
+ clz32(x: number): number;
+
+ /**
+ * Returns the result of 32-bit multiplication of two numbers.
+ * @param x First number
+ * @param y Second number
+ */
+ imul(x: number, y: number): number;
+
+ /**
+ * Returns the sign of the x, indicating whether x is positive, negative or zero.
+ * @param x The numeric expression to test
+ */
+ sign(x: number): number;
+
+ /**
+ * Returns the base 10 logarithm of a number.
+ * @param x A numeric expression.
+ */
+ log10(x: number): number;
+
+ /**
+ * Returns the base 2 logarithm of a number.
+ * @param x A numeric expression.
+ */
+ log2(x: number): number;
+
+ /**
+ * Returns the natural logarithm of 1 + x.
+ * @param x A numeric expression.
+ */
+ log1p(x: number): number;
+
+ /**
+ * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of
+ * the natural logarithms).
+ * @param x A numeric expression.
+ */
+ expm1(x: number): number;
+
+ /**
+ * Returns the hyperbolic cosine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ cosh(x: number): number;
+
+ /**
+ * Returns the hyperbolic sine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ sinh(x: number): number;
+
+ /**
+ * Returns the hyperbolic tangent of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ tanh(x: number): number;
+
+ /**
+ * Returns the inverse hyperbolic cosine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ acosh(x: number): number;
+
+ /**
+ * Returns the inverse hyperbolic sine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ asinh(x: number): number;
+
+ /**
+ * Returns the inverse hyperbolic tangent of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ atanh(x: number): number;
+
+ /**
+ * Returns the square root of the sum of squares of its arguments.
+ * @param values Values to compute the square root for.
+ * If no arguments are passed, the result is +0.
+ * If there is only one argument, the result is the absolute value.
+ * If any argument is +Infinity or -Infinity, the result is +Infinity.
+ * If any argument is NaN, the result is NaN.
+ * If all arguments are either +0 or −0, the result is +0.
+ */
+ hypot(...values: number[] ): number;
+
+ /**
+ * Returns the integral part of the a numeric expression, x, removing any fractional digits.
+ * If x is already an integer, the result is x.
+ * @param x A numeric expression.
+ */
+ trunc(x: number): number;
+
+ /**
+ * Returns the nearest single precision float representation of a number.
+ * @param x A numeric expression.
+ */
+ fround(x: number): number;
+
+ /**
+ * Returns an implementation-dependent approximation to the cube root of number.
+ * @param x A numeric expression.
+ */
+ cbrt(x: number): number;
+
+ [Symbol.toStringTag]: "Math";
+}
+
+interface Date {
+ /**
+ * Converts a Date object to a string.
+ */
+ [Symbol.toPrimitive](hint: "default"): string;
+ /**
+ * Converts a Date object to a string.
+ */
+ [Symbol.toPrimitive](hint: "string"): string;
+ /**
+ * Converts a Date object to a number.
+ */
+ [Symbol.toPrimitive](hint: "number"): number;
+ /**
+ * Converts a Date object to a string or number.
+ *
+ * @param hint The strings "number", "string", or "default" to specify what primitive to return.
+ *
+ * @throws {TypeError} If 'hint' was given something other than "number", "string", or "default".
+ * @returns A number if 'hint' was "number", a string if 'hint' was "string" or "default".
+ */
+ [Symbol.toPrimitive](hint: string): string | number;
+}
+
+interface RegExp {
+ /**
+ * Matches a string with this regular expression, and returns an array containing the results of
+ * that search.
+ * @param string A string to search within.
+ */
+ [Symbol.match](string: string): RegExpMatchArray;
+
+ /**
+ * Replaces text in a string, using this regular expression.
+ * @param string A String object or string literal whose contents matching against
+ * this regular expression will be replaced
+ * @param replaceValue A String object or string literal containing the text to replace for every
+ * successful match of this regular expression.
+ */
+ [Symbol.replace](string: string, replaceValue: string): string;
+
+ /**
+ * Replaces text in a string, using this regular expression.
+ * @param string A String object or string literal whose contents matching against
+ * this regular expression will be replaced
+ * @param replacer A function that returns the replacement text.
+ */
+ [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;
+
+ /**
+ * Finds the position beginning first substring match in a regular expression search
+ * using this regular expression.
+ *
+ * @param string The string to search within.
+ */
+ [Symbol.search](string: string): number;
+
+ /**
+ * Returns an array of substrings that were delimited by strings in the original input that
+ * match against this regular expression.
+ *
+ * If the regular expression contains capturing parentheses, then each time this
+ * regular expression matches, the results (including any undefined results) of the
+ * capturing parentheses are spliced.
+ *
+ * @param string string value to split
+ * @param limit if not undefined, the output array is truncated so that it contains no more
+ * than 'limit' elements.
+ */
+ [Symbol.split](string: string, limit?: number): string[];
+
+ /**
+ * Returns a string indicating the flags of the regular expression in question. This field is read-only.
+ * The characters in this string are sequenced and concatenated in the following order:
+ *
+ * - "g" for global
+ * - "i" for ignoreCase
+ * - "m" for multiline
+ * - "u" for unicode
+ * - "y" for sticky
+ *
+ * If no flags are set, the value is the empty string.
+ */
+ flags: string;
+
+ /**
+ * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular
+ * expression. Default is false. Read-only.
+ */
+ sticky: boolean;
+
+ /**
+ * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular
+ * expression. Default is false. Read-only.
+ */
+ unicode: boolean;
+}
+
+interface RegExpConstructor {
+ [Symbol.species](): RegExpConstructor;
+}
+
+interface Map<K, V> {
+ clear(): void;
+ delete(key: K): boolean;
+ entries(): IterableIterator<[K, V]>;
+ forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
+ get(key: K): V;
+ has(key: K): boolean;
+ keys(): IterableIterator<K>;
+ set(key: K, value?: V): Map<K, V>;
+ size: number;
+ values(): IterableIterator<V>;
+ [Symbol.iterator]():IterableIterator<[K,V]>;
+ [Symbol.toStringTag]: "Map";
+}
+
+interface MapConstructor {
+ new (): Map<any, any>;
+ new <K, V>(): Map<K, V>;
+ new <K, V>(iterable: Iterable<[K, V]>): Map<K, V>;
+ prototype: Map<any, any>;
+}
+declare var Map: MapConstructor;
+
+interface WeakMap<K, V> {
+ clear(): void;
+ delete(key: K): boolean;
+ get(key: K): V;
+ has(key: K): boolean;
+ set(key: K, value?: V): WeakMap<K, V>;
+ [Symbol.toStringTag]: "WeakMap";
+}
+
+interface WeakMapConstructor {
+ new (): WeakMap<any, any>;
+ new <K, V>(): WeakMap<K, V>;
+ new <K, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
+ prototype: WeakMap<any, any>;
+}
+declare var WeakMap: WeakMapConstructor;
+
+interface Set<T> {
+ add(value: T): Set<T>;
+ clear(): void;
+ delete(value: T): boolean;
+ entries(): IterableIterator<[T, T]>;
+ forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
+ has(value: T): boolean;
+ keys(): IterableIterator<T>;
+ size: number;
+ values(): IterableIterator<T>;
+ [Symbol.iterator]():IterableIterator<T>;
+ [Symbol.toStringTag]: "Set";
+}
+
+interface SetConstructor {
+ new (): Set<any>;
+ new <T>(): Set<T>;
+ new <T>(iterable: Iterable<T>): Set<T>;
+ prototype: Set<any>;
+}
+declare var Set: SetConstructor;
+
+interface WeakSet<T> {
+ add(value: T): WeakSet<T>;
+ clear(): void;
+ delete(value: T): boolean;
+ has(value: T): boolean;
+ [Symbol.toStringTag]: "WeakSet";
+}
+
+interface WeakSetConstructor {
+ new (): WeakSet<any>;
+ new <T>(): WeakSet<T>;
+ new <T>(iterable: Iterable<T>): WeakSet<T>;
+ prototype: WeakSet<any>;
+}
+declare var WeakSet: WeakSetConstructor;
+
+interface JSON {
+ [Symbol.toStringTag]: "JSON";
+}
+
+/**
+ * Represents a raw buffer of binary data, which is used to store data for the
+ * different typed arrays. ArrayBuffers cannot be read from or written to directly,
+ * but can be passed to a typed array or DataView Object to interpret the raw
+ * buffer as needed.
+ */
+interface ArrayBuffer {
+ [Symbol.toStringTag]: "ArrayBuffer";
+}
+
+interface DataView {
+ [Symbol.toStringTag]: "DataView";
+}
+
+/**
+ * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
+ * number of bytes could not be allocated an exception is raised.
+ */
+interface Int8Array {
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+ [Symbol.iterator](): IterableIterator<number>;
+ [Symbol.toStringTag]: "Int8Array";
+}
+
+interface Int8ArrayConstructor {
+ new (elements: Iterable<number>): Int8Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;
+}
+
+/**
+ * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint8Array {
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+ [Symbol.iterator](): IterableIterator<number>;
+ [Symbol.toStringTag]: "UInt8Array";
+}
+
+interface Uint8ArrayConstructor {
+ new (elements: Iterable<number>): Uint8Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;
+}
+
+/**
+ * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
+ * If the requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint8ClampedArray {
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+
+ [Symbol.iterator](): IterableIterator<number>;
+ [Symbol.toStringTag]: "Uint8ClampedArray";
+}
+
+interface Uint8ClampedArrayConstructor {
+ new (elements: Iterable<number>): Uint8ClampedArray;
+
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;
+}
+
+/**
+ * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Int16Array {
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+
+
+ [Symbol.iterator](): IterableIterator<number>;
+ [Symbol.toStringTag]: "Int16Array";
+}
+
+interface Int16ArrayConstructor {
+ new (elements: Iterable<number>): Int16Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;
+}
+
+/**
+ * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint16Array {
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+ [Symbol.iterator](): IterableIterator<number>;
+ [Symbol.toStringTag]: "Uint16Array";
+}
+
+interface Uint16ArrayConstructor {
+ new (elements: Iterable<number>): Uint16Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;
+}
+
+/**
+ * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Int32Array {
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+ [Symbol.iterator](): IterableIterator<number>;
+ [Symbol.toStringTag]: "Int32Array";
+}
+
+interface Int32ArrayConstructor {
+ new (elements: Iterable<number>): Int32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;
+}
+
+/**
+ * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint32Array {
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+ [Symbol.iterator](): IterableIterator<number>;
+ [Symbol.toStringTag]: "Uint32Array";
+}
+
+interface Uint32ArrayConstructor {
+ new (elements: Iterable<number>): Uint32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;
+}
+
+/**
+ * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
+ * of bytes could not be allocated an exception is raised.
+ */
+interface Float32Array {
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+ [Symbol.iterator](): IterableIterator<number>;
+ [Symbol.toStringTag]: "Float32Array";
+}
+
+interface Float32ArrayConstructor {
+ new (elements: Iterable<number>): Float32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;
+}
+
+/**
+ * A typed array of 64-bit float values. The contents are initialized to 0. If the requested
+ * number of bytes could not be allocated an exception is raised.
+ */
+interface Float64Array {
+ /**
+ * Returns an array of key, value pairs for every entry in the array
+ */
+ entries(): IterableIterator<[number, number]>;
+ /**
+ * Returns an list of keys in the array
+ */
+ keys(): IterableIterator<number>;
+ /**
+ * Returns an list of values in the array
+ */
+ values(): IterableIterator<number>;
+ [Symbol.iterator](): IterableIterator<number>;
+ [Symbol.toStringTag]: "Float64Array";
+}
+
+interface Float64ArrayConstructor {
+ new (elements: Iterable<number>): Float64Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
+}
+
+interface ProxyHandler<T> {
+ getPrototypeOf? (target: T): any;
+ setPrototypeOf? (target: T, v: any): boolean;
+ isExtensible? (target: T): boolean;
+ preventExtensions? (target: T): boolean;
+ getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor;
+ has? (target: T, p: PropertyKey): boolean;
+ get? (target: T, p: PropertyKey, receiver: any): any;
+ set? (target: T, p: PropertyKey, value: any, receiver: any): boolean;
+ deleteProperty? (target: T, p: PropertyKey): boolean;
+ defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean;
+ enumerate? (target: T): PropertyKey[];
+ ownKeys? (target: T): PropertyKey[];
+ apply? (target: T, thisArg: any, argArray?: any): any;
+ construct? (target: T, thisArg: any, argArray?: any): any;
+}
+
+interface ProxyConstructor {
+ revocable<T>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
+ new <T>(target: T, handler: ProxyHandler<T>): T
+}
+declare var Proxy: ProxyConstructor;
+
+declare namespace Reflect {
+ function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
+ function construct(target: Function, argumentsList: ArrayLike<any>, newTarget?: any): any;
+ function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
+ function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
+ function enumerate(target: any): IterableIterator<any>;
+ function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
+ function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
+ function getPrototypeOf(target: any): any;
+ function has(target: any, propertyKey: string): boolean;
+ function has(target: any, propertyKey: symbol): boolean;
+ function isExtensible(target: any): boolean;
+ function ownKeys(target: any): Array<PropertyKey>;
+ function preventExtensions(target: any): boolean;
+ function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
+ function setPrototypeOf(target: any, proto: any): boolean;
+}
+
+/**
+ * Represents the completion of an asynchronous operation
+ */
+interface Promise<T> {
+ /**
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
+ * @param onfulfilled The callback to execute when the Promise is resolved.
+ * @param onrejected The callback to execute when the Promise is rejected.
+ * @returns A Promise for the completion of which ever callback is executed.
+ */
+ then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
+ then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
+
+ /**
+ * Attaches a callback for only the rejection of the Promise.
+ * @param onrejected The callback to execute when the Promise is rejected.
+ * @returns A Promise for the completion of the callback.
+ */
+ catch(onrejected?: (reason: any) => T | PromiseLike<T>): Promise<T>;
+ catch(onrejected?: (reason: any) => void): Promise<T>;
+
+ [Symbol.toStringTag]: "Promise";
+}
+
+interface PromiseConstructor {
+ /**
+ * A reference to the prototype.
+ */
+ prototype: Promise<any>;
+
+ /**
+ * Creates a new Promise.
+ * @param executor A callback used to initialize the promise. This callback is passed two arguments:
+ * a resolve callback used resolve the promise with a value or the result of another promise,
+ * and a reject callback used to reject the promise with a provided reason or error.
+ */
+ new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
+
+ /**
+ * Creates a Promise that is resolved with an array of results when all of the provided Promises
+ * resolve, or rejected when any Promise is rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ all<T1, T2>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;
+ all<T1, T2, T3>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<[T1, T2, T3]>;
+ all<T1, T2, T3, T4>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>]): Promise<[T1, T2, T3, T4]>;
+ all<T1, T2, T3, T4, T5>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>]): Promise<[T1, T2, T3, T4, T5]>;
+ all<T1, T2, T3, T4, T5, T6>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>]): Promise<[T1, T2, T3, T4, T5, T6]>;
+ all<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>]): Promise<[T1, T2, T3, T4, T5, T6, T7]>;
+ all<T1, T2, T3, T4, T5, T6, T7, T8>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>;
+ all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
+ all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike <T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>, T10 | PromiseLike<T10>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
+ all<TAll>(values: Iterable<TAll | PromiseLike<TAll>>): Promise<TAll[]>;
+
+ /**
+ * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
+ * or rejected.
+ * @param values An array of Promises.
+ * @returns A new Promise.
+ */
+ race<T>(values: Iterable<T | PromiseLike<T>>): Promise<T>;
+
+ /**
+ * Creates a new rejected promise for the provided reason.
+ * @param reason The reason the promise was rejected.
+ * @returns A new rejected Promise.
+ */
+ reject(reason: any): Promise<void>;
+
+ /**
+ * Creates a new rejected promise for the provided reason.
+ * @param reason The reason the promise was rejected.
+ * @returns A new rejected Promise.
+ */
+ reject<T>(reason: any): Promise<T>;
+
+ /**
+ * Creates a new resolved promise for the provided value.
+ * @param value A promise.
+ * @returns A promise whose internal state matches the provided promise.
+ */
+ resolve<T>(value: T | PromiseLike<T>): Promise<T>;
+
+ /**
+ * Creates a new resolved promise .
+ * @returns A resolved promise.
+ */
+ resolve(): Promise<void>;
+
+ [Symbol.species]: Function;
+}
+
+declare var Promise: PromiseConstructor;
+/// <reference no-default-lib="true"/>
+
+/////////////////////////////
+/// ECMAScript APIs
+/////////////////////////////
+
+declare var NaN: number;
+declare var Infinity: number;
+
+/**
+ * Evaluates JavaScript code and executes it.
+ * @param x A String value that contains valid JavaScript code.
+ */
+declare function eval(x: string): any;
+
+/**
+ * Converts A string to an integer.
+ * @param s A string to convert into a number.
+ * @param radix A value between 2 and 36 that specifies the base of the number in numString.
+ * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
+ * All other strings are considered decimal.
+ */
+declare function parseInt(s: string, radix?: number): number;
+
+/**
+ * Converts a string to a floating-point number.
+ * @param string A string that contains a floating-point number.
+ */
+declare function parseFloat(string: string): number;
+
+/**
+ * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).
+ * @param number A numeric value.
+ */
+declare function isNaN(number: number): boolean;
+
+/**
+ * Determines whether a supplied number is finite.
+ * @param number Any numeric value.
+ */
+declare function isFinite(number: number): boolean;
+
+/**
+ * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).
+ * @param encodedURI A value representing an encoded URI.
+ */
+declare function decodeURI(encodedURI: string): string;
+
+/**
+ * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).
+ * @param encodedURIComponent A value representing an encoded URI component.
+ */
+declare function decodeURIComponent(encodedURIComponent: string): string;
+
+/**
+ * Encodes a text string as a valid Uniform Resource Identifier (URI)
+ * @param uri A value representing an encoded URI.
+ */
+declare function encodeURI(uri: string): string;
+
+/**
+ * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
+ * @param uriComponent A value representing an encoded URI component.
+ */
+declare function encodeURIComponent(uriComponent: string): string;
+
+interface PropertyDescriptor {
+ configurable?: boolean;
+ enumerable?: boolean;
+ value?: any;
+ writable?: boolean;
+ get? (): any;
+ set? (v: any): void;
+}
+
+interface PropertyDescriptorMap {
+ [s: string]: PropertyDescriptor;
+}
+
+interface Object {
+ /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */
+ constructor: Function;
+
+ /** Returns a string representation of an object. */
+ toString(): string;
+
+ /** Returns a date converted to a string using the current locale. */
+ toLocaleString(): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): Object;
+
+ /**
+ * Determines whether an object has a property with the specified name.
+ * @param v A property name.
+ */
+ hasOwnProperty(v: string): boolean;
+
+ /**
+ * Determines whether an object exists in another object's prototype chain.
+ * @param v Another object whose prototype chain is to be checked.
+ */
+ isPrototypeOf(v: Object): boolean;
+
+ /**
+ * Determines whether a specified property is enumerable.
+ * @param v A property name.
+ */
+ propertyIsEnumerable(v: string): boolean;
+}
+
+interface ObjectConstructor {
+ new (value?: any): Object;
+ (): any;
+ (value: any): any;
+
+ /** A reference to the prototype for a class of objects. */
+ prototype: Object;
+
+ /**
+ * Returns the prototype of an object.
+ * @param o The object that references the prototype.
+ */
+ getPrototypeOf(o: any): any;
+
+ /**
+ * Gets the own property descriptor of the specified object.
+ * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.
+ * @param o Object that contains the property.
+ * @param p Name of the property.
+ */
+ getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor;
+
+ /**
+ * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly
+ * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.
+ * @param o Object that contains the own properties.
+ */
+ getOwnPropertyNames(o: any): string[];
+
+ /**
+ * Creates an object that has the specified prototype, and that optionally contains specified properties.
+ * @param o Object to use as a prototype. May be null
+ * @param properties JavaScript object that contains one or more property descriptors.
+ */
+ create(o: any, properties?: PropertyDescriptorMap): any;
+
+ /**
+ * Adds a property to an object, or modifies attributes of an existing property.
+ * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.
+ * @param p The property name.
+ * @param attributes Descriptor for the property. It can be for a data property or an accessor property.
+ */
+ defineProperty(o: any, p: string, attributes: PropertyDescriptor): any;
+
+ /**
+ * Adds one or more properties to an object, and/or modifies attributes of existing properties.
+ * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.
+ * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.
+ */
+ defineProperties(o: any, properties: PropertyDescriptorMap): any;
+
+ /**
+ * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.
+ * @param o Object on which to lock the attributes.
+ */
+ seal<T>(o: T): T;
+
+ /**
+ * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
+ * @param o Object on which to lock the attributes.
+ */
+ freeze<T>(o: T): T;
+
+ /**
+ * Prevents the addition of new properties to an object.
+ * @param o Object to make non-extensible.
+ */
+ preventExtensions<T>(o: T): T;
+
+ /**
+ * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.
+ * @param o Object to test.
+ */
+ isSealed(o: any): boolean;
+
+ /**
+ * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.
+ * @param o Object to test.
+ */
+ isFrozen(o: any): boolean;
+
+ /**
+ * Returns a value that indicates whether new properties can be added to an object.
+ * @param o Object to test.
+ */
+ isExtensible(o: any): boolean;
+
+ /**
+ * Returns the names of the enumerable properties and methods of an object.
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
+ */
+ keys(o: any): string[];
+}
+
+/**
+ * Provides functionality common to all JavaScript objects.
+ */
+declare var Object: ObjectConstructor;
+
+/**
+ * Creates a new function.
+ */
+interface Function {
+ /**
+ * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.
+ * @param thisArg The object to be used as the this object.
+ * @param argArray A set of arguments to be passed to the function.
+ */
+ apply(thisArg: any, argArray?: any): any;
+
+ /**
+ * Calls a method of an object, substituting another object for the current object.
+ * @param thisArg The object to be used as the current object.
+ * @param argArray A list of arguments to be passed to the method.
+ */
+ call(thisArg: any, ...argArray: any[]): any;
+
+ /**
+ * For a given function, creates a bound function that has the same body as the original function.
+ * The this object of the bound function is associated with the specified object, and has the specified initial parameters.
+ * @param thisArg An object to which the this keyword can refer inside the new function.
+ * @param argArray A list of arguments to be passed to the new function.
+ */
+ bind(thisArg: any, ...argArray: any[]): any;
+
+ prototype: any;
+ length: number;
+
+ // Non-standard extensions
+ arguments: any;
+ caller: Function;
+}
+
+interface FunctionConstructor {
+ /**
+ * Creates a new function.
+ * @param args A list of arguments the function accepts.
+ */
+ new (...args: string[]): Function;
+ (...args: string[]): Function;
+ prototype: Function;
+}
+
+declare var Function: FunctionConstructor;
+
+interface IArguments {
+ [index: number]: any;
+ length: number;
+ callee: Function;
+}
+
+interface String {
+ /** Returns a string representation of a string. */
+ toString(): string;
+
+ /**
+ * Returns the character at the specified index.
+ * @param pos The zero-based index of the desired character.
+ */
+ charAt(pos: number): string;
+
+ /**
+ * Returns the Unicode value of the character at the specified location.
+ * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.
+ */
+ charCodeAt(index: number): number;
+
+ /**
+ * Returns a string that contains the concatenation of two or more strings.
+ * @param strings The strings to append to the end of the string.
+ */
+ concat(...strings: string[]): string;
+
+ /**
+ * Returns the position of the first occurrence of a substring.
+ * @param searchString The substring to search for in the string
+ * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.
+ */
+ indexOf(searchString: string, position?: number): number;
+
+ /**
+ * Returns the last occurrence of a substring in the string.
+ * @param searchString The substring to search for.
+ * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.
+ */
+ lastIndexOf(searchString: string, position?: number): number;
+
+ /**
+ * Determines whether two strings are equivalent in the current locale.
+ * @param that String to compare to target string
+ */
+ localeCompare(that: string): number;
+
+ /**
+ * Matches a string with a regular expression, and returns an array containing the results of that search.
+ * @param regexp A variable name or string literal containing the regular expression pattern and flags.
+ */
+ match(regexp: string): RegExpMatchArray;
+
+ /**
+ * Matches a string with a regular expression, and returns an array containing the results of that search.
+ * @param regexp A regular expression object that contains the regular expression pattern and applicable flags.
+ */
+ match(regexp: RegExp): RegExpMatchArray;
+
+ /**
+ * Replaces text in a string, using a regular expression or search string.
+ * @param searchValue A string that represents the regular expression.
+ * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
+ */
+ replace(searchValue: string, replaceValue: string): string;
+
+ /**
+ * Replaces text in a string, using a regular expression or search string.
+ * @param searchValue A string that represents the regular expression.
+ * @param replacer A function that returns the replacement text.
+ */
+ replace(searchValue: string, replacer: (substring: string, ...args: any[]) => string): string;
+
+ /**
+ * Replaces text in a string, using a regular expression or search string.
+ * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags.
+ * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
+ */
+ replace(searchValue: RegExp, replaceValue: string): string;
+
+ /**
+ * Replaces text in a string, using a regular expression or search string.
+ * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags
+ * @param replacer A function that returns the replacement text.
+ */
+ replace(searchValue: RegExp, replacer: (substring: string, ...args: any[]) => string): string;
+
+ /**
+ * Finds the first substring match in a regular expression search.
+ * @param regexp The regular expression pattern and applicable flags.
+ */
+ search(regexp: string): number;
+
+ /**
+ * Finds the first substring match in a regular expression search.
+ * @param regexp The regular expression pattern and applicable flags.
+ */
+ search(regexp: RegExp): number;
+
+ /**
+ * Returns a section of a string.
+ * @param start The index to the beginning of the specified portion of stringObj.
+ * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.
+ * If this value is not specified, the substring continues to the end of stringObj.
+ */
+ slice(start?: number, end?: number): string;
+
+ /**
+ * Split a string into substrings using the specified separator and return them as an array.
+ * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
+ * @param limit A value used to limit the number of elements returned in the array.
+ */
+ split(separator: string, limit?: number): string[];
+
+ /**
+ * Split a string into substrings using the specified separator and return them as an array.
+ * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
+ * @param limit A value used to limit the number of elements returned in the array.
+ */
+ split(separator: RegExp, limit?: number): string[];
+
+ /**
+ * Returns the substring at the specified location within a String object.
+ * @param start The zero-based index number indicating the beginning of the substring.
+ * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.
+ * If end is omitted, the characters from start through the end of the original string are returned.
+ */
+ substring(start: number, end?: number): string;
+
+ /** Converts all the alphabetic characters in a string to lowercase. */
+ toLowerCase(): string;
+
+ /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */
+ toLocaleLowerCase(): string;
+
+ /** Converts all the alphabetic characters in a string to uppercase. */
+ toUpperCase(): string;
+
+ /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */
+ toLocaleUpperCase(): string;
+
+ /** Removes the leading and trailing white space and line terminator characters from a string. */
+ trim(): string;
+
+ /** Returns the length of a String object. */
+ length: number;
+
+ // IE extensions
+ /**
+ * Gets a substring beginning at the specified location and having the specified length.
+ * @param from The starting position of the desired substring. The index of the first character in the string is zero.
+ * @param length The number of characters to include in the returned substring.
+ */
+ substr(from: number, length?: number): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): string;
+
+ [index: number]: string;
+}
+
+interface StringConstructor {
+ new (value?: any): String;
+ (value?: any): string;
+ prototype: String;
+ fromCharCode(...codes: number[]): string;
+}
+
+/**
+ * Allows manipulation and formatting of text strings and determination and location of substrings within strings.
+ */
+declare var String: StringConstructor;
+
+interface Boolean {
+ /** Returns the primitive value of the specified object. */
+ valueOf(): boolean;
+}
+
+interface BooleanConstructor {
+ new (value?: any): Boolean;
+ (value?: any): boolean;
+ prototype: Boolean;
+}
+
+declare var Boolean: BooleanConstructor;
+
+interface Number {
+ /**
+ * Returns a string representation of an object.
+ * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.
+ */
+ toString(radix?: number): string;
+
+ /**
+ * Returns a string representing a number in fixed-point notation.
+ * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
+ */
+ toFixed(fractionDigits?: number): string;
+
+ /**
+ * Returns a string containing a number represented in exponential notation.
+ * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
+ */
+ toExponential(fractionDigits?: number): string;
+
+ /**
+ * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.
+ * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
+ */
+ toPrecision(precision?: number): string;
+
+ /** Returns the primitive value of the specified object. */
+ valueOf(): number;
+}
+
+interface NumberConstructor {
+ new (value?: any): Number;
+ (value?: any): number;
+ prototype: Number;
+
+ /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */
+ MAX_VALUE: number;
+
+ /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */
+ MIN_VALUE: number;
+
+ /**
+ * A value that is not a number.
+ * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.
+ */
+ NaN: number;
+
+ /**
+ * A value that is less than the largest negative number that can be represented in JavaScript.
+ * JavaScript displays NEGATIVE_INFINITY values as -infinity.
+ */
+ NEGATIVE_INFINITY: number;
+
+ /**
+ * A value greater than the largest number that can be represented in JavaScript.
+ * JavaScript displays POSITIVE_INFINITY values as infinity.
+ */
+ POSITIVE_INFINITY: number;
+}
+
+/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */
+declare var Number: NumberConstructor;
+
+interface TemplateStringsArray extends Array<string> {
+ raw: string[];
+}
+
+interface Math {
+ /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */
+ E: number;
+ /** The natural logarithm of 10. */
+ LN10: number;
+ /** The natural logarithm of 2. */
+ LN2: number;
+ /** The base-2 logarithm of e. */
+ LOG2E: number;
+ /** The base-10 logarithm of e. */
+ LOG10E: number;
+ /** Pi. This is the ratio of the circumference of a circle to its diameter. */
+ PI: number;
+ /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */
+ SQRT1_2: number;
+ /** The square root of 2. */
+ SQRT2: number;
+ /**
+ * Returns the absolute value of a number (the value without regard to whether it is positive or negative).
+ * For example, the absolute value of -5 is the same as the absolute value of 5.
+ * @param x A numeric expression for which the absolute value is needed.
+ */
+ abs(x: number): number;
+ /**
+ * Returns the arc cosine (or inverse cosine) of a number.
+ * @param x A numeric expression.
+ */
+ acos(x: number): number;
+ /**
+ * Returns the arcsine of a number.
+ * @param x A numeric expression.
+ */
+ asin(x: number): number;
+ /**
+ * Returns the arctangent of a number.
+ * @param x A numeric expression for which the arctangent is needed.
+ */
+ atan(x: number): number;
+ /**
+ * Returns the angle (in radians) from the X axis to a point.
+ * @param y A numeric expression representing the cartesian y-coordinate.
+ * @param x A numeric expression representing the cartesian x-coordinate.
+ */
+ atan2(y: number, x: number): number;
+ /**
+ * Returns the smallest number greater than or equal to its numeric argument.
+ * @param x A numeric expression.
+ */
+ ceil(x: number): number;
+ /**
+ * Returns the cosine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ cos(x: number): number;
+ /**
+ * Returns e (the base of natural logarithms) raised to a power.
+ * @param x A numeric expression representing the power of e.
+ */
+ exp(x: number): number;
+ /**
+ * Returns the greatest number less than or equal to its numeric argument.
+ * @param x A numeric expression.
+ */
+ floor(x: number): number;
+ /**
+ * Returns the natural logarithm (base e) of a number.
+ * @param x A numeric expression.
+ */
+ log(x: number): number;
+ /**
+ * Returns the larger of a set of supplied numeric expressions.
+ * @param values Numeric expressions to be evaluated.
+ */
+ max(...values: number[]): number;
+ /**
+ * Returns the smaller of a set of supplied numeric expressions.
+ * @param values Numeric expressions to be evaluated.
+ */
+ min(...values: number[]): number;
+ /**
+ * Returns the value of a base expression taken to a specified power.
+ * @param x The base value of the expression.
+ * @param y The exponent value of the expression.
+ */
+ pow(x: number, y: number): number;
+ /** Returns a pseudorandom number between 0 and 1. */
+ random(): number;
+ /**
+ * Returns a supplied numeric expression rounded to the nearest number.
+ * @param x The value to be rounded to the nearest number.
+ */
+ round(x: number): number;
+ /**
+ * Returns the sine of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ sin(x: number): number;
+ /**
+ * Returns the square root of a number.
+ * @param x A numeric expression.
+ */
+ sqrt(x: number): number;
+ /**
+ * Returns the tangent of a number.
+ * @param x A numeric expression that contains an angle measured in radians.
+ */
+ tan(x: number): number;
+}
+/** An intrinsic object that provides basic mathematics functionality and constants. */
+declare var Math: Math;
+
+/** Enables basic storage and retrieval of dates and times. */
+interface Date {
+ /** Returns a string representation of a date. The format of the string depends on the locale. */
+ toString(): string;
+ /** Returns a date as a string value. */
+ toDateString(): string;
+ /** Returns a time as a string value. */
+ toTimeString(): string;
+ /** Returns a value as a string value appropriate to the host environment's current locale. */
+ toLocaleString(): string;
+ /** Returns a date as a string value appropriate to the host environment's current locale. */
+ toLocaleDateString(): string;
+ /** Returns a time as a string value appropriate to the host environment's current locale. */
+ toLocaleTimeString(): string;
+ /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */
+ valueOf(): number;
+ /** Gets the time value in milliseconds. */
+ getTime(): number;
+ /** Gets the year, using local time. */
+ getFullYear(): number;
+ /** Gets the year using Universal Coordinated Time (UTC). */
+ getUTCFullYear(): number;
+ /** Gets the month, using local time. */
+ getMonth(): number;
+ /** Gets the month of a Date object using Universal Coordinated Time (UTC). */
+ getUTCMonth(): number;
+ /** Gets the day-of-the-month, using local time. */
+ getDate(): number;
+ /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */
+ getUTCDate(): number;
+ /** Gets the day of the week, using local time. */
+ getDay(): number;
+ /** Gets the day of the week using Universal Coordinated Time (UTC). */
+ getUTCDay(): number;
+ /** Gets the hours in a date, using local time. */
+ getHours(): number;
+ /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */
+ getUTCHours(): number;
+ /** Gets the minutes of a Date object, using local time. */
+ getMinutes(): number;
+ /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */
+ getUTCMinutes(): number;
+ /** Gets the seconds of a Date object, using local time. */
+ getSeconds(): number;
+ /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */
+ getUTCSeconds(): number;
+ /** Gets the milliseconds of a Date, using local time. */
+ getMilliseconds(): number;
+ /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */
+ getUTCMilliseconds(): number;
+ /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */
+ getTimezoneOffset(): number;
+ /**
+ * Sets the date and time value in the Date object.
+ * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.
+ */
+ setTime(time: number): number;
+ /**
+ * Sets the milliseconds value in the Date object using local time.
+ * @param ms A numeric value equal to the millisecond value.
+ */
+ setMilliseconds(ms: number): number;
+ /**
+ * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
+ * @param ms A numeric value equal to the millisecond value.
+ */
+ setUTCMilliseconds(ms: number): number;
+
+ /**
+ * Sets the seconds value in the Date object using local time.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setSeconds(sec: number, ms?: number): number;
+ /**
+ * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setUTCSeconds(sec: number, ms?: number): number;
+ /**
+ * Sets the minutes value in the Date object using local time.
+ * @param min A numeric value equal to the minutes value.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setMinutes(min: number, sec?: number, ms?: number): number;
+ /**
+ * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
+ * @param min A numeric value equal to the minutes value.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setUTCMinutes(min: number, sec?: number, ms?: number): number;
+ /**
+ * Sets the hour value in the Date object using local time.
+ * @param hours A numeric value equal to the hours value.
+ * @param min A numeric value equal to the minutes value.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setHours(hours: number, min?: number, sec?: number, ms?: number): number;
+ /**
+ * Sets the hours value in the Date object using Universal Coordinated Time (UTC).
+ * @param hours A numeric value equal to the hours value.
+ * @param min A numeric value equal to the minutes value.
+ * @param sec A numeric value equal to the seconds value.
+ * @param ms A numeric value equal to the milliseconds value.
+ */
+ setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;
+ /**
+ * Sets the numeric day-of-the-month value of the Date object using local time.
+ * @param date A numeric value equal to the day of the month.
+ */
+ setDate(date: number): number;
+ /**
+ * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
+ * @param date A numeric value equal to the day of the month.
+ */
+ setUTCDate(date: number): number;
+ /**
+ * Sets the month value in the Date object using local time.
+ * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
+ * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.
+ */
+ setMonth(month: number, date?: number): number;
+ /**
+ * Sets the month value in the Date object using Universal Coordinated Time (UTC).
+ * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
+ * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.
+ */
+ setUTCMonth(month: number, date?: number): number;
+ /**
+ * Sets the year of the Date object using local time.
+ * @param year A numeric value for the year.
+ * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.
+ * @param date A numeric value equal for the day of the month.
+ */
+ setFullYear(year: number, month?: number, date?: number): number;
+ /**
+ * Sets the year value in the Date object using Universal Coordinated Time (UTC).
+ * @param year A numeric value equal to the year.
+ * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.
+ * @param date A numeric value equal to the day of the month.
+ */
+ setUTCFullYear(year: number, month?: number, date?: number): number;
+ /** Returns a date converted to a string using Universal Coordinated Time (UTC). */
+ toUTCString(): string;
+ /** Returns a date as a string value in ISO format. */
+ toISOString(): string;
+ /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */
+ toJSON(key?: any): string;
+}
+
+interface DateConstructor {
+ new (): Date;
+ new (value: number): Date;
+ new (value: string): Date;
+ new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
+ (): string;
+ prototype: Date;
+ /**
+ * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.
+ * @param s A date string
+ */
+ parse(s: string): number;
+ /**
+ * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
+ * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
+ * @param month The month as an number between 0 and 11 (January to December).
+ * @param date The date as an number between 1 and 31.
+ * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.
+ * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.
+ * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.
+ * @param ms An number from 0 to 999 that specifies the milliseconds.
+ */
+ UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
+ now(): number;
+}
+
+declare var Date: DateConstructor;
+
+interface RegExpMatchArray extends Array<string> {
+ index?: number;
+ input?: string;
+}
+
+interface RegExpExecArray extends Array<string> {
+ index: number;
+ input: string;
+}
+
+interface RegExp {
+ /**
+ * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.
+ * @param string The String object or string literal on which to perform the search.
+ */
+ exec(string: string): RegExpExecArray;
+
+ /**
+ * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.
+ * @param string String on which to perform the search.
+ */
+ test(string: string): boolean;
+
+ /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */
+ source: string;
+
+ /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */
+ global: boolean;
+
+ /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */
+ ignoreCase: boolean;
+
+ /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */
+ multiline: boolean;
+
+ lastIndex: number;
+
+ // Non-standard extensions
+ compile(): RegExp;
+}
+
+interface RegExpConstructor {
+ new (pattern: string, flags?: string): RegExp;
+ (pattern: string, flags?: string): RegExp;
+ prototype: RegExp;
+
+ // Non-standard extensions
+ $1: string;
+ $2: string;
+ $3: string;
+ $4: string;
+ $5: string;
+ $6: string;
+ $7: string;
+ $8: string;
+ $9: string;
+ lastMatch: string;
+}
+
+declare var RegExp: RegExpConstructor;
+
+interface Error {
+ name: string;
+ message: string;
+}
+
+interface ErrorConstructor {
+ new (message?: string): Error;
+ (message?: string): Error;
+ prototype: Error;
+}
+
+declare var Error: ErrorConstructor;
+
+interface EvalError extends Error {
+}
+
+interface EvalErrorConstructor {
+ new (message?: string): EvalError;
+ (message?: string): EvalError;
+ prototype: EvalError;
+}
+
+declare var EvalError: EvalErrorConstructor;
+
+interface RangeError extends Error {
+}
+
+interface RangeErrorConstructor {
+ new (message?: string): RangeError;
+ (message?: string): RangeError;
+ prototype: RangeError;
+}
+
+declare var RangeError: RangeErrorConstructor;
+
+interface ReferenceError extends Error {
+}
+
+interface ReferenceErrorConstructor {
+ new (message?: string): ReferenceError;
+ (message?: string): ReferenceError;
+ prototype: ReferenceError;
+}
+
+declare var ReferenceError: ReferenceErrorConstructor;
+
+interface SyntaxError extends Error {
+}
+
+interface SyntaxErrorConstructor {
+ new (message?: string): SyntaxError;
+ (message?: string): SyntaxError;
+ prototype: SyntaxError;
+}
+
+declare var SyntaxError: SyntaxErrorConstructor;
+
+interface TypeError extends Error {
+}
+
+interface TypeErrorConstructor {
+ new (message?: string): TypeError;
+ (message?: string): TypeError;
+ prototype: TypeError;
+}
+
+declare var TypeError: TypeErrorConstructor;
+
+interface URIError extends Error {
+}
+
+interface URIErrorConstructor {
+ new (message?: string): URIError;
+ (message?: string): URIError;
+ prototype: URIError;
+}
+
+declare var URIError: URIErrorConstructor;
+
+interface JSON {
+ /**
+ * Converts a JavaScript Object Notation (JSON) string into an object.
+ * @param text A valid JSON string.
+ * @param reviver A function that transforms the results. This function is called for each member of the object.
+ * If a member contains nested objects, the nested objects are transformed before the parent object is.
+ */
+ parse(text: string, reviver?: (key: any, value: any) => any): any;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ */
+ stringify(value: any): string;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ * @param replacer A function that transforms the results.
+ */
+ stringify(value: any, replacer: (key: string, value: any) => any): string;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ * @param replacer Array that transforms the results.
+ */
+ stringify(value: any, replacer: any[]): string;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ * @param replacer A function that transforms the results.
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
+ */
+ stringify(value: any, replacer: (key: string, value: any) => any, space: string | number): string;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ * @param replacer Array that transforms the results.
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
+ */
+ stringify(value: any, replacer: any[], space: string | number): string;
+}
+/**
+ * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
+ */
+declare var JSON: JSON;
+
+
+/////////////////////////////
+/// ECMAScript Array API (specially handled by compiler)
+/////////////////////////////
+
+interface Array<T> {
+ /**
+ * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
+ */
+ length: number;
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+ toLocaleString(): string;
+ /**
+ * Appends new elements to an array, and returns the new length of the array.
+ * @param items New elements of the Array.
+ */
+ push(...items: T[]): number;
+ /**
+ * Removes the last element from an array and returns it.
+ */
+ pop(): T;
+ /**
+ * Combines two or more arrays.
+ * @param items Additional items to add to the end of array1.
+ */
+ concat<U extends T[]>(...items: U[]): T[];
+ /**
+ * Combines two or more arrays.
+ * @param items Additional items to add to the end of array1.
+ */
+ concat(...items: T[]): T[];
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): T[];
+ /**
+ * Removes the first element from an array and returns it.
+ */
+ shift(): T;
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): T[];
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: T, b: T) => number): T[];
+
+ /**
+ * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
+ * @param start The zero-based location in the array from which to start removing elements.
+ */
+ splice(start: number): T[];
+
+ /**
+ * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
+ * @param start The zero-based location in the array from which to start removing elements.
+ * @param deleteCount The number of elements to remove.
+ * @param items Elements to insert into the array in place of the deleted elements.
+ */
+ splice(start: number, deleteCount: number, ...items: T[]): T[];
+
+ /**
+ * Inserts new elements at the start of an array.
+ * @param items Elements to insert at the start of the Array.
+ */
+ unshift(...items: T[]): number;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
+ */
+ indexOf(searchElement: T, fromIndex?: number): number;
+
+ /**
+ * Returns the index of the last occurrence of a specified value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.
+ */
+ lastIndexOf(searchElement: T, fromIndex?: number): number;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[];
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T;
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
+
+ [n: number]: T;
+}
+
+interface ArrayConstructor {
+ new (arrayLength?: number): any[];
+ new <T>(arrayLength: number): T[];
+ new <T>(...items: T[]): T[];
+ (arrayLength?: number): any[];
+ <T>(arrayLength: number): T[];
+ <T>(...items: T[]): T[];
+ isArray(arg: any): arg is Array<any>;
+ prototype: Array<any>;
+}
+
+declare var Array: ArrayConstructor;
+
+interface TypedPropertyDescriptor<T> {
+ enumerable?: boolean;
+ configurable?: boolean;
+ writable?: boolean;
+ value?: T;
+ get?: () => T;
+ set?: (value: T) => void;
+}
+
+declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
+declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
+declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
+declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
+
+declare type PromiseConstructorLike = new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => PromiseLike<T>;
+
+interface PromiseLike<T> {
+ /**
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
+ * @param onfulfilled The callback to execute when the Promise is resolved.
+ * @param onrejected The callback to execute when the Promise is rejected.
+ * @returns A Promise for the completion of which ever callback is executed.
+ */
+ then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
+ then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
+}
+
+interface ArrayLike<T> {
+ length: number;
+ [n: number]: T;
+}
+
+
+/**
+ * Represents a raw buffer of binary data, which is used to store data for the
+ * different typed arrays. ArrayBuffers cannot be read from or written to directly,
+ * but can be passed to a typed array or DataView Object to interpret the raw
+ * buffer as needed.
+ */
+interface ArrayBuffer {
+ /**
+ * Read-only. The length of the ArrayBuffer (in bytes).
+ */
+ byteLength: number;
+
+ /**
+ * Returns a section of an ArrayBuffer.
+ */
+ slice(begin:number, end?:number): ArrayBuffer;
+}
+
+interface ArrayBufferConstructor {
+ prototype: ArrayBuffer;
+ new (byteLength: number): ArrayBuffer;
+ isView(arg: any): arg is ArrayBufferView;
+}
+declare var ArrayBuffer: ArrayBufferConstructor;
+
+interface ArrayBufferView {
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+}
+
+interface DataView {
+ buffer: ArrayBuffer;
+ byteLength: number;
+ byteOffset: number;
+ /**
+ * Gets the Float32 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getFloat32(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Gets the Float64 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getFloat64(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Gets the Int8 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getInt8(byteOffset: number): number;
+
+ /**
+ * Gets the Int16 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getInt16(byteOffset: number, littleEndian?: boolean): number;
+ /**
+ * Gets the Int32 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getInt32(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Gets the Uint8 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getUint8(byteOffset: number): number;
+
+ /**
+ * Gets the Uint16 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getUint16(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Gets the Uint32 value at the specified byte offset from the start of the view. There is
+ * no alignment constraint; multi-byte values may be fetched from any offset.
+ * @param byteOffset The place in the buffer at which the value should be retrieved.
+ */
+ getUint32(byteOffset: number, littleEndian?: boolean): number;
+
+ /**
+ * Stores an Float32 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Float64 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Int8 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ */
+ setInt8(byteOffset: number, value: number): void;
+
+ /**
+ * Stores an Int16 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Int32 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Uint8 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ */
+ setUint8(byteOffset: number, value: number): void;
+
+ /**
+ * Stores an Uint16 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
+
+ /**
+ * Stores an Uint32 value at the specified byte offset from the start of the view.
+ * @param byteOffset The place in the buffer at which the value should be set.
+ * @param value The value to set.
+ * @param littleEndian If false or undefined, a big-endian value should be written,
+ * otherwise a little-endian value should be written.
+ */
+ setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
+}
+
+interface DataViewConstructor {
+ new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView;
+}
+declare var DataView: DataViewConstructor;
+
+/**
+ * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested
+ * number of bytes could not be allocated an exception is raised.
+ */
+interface Int8Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Int8Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Int8Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): Int8Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Int8Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Int8Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Int8Array;
+
+ /**
+ * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Int8Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+interface Int8ArrayConstructor {
+ prototype: Int8Array;
+ new (length: number): Int8Array;
+ new (array: ArrayLike<number>): Int8Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Int8Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;
+
+}
+declare var Int8Array: Int8ArrayConstructor;
+
+/**
+ * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint8Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Uint8Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Uint8Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): Uint8Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Uint8Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Uint8Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Uint8Array;
+
+ /**
+ * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Uint8Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Uint8ArrayConstructor {
+ prototype: Uint8Array;
+ new (length: number): Uint8Array;
+ new (array: ArrayLike<number>): Uint8Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Uint8Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;
+
+}
+declare var Uint8Array: Uint8ArrayConstructor;
+
+/**
+ * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.
+ * If the requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint8ClampedArray {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Uint8ClampedArray;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Uint8ClampedArray;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): Uint8ClampedArray;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Uint8ClampedArray;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: Uint8ClampedArray, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Uint8ClampedArray;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Uint8ClampedArray;
+
+ /**
+ * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Uint8ClampedArray;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Uint8ClampedArrayConstructor {
+ prototype: Uint8ClampedArray;
+ new (length: number): Uint8ClampedArray;
+ new (array: ArrayLike<number>): Uint8ClampedArray;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Uint8ClampedArray;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;
+}
+declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;
+
+/**
+ * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Int16Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Int16Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Int16Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): Int16Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Int16Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Int16Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Int16Array;
+
+ /**
+ * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Int16Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Int16ArrayConstructor {
+ prototype: Int16Array;
+ new (length: number): Int16Array;
+ new (array: ArrayLike<number>): Int16Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Int16Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;
+
+}
+declare var Int16Array: Int16ArrayConstructor;
+
+/**
+ * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint16Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Uint16Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Uint16Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): Uint16Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Uint16Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Uint16Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Uint16Array;
+
+ /**
+ * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Uint16Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Uint16ArrayConstructor {
+ prototype: Uint16Array;
+ new (length: number): Uint16Array;
+ new (array: ArrayLike<number>): Uint16Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Uint16Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;
+
+}
+declare var Uint16Array: Uint16ArrayConstructor;
+/**
+ * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Int32Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Int32Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Int32Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): Int32Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Int32Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Int32Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Int32Array;
+
+ /**
+ * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Int32Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Int32ArrayConstructor {
+ prototype: Int32Array;
+ new (length: number): Int32Array;
+ new (array: ArrayLike<number>): Int32Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Int32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;
+}
+declare var Int32Array: Int32ArrayConstructor;
+
+/**
+ * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the
+ * requested number of bytes could not be allocated an exception is raised.
+ */
+interface Uint32Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Uint32Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Uint32Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): Uint32Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Uint32Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Uint32Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Uint32Array;
+
+ /**
+ * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Uint32Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Uint32ArrayConstructor {
+ prototype: Uint32Array;
+ new (length: number): Uint32Array;
+ new (array: ArrayLike<number>): Uint32Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Uint32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;
+}
+declare var Uint32Array: Uint32ArrayConstructor;
+
+/**
+ * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number
+ * of bytes could not be allocated an exception is raised.
+ */
+interface Float32Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Float32Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Float32Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): Float32Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Float32Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Float32Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Float32Array;
+
+ /**
+ * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Float32Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Float32ArrayConstructor {
+ prototype: Float32Array;
+ new (length: number): Float32Array;
+ new (array: ArrayLike<number>): Float32Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Float32Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;
+
+}
+declare var Float32Array: Float32ArrayConstructor;
+
+/**
+ * A typed array of 64-bit float values. The contents are initialized to 0. If the requested
+ * number of bytes could not be allocated an exception is raised.
+ */
+interface Float64Array {
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * The ArrayBuffer instance referenced by the array.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * The length in bytes of the array.
+ */
+ byteLength: number;
+
+ /**
+ * The offset in bytes of the array.
+ */
+ byteOffset: number;
+
+ /**
+ * Returns the this object after copying a section of the array identified by start and end
+ * to the same array starting at position target
+ * @param target If target is negative, it is treated as length+target where length is the
+ * length of the array.
+ * @param start If start is negative, it is treated as length+start. If end is negative, it
+ * is treated as length+end.
+ * @param end If not specified, length of the this object is used as its default value.
+ */
+ copyWithin(target: number, start: number, end?: number): Float64Array;
+
+ /**
+ * Determines whether all the members of an array satisfy the specified test.
+ * @param callbackfn A function that accepts up to three arguments. The every method calls
+ * the callbackfn function for each element in array1 until the callbackfn returns false,
+ * or until the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Returns the this object after filling the section identified by start and end with value
+ * @param value value to fill array section with
+ * @param start index to start filling the array at. If start is negative, it is treated as
+ * length+start where length is the length of the array.
+ * @param end index to stop filling the array at. If end is negative, it is treated as
+ * length+end.
+ */
+ fill(value: number, start?: number, end?: number): Float64Array;
+
+ /**
+ * Returns the elements of an array that meet the condition specified in a callback function.
+ * @param callbackfn A function that accepts up to three arguments. The filter method calls
+ * the callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ filter(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): Float64Array;
+
+ /**
+ * Returns the value of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ find(predicate: (value: number, index: number, obj: Array<number>) => boolean, thisArg?: any): number;
+
+ /**
+ * Returns the index of the first element in the array where predicate is true, and undefined
+ * otherwise.
+ * @param predicate find calls predicate once for each element of the array, in ascending
+ * order, until it finds one where predicate returns true. If such an element is found, find
+ * immediately returns that element value. Otherwise, find returns undefined.
+ * @param thisArg If provided, it will be used as the this value for each invocation of
+ * predicate. If it is not provided, undefined is used instead.
+ */
+ findIndex(predicate: (value: number) => boolean, thisArg?: any): number;
+
+ /**
+ * Performs the specified action for each element in an array.
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;
+
+ /**
+ * Returns the index of the first occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ indexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * Adds all the elements of an array separated by the specified separator string.
+ * @param separator A string used to separate one element of an array from the next in the
+ * resulting String. If omitted, the array elements are separated with a comma.
+ */
+ join(separator?: string): string;
+
+ /**
+ * Returns the index of the last occurrence of a value in an array.
+ * @param searchElement The value to locate in the array.
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the
+ * search starts at index 0.
+ */
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
+
+ /**
+ * The length of the array.
+ */
+ length: number;
+
+ /**
+ * Calls a defined callback function on each element of an array, and returns an array that
+ * contains the results.
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the
+ * callbackfn function one time for each element in the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array. The return value of
+ * the callback function is the accumulated result, and is provided as an argument in the next
+ * call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the
+ * callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an
+ * argument instead of an array value.
+ */
+ reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number;
+
+ /**
+ * Calls the specified callback function for all the elements in an array, in descending order.
+ * The return value of the callback function is the accumulated result, and is provided as an
+ * argument in the next call to the callback function.
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls
+ * the callbackfn function one time for each element in the array.
+ * @param initialValue If initialValue is specified, it is used as the initial value to start
+ * the accumulation. The first call to the callbackfn function provides this value as an argument
+ * instead of an array value.
+ */
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;
+
+ /**
+ * Reverses the elements in an Array.
+ */
+ reverse(): Float64Array;
+
+ /**
+ * Sets a value or an array of values.
+ * @param index The index of the location to set.
+ * @param value The value to set.
+ */
+ set(index: number, value: number): void;
+
+ /**
+ * Sets a value or an array of values.
+ * @param array A typed or untyped array of values to set.
+ * @param offset The index in the current array at which the values are to be written.
+ */
+ set(array: ArrayLike<number>, offset?: number): void;
+
+ /**
+ * Returns a section of an array.
+ * @param start The beginning of the specified portion of the array.
+ * @param end The end of the specified portion of the array.
+ */
+ slice(start?: number, end?: number): Float64Array;
+
+ /**
+ * Determines whether the specified callback function returns true for any element of an array.
+ * @param callbackfn A function that accepts up to three arguments. The some method calls the
+ * callbackfn function for each element in array1 until the callbackfn returns true, or until
+ * the end of the array.
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function.
+ * If thisArg is omitted, undefined is used as the this value.
+ */
+ some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;
+
+ /**
+ * Sorts an array.
+ * @param compareFn The name of the function used to determine the order of the elements. If
+ * omitted, the elements are sorted in ascending, ASCII character order.
+ */
+ sort(compareFn?: (a: number, b: number) => number): Float64Array;
+
+ /**
+ * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements
+ * at begin, inclusive, up to end, exclusive.
+ * @param begin The index of the beginning of the array.
+ * @param end The index of the end of the array.
+ */
+ subarray(begin: number, end?: number): Float64Array;
+
+ /**
+ * Converts a number to a string by using the current locale.
+ */
+ toLocaleString(): string;
+
+ /**
+ * Returns a string representation of an array.
+ */
+ toString(): string;
+
+ [index: number]: number;
+}
+
+interface Float64ArrayConstructor {
+ prototype: Float64Array;
+ new (length: number): Float64Array;
+ new (array: ArrayLike<number>): Float64Array;
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array;
+
+ /**
+ * The size in bytes of each element in the array.
+ */
+ BYTES_PER_ELEMENT: number;
+
+ /**
+ * Returns a new array from a set of elements.
+ * @param items A set of elements to include in the new array object.
+ */
+ of(...items: number[]): Float64Array;
+
+ /**
+ * Creates an array from an array-like or iterable object.
+ * @param arrayLike An array-like or iterable object to convert to an array.
+ * @param mapfn A mapping function to call on every element of the array.
+ * @param thisArg Value of 'this' used to invoke the mapfn.
+ */
+ from(arrayLike: ArrayLike<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
+}
+declare var Float64Array: Float64ArrayConstructor;
+/////////////////////////////
+/// ECMAScript Internationalization API
+/////////////////////////////
+
+declare module Intl {
+ interface CollatorOptions {
+ usage?: string;
+ localeMatcher?: string;
+ numeric?: boolean;
+ caseFirst?: string;
+ sensitivity?: string;
+ ignorePunctuation?: boolean;
+ }
+
+ interface ResolvedCollatorOptions {
+ locale: string;
+ usage: string;
+ sensitivity: string;
+ ignorePunctuation: boolean;
+ collation: string;
+ caseFirst: string;
+ numeric: boolean;
+ }
+
+ interface Collator {
+ compare(x: string, y: string): number;
+ resolvedOptions(): ResolvedCollatorOptions;
+ }
+ var Collator: {
+ new (locales?: string[], options?: CollatorOptions): Collator;
+ new (locale?: string, options?: CollatorOptions): Collator;
+ (locales?: string[], options?: CollatorOptions): Collator;
+ (locale?: string, options?: CollatorOptions): Collator;
+ supportedLocalesOf(locales: string[], options?: CollatorOptions): string[];
+ supportedLocalesOf(locale: string, options?: CollatorOptions): string[];
+ }
+
+ interface NumberFormatOptions {
+ localeMatcher?: string;
+ style?: string;
+ currency?: string;
+ currencyDisplay?: string;
+ useGrouping?: boolean;
+ minimumIntegerDigits?: number;
+ minimumFractionDigits?: number;
+ maximumFractionDigits?: number;
+ minimumSignificantDigits?: number;
+ maximumSignificantDigits?: number;
+ }
+
+ interface ResolvedNumberFormatOptions {
+ locale: string;
+ numberingSystem: string;
+ style: string;
+ currency?: string;
+ currencyDisplay?: string;
+ minimumIntegerDigits: number;
+ minimumFractionDigits: number;
+ maximumFractionDigits: number;
+ minimumSignificantDigits?: number;
+ maximumSignificantDigits?: number;
+ useGrouping: boolean;
+ }
+
+ interface NumberFormat {
+ format(value: number): string;
+ resolvedOptions(): ResolvedNumberFormatOptions;
+ }
+ var NumberFormat: {
+ new (locales?: string[], options?: NumberFormatOptions): NumberFormat;
+ new (locale?: string, options?: NumberFormatOptions): NumberFormat;
+ (locales?: string[], options?: NumberFormatOptions): NumberFormat;
+ (locale?: string, options?: NumberFormatOptions): NumberFormat;
+ supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[];
+ supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[];
+ }
+
+ interface DateTimeFormatOptions {
+ localeMatcher?: string;
+ weekday?: string;
+ era?: string;
+ year?: string;
+ month?: string;
+ day?: string;
+ hour?: string;
+ minute?: string;
+ second?: string;
+ timeZoneName?: string;
+ formatMatcher?: string;
+ hour12?: boolean;
+ timeZone?: string;
+ }
+
+ interface ResolvedDateTimeFormatOptions {
+ locale: string;
+ calendar: string;
+ numberingSystem: string;
+ timeZone: string;
+ hour12?: boolean;
+ weekday?: string;
+ era?: string;
+ year?: string;
+ month?: string;
+ day?: string;
+ hour?: string;
+ minute?: string;
+ second?: string;
+ timeZoneName?: string;
+ }
+
+ interface DateTimeFormat {
+ format(date?: Date | number): string;
+ resolvedOptions(): ResolvedDateTimeFormatOptions;
+ }
+ var DateTimeFormat: {
+ new (locales?: string[], options?: DateTimeFormatOptions): DateTimeFormat;
+ new (locale?: string, options?: DateTimeFormatOptions): DateTimeFormat;
+ (locales?: string[], options?: DateTimeFormatOptions): DateTimeFormat;
+ (locale?: string, options?: DateTimeFormatOptions): DateTimeFormat;
+ supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[];
+ supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[];
+ }
+}
+
+interface String {
+ /**
+ * Determines whether two strings are equivalent in the current locale.
+ * @param that String to compare to target string
+ * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.
+ * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.
+ */
+ localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number;
+
+ /**
+ * Determines whether two strings are equivalent in the current locale.
+ * @param that String to compare to target string
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.
+ * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.
+ */
+ localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number;
+}
+
+interface Number {
+ /**
+ * Converts a number to a string by using the current or specified locale.
+ * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string;
+
+ /**
+ * Converts a number to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string;
+}
+
+interface Date {
+ /**
+ * Converts a date and time to a string by using the current or specified locale.
+ * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
+ /**
+ * Converts a date to a string by using the current or specified locale.
+ * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleDateString(locales?: string[], options?: Intl.DateTimeFormatOptions): string;
+
+ /**
+ * Converts a time to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleTimeString(locale?: string[], options?: Intl.DateTimeFormatOptions): string;
+
+ /**
+ * Converts a date and time to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
+
+ /**
+ * Converts a date to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleDateString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
+
+ /**
+ * Converts a time to a string by using the current or specified locale.
+ * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used.
+ * @param options An object that contains one or more properties that specify comparison options.
+ */
+ toLocaleTimeString(locale?: string, options?: Intl.DateTimeFormatOptions): string;
+}
+
+
+/////////////////////////////
+/// IE DOM APIs
+/////////////////////////////
+
+interface Algorithm {
+ name?: string;
+}
+
+interface AriaRequestEventInit extends EventInit {
+ attributeName?: string;
+ attributeValue?: string;
+}
+
+interface ClipboardEventInit extends EventInit {
+ data?: string;
+ dataType?: string;
+}
+
+interface CommandEventInit extends EventInit {
+ commandName?: string;
+ detail?: string;
+}
+
+interface CompositionEventInit extends UIEventInit {
+ data?: string;
+}
+
+interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation {
+ arrayOfDomainStrings?: string[];
+}
+
+interface CustomEventInit extends EventInit {
+ detail?: any;
+}
+
+interface DeviceAccelerationDict {
+ x?: number;
+ y?: number;
+ z?: number;
+}
+
+interface DeviceRotationRateDict {
+ alpha?: number;
+ beta?: number;
+ gamma?: number;
+}
+
+interface EventInit {
+ bubbles?: boolean;
+ cancelable?: boolean;
+}
+
+interface ExceptionInformation {
+ domain?: string;
+}
+
+interface FocusEventInit extends UIEventInit {
+ relatedTarget?: EventTarget;
+}
+
+interface HashChangeEventInit extends EventInit {
+ newURL?: string;
+ oldURL?: string;
+}
+
+interface KeyAlgorithm {
+ name?: string;
+}
+
+interface KeyboardEventInit extends SharedKeyboardAndMouseEventInit {
+ key?: string;
+ location?: number;
+ repeat?: boolean;
+}
+
+interface MouseEventInit extends SharedKeyboardAndMouseEventInit {
+ screenX?: number;
+ screenY?: number;
+ clientX?: number;
+ clientY?: number;
+ button?: number;
+ buttons?: number;
+ relatedTarget?: EventTarget;
+}
+
+interface MsZoomToOptions {
+ contentX?: number;
+ contentY?: number;
+ viewportX?: string;
+ viewportY?: string;
+ scaleFactor?: number;
+ animate?: string;
+}
+
+interface MutationObserverInit {
+ childList?: boolean;
+ attributes?: boolean;
+ characterData?: boolean;
+ subtree?: boolean;
+ attributeOldValue?: boolean;
+ characterDataOldValue?: boolean;
+ attributeFilter?: string[];
+}
+
+interface ObjectURLOptions {
+ oneTimeOnly?: boolean;
+}
+
+interface PointerEventInit extends MouseEventInit {
+ pointerId?: number;
+ width?: number;
+ height?: number;
+ pressure?: number;
+ tiltX?: number;
+ tiltY?: number;
+ pointerType?: string;
+ isPrimary?: boolean;
+}
+
+interface PositionOptions {
+ enableHighAccuracy?: boolean;
+ timeout?: number;
+ maximumAge?: number;
+}
+
+interface SharedKeyboardAndMouseEventInit extends UIEventInit {
+ ctrlKey?: boolean;
+ shiftKey?: boolean;
+ altKey?: boolean;
+ metaKey?: boolean;
+ keyModifierStateAltGraph?: boolean;
+ keyModifierStateCapsLock?: boolean;
+ keyModifierStateFn?: boolean;
+ keyModifierStateFnLock?: boolean;
+ keyModifierStateHyper?: boolean;
+ keyModifierStateNumLock?: boolean;
+ keyModifierStateOS?: boolean;
+ keyModifierStateScrollLock?: boolean;
+ keyModifierStateSuper?: boolean;
+ keyModifierStateSymbol?: boolean;
+ keyModifierStateSymbolLock?: boolean;
+}
+
+interface StoreExceptionsInformation extends ExceptionInformation {
+ siteName?: string;
+ explanationString?: string;
+ detailURI?: string;
+}
+
+interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {
+ arrayOfDomainStrings?: string[];
+}
+
+interface UIEventInit extends EventInit {
+ view?: Window;
+ detail?: number;
+}
+
+interface WebGLContextAttributes {
+ alpha?: boolean;
+ depth?: boolean;
+ stencil?: boolean;
+ antialias?: boolean;
+ premultipliedAlpha?: boolean;
+ preserveDrawingBuffer?: boolean;
+}
+
+interface WebGLContextEventInit extends EventInit {
+ statusMessage?: string;
+}
+
+interface WheelEventInit extends MouseEventInit {
+ deltaX?: number;
+ deltaY?: number;
+ deltaZ?: number;
+ deltaMode?: number;
+}
+
+interface EventListener {
+ (evt: Event): void;
+}
+
+interface ANGLE_instanced_arrays {
+ drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void;
+ drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void;
+ vertexAttribDivisorANGLE(index: number, divisor: number): void;
+ VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;
+}
+
+declare var ANGLE_instanced_arrays: {
+ prototype: ANGLE_instanced_arrays;
+ new(): ANGLE_instanced_arrays;
+ VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;
+}
+
+interface AnalyserNode extends AudioNode {
+ fftSize: number;
+ frequencyBinCount: number;
+ maxDecibels: number;
+ minDecibels: number;
+ smoothingTimeConstant: number;
+ getByteFrequencyData(array: Uint8Array): void;
+ getByteTimeDomainData(array: Uint8Array): void;
+ getFloatFrequencyData(array: Float32Array): void;
+ getFloatTimeDomainData(array: Float32Array): void;
+}
+
+declare var AnalyserNode: {
+ prototype: AnalyserNode;
+ new(): AnalyserNode;
+}
+
+interface AnimationEvent extends Event {
+ animationName: string;
+ elapsedTime: number;
+ initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void;
+}
+
+declare var AnimationEvent: {
+ prototype: AnimationEvent;
+ new(): AnimationEvent;
+}
+
+interface ApplicationCache extends EventTarget {
+ oncached: (ev: Event) => any;
+ onchecking: (ev: Event) => any;
+ ondownloading: (ev: Event) => any;
+ onerror: (ev: Event) => any;
+ onnoupdate: (ev: Event) => any;
+ onobsolete: (ev: Event) => any;
+ onprogress: (ev: ProgressEvent) => any;
+ onupdateready: (ev: Event) => any;
+ status: number;
+ abort(): void;
+ swapCache(): void;
+ update(): void;
+ CHECKING: number;
+ DOWNLOADING: number;
+ IDLE: number;
+ OBSOLETE: number;
+ UNCACHED: number;
+ UPDATEREADY: number;
+ addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var ApplicationCache: {
+ prototype: ApplicationCache;
+ new(): ApplicationCache;
+ CHECKING: number;
+ DOWNLOADING: number;
+ IDLE: number;
+ OBSOLETE: number;
+ UNCACHED: number;
+ UPDATEREADY: number;
+}
+
+interface AriaRequestEvent extends Event {
+ attributeName: string;
+ attributeValue: string;
+}
+
+declare var AriaRequestEvent: {
+ prototype: AriaRequestEvent;
+ new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent;
+}
+
+interface Attr extends Node {
+ name: string;
+ ownerElement: Element;
+ specified: boolean;
+ value: string;
+}
+
+declare var Attr: {
+ prototype: Attr;
+ new(): Attr;
+}
+
+interface AudioBuffer {
+ duration: number;
+ length: number;
+ numberOfChannels: number;
+ sampleRate: number;
+ getChannelData(channel: number): Float32Array;
+}
+
+declare var AudioBuffer: {
+ prototype: AudioBuffer;
+ new(): AudioBuffer;
+}
+
+interface AudioBufferSourceNode extends AudioNode {
+ buffer: AudioBuffer;
+ loop: boolean;
+ loopEnd: number;
+ loopStart: number;
+ onended: (ev: Event) => any;
+ playbackRate: AudioParam;
+ start(when?: number, offset?: number, duration?: number): void;
+ stop(when?: number): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var AudioBufferSourceNode: {
+ prototype: AudioBufferSourceNode;
+ new(): AudioBufferSourceNode;
+}
+
+interface AudioContext extends EventTarget {
+ currentTime: number;
+ destination: AudioDestinationNode;
+ listener: AudioListener;
+ sampleRate: number;
+ state: string;
+ createAnalyser(): AnalyserNode;
+ createBiquadFilter(): BiquadFilterNode;
+ createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;
+ createBufferSource(): AudioBufferSourceNode;
+ createChannelMerger(numberOfInputs?: number): ChannelMergerNode;
+ createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode;
+ createConvolver(): ConvolverNode;
+ createDelay(maxDelayTime?: number): DelayNode;
+ createDynamicsCompressor(): DynamicsCompressorNode;
+ createGain(): GainNode;
+ createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;
+ createOscillator(): OscillatorNode;
+ createPanner(): PannerNode;
+ createPeriodicWave(real: Float32Array, imag: Float32Array): PeriodicWave;
+ createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;
+ createStereoPanner(): StereoPannerNode;
+ createWaveShaper(): WaveShaperNode;
+ decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): void;
+}
+
+declare var AudioContext: {
+ prototype: AudioContext;
+ new(): AudioContext;
+}
+
+interface AudioDestinationNode extends AudioNode {
+ maxChannelCount: number;
+}
+
+declare var AudioDestinationNode: {
+ prototype: AudioDestinationNode;
+ new(): AudioDestinationNode;
+}
+
+interface AudioListener {
+ dopplerFactor: number;
+ speedOfSound: number;
+ setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void;
+ setPosition(x: number, y: number, z: number): void;
+ setVelocity(x: number, y: number, z: number): void;
+}
+
+declare var AudioListener: {
+ prototype: AudioListener;
+ new(): AudioListener;
+}
+
+interface AudioNode extends EventTarget {
+ channelCount: number;
+ channelCountMode: string;
+ channelInterpretation: string;
+ context: AudioContext;
+ numberOfInputs: number;
+ numberOfOutputs: number;
+ connect(destination: AudioNode, output?: number, input?: number): void;
+ disconnect(output?: number): void;
+}
+
+declare var AudioNode: {
+ prototype: AudioNode;
+ new(): AudioNode;
+}
+
+interface AudioParam {
+ defaultValue: number;
+ value: number;
+ cancelScheduledValues(startTime: number): void;
+ exponentialRampToValueAtTime(value: number, endTime: number): void;
+ linearRampToValueAtTime(value: number, endTime: number): void;
+ setTargetAtTime(target: number, startTime: number, timeConstant: number): void;
+ setValueAtTime(value: number, startTime: number): void;
+ setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): void;
+}
+
+declare var AudioParam: {
+ prototype: AudioParam;
+ new(): AudioParam;
+}
+
+interface AudioProcessingEvent extends Event {
+ inputBuffer: AudioBuffer;
+ outputBuffer: AudioBuffer;
+ playbackTime: number;
+}
+
+declare var AudioProcessingEvent: {
+ prototype: AudioProcessingEvent;
+ new(): AudioProcessingEvent;
+}
+
+interface AudioTrack {
+ enabled: boolean;
+ id: string;
+ kind: string;
+ label: string;
+ language: string;
+ sourceBuffer: SourceBuffer;
+}
+
+declare var AudioTrack: {
+ prototype: AudioTrack;
+ new(): AudioTrack;
+}
+
+interface AudioTrackList extends EventTarget {
+ length: number;
+ onaddtrack: (ev: TrackEvent) => any;
+ onchange: (ev: Event) => any;
+ onremovetrack: (ev: TrackEvent) => any;
+ getTrackById(id: string): AudioTrack;
+ item(index: number): AudioTrack;
+ addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+ [index: number]: AudioTrack;
+}
+
+declare var AudioTrackList: {
+ prototype: AudioTrackList;
+ new(): AudioTrackList;
+}
+
+interface BarProp {
+ visible: boolean;
+}
+
+declare var BarProp: {
+ prototype: BarProp;
+ new(): BarProp;
+}
+
+interface BeforeUnloadEvent extends Event {
+ returnValue: any;
+}
+
+declare var BeforeUnloadEvent: {
+ prototype: BeforeUnloadEvent;
+ new(): BeforeUnloadEvent;
+}
+
+interface BiquadFilterNode extends AudioNode {
+ Q: AudioParam;
+ detune: AudioParam;
+ frequency: AudioParam;
+ gain: AudioParam;
+ type: string;
+ getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;
+}
+
+declare var BiquadFilterNode: {
+ prototype: BiquadFilterNode;
+ new(): BiquadFilterNode;
+}
+
+interface Blob {
+ size: number;
+ type: string;
+ msClose(): void;
+ msDetachStream(): any;
+ slice(start?: number, end?: number, contentType?: string): Blob;
+}
+
+declare var Blob: {
+ prototype: Blob;
+ new (blobParts?: any[], options?: BlobPropertyBag): Blob;
+}
+
+interface CDATASection extends Text {
+}
+
+declare var CDATASection: {
+ prototype: CDATASection;
+ new(): CDATASection;
+}
+
+interface CSS {
+ supports(property: string, value?: string): boolean;
+}
+declare var CSS: CSS;
+
+interface CSSConditionRule extends CSSGroupingRule {
+ conditionText: string;
+}
+
+declare var CSSConditionRule: {
+ prototype: CSSConditionRule;
+ new(): CSSConditionRule;
+}
+
+interface CSSFontFaceRule extends CSSRule {
+ style: CSSStyleDeclaration;
+}
+
+declare var CSSFontFaceRule: {
+ prototype: CSSFontFaceRule;
+ new(): CSSFontFaceRule;
+}
+
+interface CSSGroupingRule extends CSSRule {
+ cssRules: CSSRuleList;
+ deleteRule(index?: number): void;
+ insertRule(rule: string, index?: number): number;
+}
+
+declare var CSSGroupingRule: {
+ prototype: CSSGroupingRule;
+ new(): CSSGroupingRule;
+}
+
+interface CSSImportRule extends CSSRule {
+ href: string;
+ media: MediaList;
+ styleSheet: CSSStyleSheet;
+}
+
+declare var CSSImportRule: {
+ prototype: CSSImportRule;
+ new(): CSSImportRule;
+}
+
+interface CSSKeyframeRule extends CSSRule {
+ keyText: string;
+ style: CSSStyleDeclaration;
+}
+
+declare var CSSKeyframeRule: {
+ prototype: CSSKeyframeRule;
+ new(): CSSKeyframeRule;
+}
+
+interface CSSKeyframesRule extends CSSRule {
+ cssRules: CSSRuleList;
+ name: string;
+ appendRule(rule: string): void;
+ deleteRule(rule: string): void;
+ findRule(rule: string): CSSKeyframeRule;
+}
+
+declare var CSSKeyframesRule: {
+ prototype: CSSKeyframesRule;
+ new(): CSSKeyframesRule;
+}
+
+interface CSSMediaRule extends CSSConditionRule {
+ media: MediaList;
+}
+
+declare var CSSMediaRule: {
+ prototype: CSSMediaRule;
+ new(): CSSMediaRule;
+}
+
+interface CSSNamespaceRule extends CSSRule {
+ namespaceURI: string;
+ prefix: string;
+}
+
+declare var CSSNamespaceRule: {
+ prototype: CSSNamespaceRule;
+ new(): CSSNamespaceRule;
+}
+
+interface CSSPageRule extends CSSRule {
+ pseudoClass: string;
+ selector: string;
+ selectorText: string;
+ style: CSSStyleDeclaration;
+}
+
+declare var CSSPageRule: {
+ prototype: CSSPageRule;
+ new(): CSSPageRule;
+}
+
+interface CSSRule {
+ cssText: string;
+ parentRule: CSSRule;
+ parentStyleSheet: CSSStyleSheet;
+ type: number;
+ CHARSET_RULE: number;
+ FONT_FACE_RULE: number;
+ IMPORT_RULE: number;
+ KEYFRAMES_RULE: number;
+ KEYFRAME_RULE: number;
+ MEDIA_RULE: number;
+ NAMESPACE_RULE: number;
+ PAGE_RULE: number;
+ STYLE_RULE: number;
+ SUPPORTS_RULE: number;
+ UNKNOWN_RULE: number;
+ VIEWPORT_RULE: number;
+}
+
+declare var CSSRule: {
+ prototype: CSSRule;
+ new(): CSSRule;
+ CHARSET_RULE: number;
+ FONT_FACE_RULE: number;
+ IMPORT_RULE: number;
+ KEYFRAMES_RULE: number;
+ KEYFRAME_RULE: number;
+ MEDIA_RULE: number;
+ NAMESPACE_RULE: number;
+ PAGE_RULE: number;
+ STYLE_RULE: number;
+ SUPPORTS_RULE: number;
+ UNKNOWN_RULE: number;
+ VIEWPORT_RULE: number;
+}
+
+interface CSSRuleList {
+ length: number;
+ item(index: number): CSSRule;
+ [index: number]: CSSRule;
+}
+
+declare var CSSRuleList: {
+ prototype: CSSRuleList;
+ new(): CSSRuleList;
+}
+
+interface CSSStyleDeclaration {
+ alignContent: string;
+ alignItems: string;
+ alignSelf: string;
+ alignmentBaseline: string;
+ animation: string;
+ animationDelay: string;
+ animationDirection: string;
+ animationDuration: string;
+ animationFillMode: string;
+ animationIterationCount: string;
+ animationName: string;
+ animationPlayState: string;
+ animationTimingFunction: string;
+ backfaceVisibility: string;
+ background: string;
+ backgroundAttachment: string;
+ backgroundClip: string;
+ backgroundColor: string;
+ backgroundImage: string;
+ backgroundOrigin: string;
+ backgroundPosition: string;
+ backgroundPositionX: string;
+ backgroundPositionY: string;
+ backgroundRepeat: string;
+ backgroundSize: string;
+ baselineShift: string;
+ border: string;
+ borderBottom: string;
+ borderBottomColor: string;
+ borderBottomLeftRadius: string;
+ borderBottomRightRadius: string;
+ borderBottomStyle: string;
+ borderBottomWidth: string;
+ borderCollapse: string;
+ borderColor: string;
+ borderImage: string;
+ borderImageOutset: string;
+ borderImageRepeat: string;
+ borderImageSlice: string;
+ borderImageSource: string;
+ borderImageWidth: string;
+ borderLeft: string;
+ borderLeftColor: string;
+ borderLeftStyle: string;
+ borderLeftWidth: string;
+ borderRadius: string;
+ borderRight: string;
+ borderRightColor: string;
+ borderRightStyle: string;
+ borderRightWidth: string;
+ borderSpacing: string;
+ borderStyle: string;
+ borderTop: string;
+ borderTopColor: string;
+ borderTopLeftRadius: string;
+ borderTopRightRadius: string;
+ borderTopStyle: string;
+ borderTopWidth: string;
+ borderWidth: string;
+ bottom: string;
+ boxShadow: string;
+ boxSizing: string;
+ breakAfter: string;
+ breakBefore: string;
+ breakInside: string;
+ captionSide: string;
+ clear: string;
+ clip: string;
+ clipPath: string;
+ clipRule: string;
+ color: string;
+ colorInterpolationFilters: string;
+ columnCount: any;
+ columnFill: string;
+ columnGap: any;
+ columnRule: string;
+ columnRuleColor: any;
+ columnRuleStyle: string;
+ columnRuleWidth: any;
+ columnSpan: string;
+ columnWidth: any;
+ columns: string;
+ content: string;
+ counterIncrement: string;
+ counterReset: string;
+ cssFloat: string;
+ cssText: string;
+ cursor: string;
+ direction: string;
+ display: string;
+ dominantBaseline: string;
+ emptyCells: string;
+ enableBackground: string;
+ fill: string;
+ fillOpacity: string;
+ fillRule: string;
+ filter: string;
+ flex: string;
+ flexBasis: string;
+ flexDirection: string;
+ flexFlow: string;
+ flexGrow: string;
+ flexShrink: string;
+ flexWrap: string;
+ floodColor: string;
+ floodOpacity: string;
+ font: string;
+ fontFamily: string;
+ fontFeatureSettings: string;
+ fontSize: string;
+ fontSizeAdjust: string;
+ fontStretch: string;
+ fontStyle: string;
+ fontVariant: string;
+ fontWeight: string;
+ glyphOrientationHorizontal: string;
+ glyphOrientationVertical: string;
+ height: string;
+ imeMode: string;
+ justifyContent: string;
+ kerning: string;
+ left: string;
+ length: number;
+ letterSpacing: string;
+ lightingColor: string;
+ lineHeight: string;
+ listStyle: string;
+ listStyleImage: string;
+ listStylePosition: string;
+ listStyleType: string;
+ margin: string;
+ marginBottom: string;
+ marginLeft: string;
+ marginRight: string;
+ marginTop: string;
+ marker: string;
+ markerEnd: string;
+ markerMid: string;
+ markerStart: string;
+ mask: string;
+ maxHeight: string;
+ maxWidth: string;
+ minHeight: string;
+ minWidth: string;
+ msContentZoomChaining: string;
+ msContentZoomLimit: string;
+ msContentZoomLimitMax: any;
+ msContentZoomLimitMin: any;
+ msContentZoomSnap: string;
+ msContentZoomSnapPoints: string;
+ msContentZoomSnapType: string;
+ msContentZooming: string;
+ msFlowFrom: string;
+ msFlowInto: string;
+ msFontFeatureSettings: string;
+ msGridColumn: any;
+ msGridColumnAlign: string;
+ msGridColumnSpan: any;
+ msGridColumns: string;
+ msGridRow: any;
+ msGridRowAlign: string;
+ msGridRowSpan: any;
+ msGridRows: string;
+ msHighContrastAdjust: string;
+ msHyphenateLimitChars: string;
+ msHyphenateLimitLines: any;
+ msHyphenateLimitZone: any;
+ msHyphens: string;
+ msImeAlign: string;
+ msOverflowStyle: string;
+ msScrollChaining: string;
+ msScrollLimit: string;
+ msScrollLimitXMax: any;
+ msScrollLimitXMin: any;
+ msScrollLimitYMax: any;
+ msScrollLimitYMin: any;
+ msScrollRails: string;
+ msScrollSnapPointsX: string;
+ msScrollSnapPointsY: string;
+ msScrollSnapType: string;
+ msScrollSnapX: string;
+ msScrollSnapY: string;
+ msScrollTranslation: string;
+ msTextCombineHorizontal: string;
+ msTextSizeAdjust: any;
+ msTouchAction: string;
+ msTouchSelect: string;
+ msUserSelect: string;
+ msWrapFlow: string;
+ msWrapMargin: any;
+ msWrapThrough: string;
+ opacity: string;
+ order: string;
+ orphans: string;
+ outline: string;
+ outlineColor: string;
+ outlineStyle: string;
+ outlineWidth: string;
+ overflow: string;
+ overflowX: string;
+ overflowY: string;
+ padding: string;
+ paddingBottom: string;
+ paddingLeft: string;
+ paddingRight: string;
+ paddingTop: string;
+ pageBreakAfter: string;
+ pageBreakBefore: string;
+ pageBreakInside: string;
+ parentRule: CSSRule;
+ perspective: string;
+ perspectiveOrigin: string;
+ pointerEvents: string;
+ position: string;
+ quotes: string;
+ right: string;
+ rubyAlign: string;
+ rubyOverhang: string;
+ rubyPosition: string;
+ stopColor: string;
+ stopOpacity: string;
+ stroke: string;
+ strokeDasharray: string;
+ strokeDashoffset: string;
+ strokeLinecap: string;
+ strokeLinejoin: string;
+ strokeMiterlimit: string;
+ strokeOpacity: string;
+ strokeWidth: string;
+ tableLayout: string;
+ textAlign: string;
+ textAlignLast: string;
+ textAnchor: string;
+ textDecoration: string;
+ textFillColor: string;
+ textIndent: string;
+ textJustify: string;
+ textKashida: string;
+ textKashidaSpace: string;
+ textOverflow: string;
+ textShadow: string;
+ textTransform: string;
+ textUnderlinePosition: string;
+ top: string;
+ touchAction: string;
+ transform: string;
+ transformOrigin: string;
+ transformStyle: string;
+ transition: string;
+ transitionDelay: string;
+ transitionDuration: string;
+ transitionProperty: string;
+ transitionTimingFunction: string;
+ unicodeBidi: string;
+ verticalAlign: string;
+ visibility: string;
+ webkitAlignContent: string;
+ webkitAlignItems: string;
+ webkitAlignSelf: string;
+ webkitAnimation: string;
+ webkitAnimationDelay: string;
+ webkitAnimationDirection: string;
+ webkitAnimationDuration: string;
+ webkitAnimationFillMode: string;
+ webkitAnimationIterationCount: string;
+ webkitAnimationName: string;
+ webkitAnimationPlayState: string;
+ webkitAnimationTimingFunction: string;
+ webkitAppearance: string;
+ webkitBackfaceVisibility: string;
+ webkitBackground: string;
+ webkitBackgroundAttachment: string;
+ webkitBackgroundClip: string;
+ webkitBackgroundColor: string;
+ webkitBackgroundImage: string;
+ webkitBackgroundOrigin: string;
+ webkitBackgroundPosition: string;
+ webkitBackgroundPositionX: string;
+ webkitBackgroundPositionY: string;
+ webkitBackgroundRepeat: string;
+ webkitBackgroundSize: string;
+ webkitBorderBottomLeftRadius: string;
+ webkitBorderBottomRightRadius: string;
+ webkitBorderImage: string;
+ webkitBorderImageOutset: string;
+ webkitBorderImageRepeat: string;
+ webkitBorderImageSlice: string;
+ webkitBorderImageSource: string;
+ webkitBorderImageWidth: string;
+ webkitBorderRadius: string;
+ webkitBorderTopLeftRadius: string;
+ webkitBorderTopRightRadius: string;
+ webkitBoxAlign: string;
+ webkitBoxDirection: string;
+ webkitBoxFlex: string;
+ webkitBoxOrdinalGroup: string;
+ webkitBoxOrient: string;
+ webkitBoxPack: string;
+ webkitBoxSizing: string;
+ webkitColumnBreakAfter: string;
+ webkitColumnBreakBefore: string;
+ webkitColumnBreakInside: string;
+ webkitColumnCount: any;
+ webkitColumnGap: any;
+ webkitColumnRule: string;
+ webkitColumnRuleColor: any;
+ webkitColumnRuleStyle: string;
+ webkitColumnRuleWidth: any;
+ webkitColumnSpan: string;
+ webkitColumnWidth: any;
+ webkitColumns: string;
+ webkitFilter: string;
+ webkitFlex: string;
+ webkitFlexBasis: string;
+ webkitFlexDirection: string;
+ webkitFlexFlow: string;
+ webkitFlexGrow: string;
+ webkitFlexShrink: string;
+ webkitFlexWrap: string;
+ webkitJustifyContent: string;
+ webkitOrder: string;
+ webkitPerspective: string;
+ webkitPerspectiveOrigin: string;
+ webkitTapHighlightColor: string;
+ webkitTextFillColor: string;
+ webkitTextSizeAdjust: any;
+ webkitTransform: string;
+ webkitTransformOrigin: string;
+ webkitTransformStyle: string;
+ webkitTransition: string;
+ webkitTransitionDelay: string;
+ webkitTransitionDuration: string;
+ webkitTransitionProperty: string;
+ webkitTransitionTimingFunction: string;
+ webkitUserSelect: string;
+ webkitWritingMode: string;
+ whiteSpace: string;
+ widows: string;
+ width: string;
+ wordBreak: string;
+ wordSpacing: string;
+ wordWrap: string;
+ writingMode: string;
+ zIndex: string;
+ zoom: string;
+ getPropertyPriority(propertyName: string): string;
+ getPropertyValue(propertyName: string): string;
+ item(index: number): string;
+ removeProperty(propertyName: string): string;
+ setProperty(propertyName: string, value: string, priority?: string): void;
+ [index: number]: string;
+}
+
+declare var CSSStyleDeclaration: {
+ prototype: CSSStyleDeclaration;
+ new(): CSSStyleDeclaration;
+}
+
+interface CSSStyleRule extends CSSRule {
+ readOnly: boolean;
+ selectorText: string;
+ style: CSSStyleDeclaration;
+}
+
+declare var CSSStyleRule: {
+ prototype: CSSStyleRule;
+ new(): CSSStyleRule;
+}
+
+interface CSSStyleSheet extends StyleSheet {
+ cssRules: CSSRuleList;
+ cssText: string;
+ href: string;
+ id: string;
+ imports: StyleSheetList;
+ isAlternate: boolean;
+ isPrefAlternate: boolean;
+ ownerRule: CSSRule;
+ owningElement: Element;
+ pages: StyleSheetPageList;
+ readOnly: boolean;
+ rules: CSSRuleList;
+ addImport(bstrURL: string, lIndex?: number): number;
+ addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number;
+ addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number;
+ deleteRule(index?: number): void;
+ insertRule(rule: string, index?: number): number;
+ removeImport(lIndex: number): void;
+ removeRule(lIndex: number): void;
+}
+
+declare var CSSStyleSheet: {
+ prototype: CSSStyleSheet;
+ new(): CSSStyleSheet;
+}
+
+interface CSSSupportsRule extends CSSConditionRule {
+}
+
+declare var CSSSupportsRule: {
+ prototype: CSSSupportsRule;
+ new(): CSSSupportsRule;
+}
+
+interface CanvasGradient {
+ addColorStop(offset: number, color: string): void;
+}
+
+declare var CanvasGradient: {
+ prototype: CanvasGradient;
+ new(): CanvasGradient;
+}
+
+interface CanvasPattern {
+}
+
+declare var CanvasPattern: {
+ prototype: CanvasPattern;
+ new(): CanvasPattern;
+}
+
+interface CanvasRenderingContext2D {
+ canvas: HTMLCanvasElement;
+ fillStyle: string | CanvasGradient | CanvasPattern;
+ font: string;
+ globalAlpha: number;
+ globalCompositeOperation: string;
+ lineCap: string;
+ lineDashOffset: number;
+ lineJoin: string;
+ lineWidth: number;
+ miterLimit: number;
+ msFillRule: string;
+ msImageSmoothingEnabled: boolean;
+ shadowBlur: number;
+ shadowColor: string;
+ shadowOffsetX: number;
+ shadowOffsetY: number;
+ strokeStyle: string | CanvasGradient | CanvasPattern;
+ textAlign: string;
+ textBaseline: string;
+ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
+ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
+ beginPath(): void;
+ bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
+ clearRect(x: number, y: number, w: number, h: number): void;
+ clip(fillRule?: string): void;
+ closePath(): void;
+ createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData;
+ createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;
+ createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern;
+ createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;
+ drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void;
+ fill(fillRule?: string): void;
+ fillRect(x: number, y: number, w: number, h: number): void;
+ fillText(text: string, x: number, y: number, maxWidth?: number): void;
+ getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;
+ getLineDash(): number[];
+ isPointInPath(x: number, y: number, fillRule?: string): boolean;
+ lineTo(x: number, y: number): void;
+ measureText(text: string): TextMetrics;
+ moveTo(x: number, y: number): void;
+ putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void;
+ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
+ rect(x: number, y: number, w: number, h: number): void;
+ restore(): void;
+ rotate(angle: number): void;
+ save(): void;
+ scale(x: number, y: number): void;
+ setLineDash(segments: number[]): void;
+ setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;
+ stroke(): void;
+ strokeRect(x: number, y: number, w: number, h: number): void;
+ strokeText(text: string, x: number, y: number, maxWidth?: number): void;
+ transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;
+ translate(x: number, y: number): void;
+}
+
+declare var CanvasRenderingContext2D: {
+ prototype: CanvasRenderingContext2D;
+ new(): CanvasRenderingContext2D;
+}
+
+interface ChannelMergerNode extends AudioNode {
+}
+
+declare var ChannelMergerNode: {
+ prototype: ChannelMergerNode;
+ new(): ChannelMergerNode;
+}
+
+interface ChannelSplitterNode extends AudioNode {
+}
+
+declare var ChannelSplitterNode: {
+ prototype: ChannelSplitterNode;
+ new(): ChannelSplitterNode;
+}
+
+interface CharacterData extends Node, ChildNode {
+ data: string;
+ length: number;
+ appendData(arg: string): void;
+ deleteData(offset: number, count: number): void;
+ insertData(offset: number, arg: string): void;
+ replaceData(offset: number, count: number, arg: string): void;
+ substringData(offset: number, count: number): string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var CharacterData: {
+ prototype: CharacterData;
+ new(): CharacterData;
+}
+
+interface ClientRect {
+ bottom: number;
+ height: number;
+ left: number;
+ right: number;
+ top: number;
+ width: number;
+}
+
+declare var ClientRect: {
+ prototype: ClientRect;
+ new(): ClientRect;
+}
+
+interface ClientRectList {
+ length: number;
+ item(index: number): ClientRect;
+ [index: number]: ClientRect;
+}
+
+declare var ClientRectList: {
+ prototype: ClientRectList;
+ new(): ClientRectList;
+}
+
+interface ClipboardEvent extends Event {
+ clipboardData: DataTransfer;
+}
+
+declare var ClipboardEvent: {
+ prototype: ClipboardEvent;
+ new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;
+}
+
+interface CloseEvent extends Event {
+ code: number;
+ reason: string;
+ wasClean: boolean;
+ initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void;
+}
+
+declare var CloseEvent: {
+ prototype: CloseEvent;
+ new(): CloseEvent;
+}
+
+interface CommandEvent extends Event {
+ commandName: string;
+ detail: string;
+}
+
+declare var CommandEvent: {
+ prototype: CommandEvent;
+ new(type: string, eventInitDict?: CommandEventInit): CommandEvent;
+}
+
+interface Comment extends CharacterData {
+ text: string;
+}
+
+declare var Comment: {
+ prototype: Comment;
+ new(): Comment;
+}
+
+interface CompositionEvent extends UIEvent {
+ data: string;
+ locale: string;
+ initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void;
+}
+
+declare var CompositionEvent: {
+ prototype: CompositionEvent;
+ new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent;
+}
+
+interface Console {
+ assert(test?: boolean, message?: string, ...optionalParams: any[]): void;
+ clear(): void;
+ count(countTitle?: string): void;
+ debug(message?: string, ...optionalParams: any[]): void;
+ dir(value?: any, ...optionalParams: any[]): void;
+ dirxml(value: any): void;
+ error(message?: any, ...optionalParams: any[]): void;
+ group(groupTitle?: string): void;
+ groupCollapsed(groupTitle?: string): void;
+ groupEnd(): void;
+ info(message?: any, ...optionalParams: any[]): void;
+ log(message?: any, ...optionalParams: any[]): void;
+ msIsIndependentlyComposed(element: Element): boolean;
+ profile(reportName?: string): void;
+ profileEnd(): void;
+ select(element: Element): void;
+ time(timerName?: string): void;
+ timeEnd(timerName?: string): void;
+ trace(): void;
+ warn(message?: any, ...optionalParams: any[]): void;
+}
+
+declare var Console: {
+ prototype: Console;
+ new(): Console;
+}
+
+interface ConvolverNode extends AudioNode {
+ buffer: AudioBuffer;
+ normalize: boolean;
+}
+
+declare var ConvolverNode: {
+ prototype: ConvolverNode;
+ new(): ConvolverNode;
+}
+
+interface Coordinates {
+ accuracy: number;
+ altitude: number;
+ altitudeAccuracy: number;
+ heading: number;
+ latitude: number;
+ longitude: number;
+ speed: number;
+}
+
+declare var Coordinates: {
+ prototype: Coordinates;
+ new(): Coordinates;
+}
+
+interface Crypto extends Object, RandomSource {
+ subtle: SubtleCrypto;
+}
+
+declare var Crypto: {
+ prototype: Crypto;
+ new(): Crypto;
+}
+
+interface CryptoKey {
+ algorithm: KeyAlgorithm;
+ extractable: boolean;
+ type: string;
+ usages: string[];
+}
+
+declare var CryptoKey: {
+ prototype: CryptoKey;
+ new(): CryptoKey;
+}
+
+interface CryptoKeyPair {
+ privateKey: CryptoKey;
+ publicKey: CryptoKey;
+}
+
+declare var CryptoKeyPair: {
+ prototype: CryptoKeyPair;
+ new(): CryptoKeyPair;
+}
+
+interface CustomEvent extends Event {
+ detail: any;
+ initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void;
+}
+
+declare var CustomEvent: {
+ prototype: CustomEvent;
+ new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent;
+}
+
+interface DOMError {
+ name: string;
+ toString(): string;
+}
+
+declare var DOMError: {
+ prototype: DOMError;
+ new(): DOMError;
+}
+
+interface DOMException {
+ code: number;
+ message: string;
+ name: string;
+ toString(): string;
+ ABORT_ERR: number;
+ DATA_CLONE_ERR: number;
+ DOMSTRING_SIZE_ERR: number;
+ HIERARCHY_REQUEST_ERR: number;
+ INDEX_SIZE_ERR: number;
+ INUSE_ATTRIBUTE_ERR: number;
+ INVALID_ACCESS_ERR: number;
+ INVALID_CHARACTER_ERR: number;
+ INVALID_MODIFICATION_ERR: number;
+ INVALID_NODE_TYPE_ERR: number;
+ INVALID_STATE_ERR: number;
+ NAMESPACE_ERR: number;
+ NETWORK_ERR: number;
+ NOT_FOUND_ERR: number;
+ NOT_SUPPORTED_ERR: number;
+ NO_DATA_ALLOWED_ERR: number;
+ NO_MODIFICATION_ALLOWED_ERR: number;
+ PARSE_ERR: number;
+ QUOTA_EXCEEDED_ERR: number;
+ SECURITY_ERR: number;
+ SERIALIZE_ERR: number;
+ SYNTAX_ERR: number;
+ TIMEOUT_ERR: number;
+ TYPE_MISMATCH_ERR: number;
+ URL_MISMATCH_ERR: number;
+ VALIDATION_ERR: number;
+ WRONG_DOCUMENT_ERR: number;
+}
+
+declare var DOMException: {
+ prototype: DOMException;
+ new(): DOMException;
+ ABORT_ERR: number;
+ DATA_CLONE_ERR: number;
+ DOMSTRING_SIZE_ERR: number;
+ HIERARCHY_REQUEST_ERR: number;
+ INDEX_SIZE_ERR: number;
+ INUSE_ATTRIBUTE_ERR: number;
+ INVALID_ACCESS_ERR: number;
+ INVALID_CHARACTER_ERR: number;
+ INVALID_MODIFICATION_ERR: number;
+ INVALID_NODE_TYPE_ERR: number;
+ INVALID_STATE_ERR: number;
+ NAMESPACE_ERR: number;
+ NETWORK_ERR: number;
+ NOT_FOUND_ERR: number;
+ NOT_SUPPORTED_ERR: number;
+ NO_DATA_ALLOWED_ERR: number;
+ NO_MODIFICATION_ALLOWED_ERR: number;
+ PARSE_ERR: number;
+ QUOTA_EXCEEDED_ERR: number;
+ SECURITY_ERR: number;
+ SERIALIZE_ERR: number;
+ SYNTAX_ERR: number;
+ TIMEOUT_ERR: number;
+ TYPE_MISMATCH_ERR: number;
+ URL_MISMATCH_ERR: number;
+ VALIDATION_ERR: number;
+ WRONG_DOCUMENT_ERR: number;
+}
+
+interface DOMImplementation {
+ createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document;
+ createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType;
+ createHTMLDocument(title: string): Document;
+ hasFeature(feature: string, version: string): boolean;
+}
+
+declare var DOMImplementation: {
+ prototype: DOMImplementation;
+ new(): DOMImplementation;
+}
+
+interface DOMParser {
+ parseFromString(source: string, mimeType: string): Document;
+}
+
+declare var DOMParser: {
+ prototype: DOMParser;
+ new(): DOMParser;
+}
+
+interface DOMSettableTokenList extends DOMTokenList {
+ value: string;
+}
+
+declare var DOMSettableTokenList: {
+ prototype: DOMSettableTokenList;
+ new(): DOMSettableTokenList;
+}
+
+interface DOMStringList {
+ length: number;
+ contains(str: string): boolean;
+ item(index: number): string;
+ [index: number]: string;
+}
+
+declare var DOMStringList: {
+ prototype: DOMStringList;
+ new(): DOMStringList;
+}
+
+interface DOMStringMap {
+ [name: string]: string;
+}
+
+declare var DOMStringMap: {
+ prototype: DOMStringMap;
+ new(): DOMStringMap;
+}
+
+interface DOMTokenList {
+ length: number;
+ add(...token: string[]): void;
+ contains(token: string): boolean;
+ item(index: number): string;
+ remove(...token: string[]): void;
+ toString(): string;
+ toggle(token: string, force?: boolean): boolean;
+ [index: number]: string;
+}
+
+declare var DOMTokenList: {
+ prototype: DOMTokenList;
+ new(): DOMTokenList;
+}
+
+interface DataCue extends TextTrackCue {
+ data: ArrayBuffer;
+}
+
+declare var DataCue: {
+ prototype: DataCue;
+ new(): DataCue;
+}
+
+interface DataTransfer {
+ dropEffect: string;
+ effectAllowed: string;
+ files: FileList;
+ items: DataTransferItemList;
+ types: DOMStringList;
+ clearData(format?: string): boolean;
+ getData(format: string): string;
+ setData(format: string, data: string): boolean;
+}
+
+declare var DataTransfer: {
+ prototype: DataTransfer;
+ new(): DataTransfer;
+}
+
+interface DataTransferItem {
+ kind: string;
+ type: string;
+ getAsFile(): File;
+ getAsString(_callback: FunctionStringCallback): void;
+}
+
+declare var DataTransferItem: {
+ prototype: DataTransferItem;
+ new(): DataTransferItem;
+}
+
+interface DataTransferItemList {
+ length: number;
+ add(data: File): DataTransferItem;
+ clear(): void;
+ item(index: number): File;
+ remove(index: number): void;
+ [index: number]: File;
+}
+
+declare var DataTransferItemList: {
+ prototype: DataTransferItemList;
+ new(): DataTransferItemList;
+}
+
+interface DeferredPermissionRequest {
+ id: number;
+ type: string;
+ uri: string;
+ allow(): void;
+ deny(): void;
+}
+
+declare var DeferredPermissionRequest: {
+ prototype: DeferredPermissionRequest;
+ new(): DeferredPermissionRequest;
+}
+
+interface DelayNode extends AudioNode {
+ delayTime: AudioParam;
+}
+
+declare var DelayNode: {
+ prototype: DelayNode;
+ new(): DelayNode;
+}
+
+interface DeviceAcceleration {
+ x: number;
+ y: number;
+ z: number;
+}
+
+declare var DeviceAcceleration: {
+ prototype: DeviceAcceleration;
+ new(): DeviceAcceleration;
+}
+
+interface DeviceMotionEvent extends Event {
+ acceleration: DeviceAcceleration;
+ accelerationIncludingGravity: DeviceAcceleration;
+ interval: number;
+ rotationRate: DeviceRotationRate;
+ initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void;
+}
+
+declare var DeviceMotionEvent: {
+ prototype: DeviceMotionEvent;
+ new(): DeviceMotionEvent;
+}
+
+interface DeviceOrientationEvent extends Event {
+ absolute: boolean;
+ alpha: number;
+ beta: number;
+ gamma: number;
+ initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void;
+}
+
+declare var DeviceOrientationEvent: {
+ prototype: DeviceOrientationEvent;
+ new(): DeviceOrientationEvent;
+}
+
+interface DeviceRotationRate {
+ alpha: number;
+ beta: number;
+ gamma: number;
+}
+
+declare var DeviceRotationRate: {
+ prototype: DeviceRotationRate;
+ new(): DeviceRotationRate;
+}
+
+interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent {
+ /**
+ * Sets or gets the URL for the current document.
+ */
+ URL: string;
+ /**
+ * Gets the URL for the document, stripped of any character encoding.
+ */
+ URLUnencoded: string;
+ /**
+ * Gets the object that has the focus when the parent document has focus.
+ */
+ activeElement: Element;
+ /**
+ * Sets or gets the color of all active links in the document.
+ */
+ alinkColor: string;
+ /**
+ * Returns a reference to the collection of elements contained by the object.
+ */
+ all: HTMLCollection;
+ /**
+ * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.
+ */
+ anchors: HTMLCollection;
+ /**
+ * Retrieves a collection of all applet objects in the document.
+ */
+ applets: HTMLCollection;
+ /**
+ * Deprecated. Sets or retrieves a value that indicates the background color behind the object.
+ */
+ bgColor: string;
+ /**
+ * Specifies the beginning and end of the document body.
+ */
+ body: HTMLElement;
+ characterSet: string;
+ /**
+ * Gets or sets the character set used to encode the object.
+ */
+ charset: string;
+ /**
+ * Gets a value that indicates whether standards-compliant mode is switched on for the object.
+ */
+ compatMode: string;
+ cookie: string;
+ /**
+ * Gets the default character set from the current regional language settings.
+ */
+ defaultCharset: string;
+ defaultView: Window;
+ /**
+ * Sets or gets a value that indicates whether the document can be edited.
+ */
+ designMode: string;
+ /**
+ * Sets or retrieves a value that indicates the reading order of the object.
+ */
+ dir: string;
+ /**
+ * Gets an object representing the document type declaration associated with the current document.
+ */
+ doctype: DocumentType;
+ /**
+ * Gets a reference to the root node of the document.
+ */
+ documentElement: HTMLElement;
+ /**
+ * Sets or gets the security domain of the document.
+ */
+ domain: string;
+ /**
+ * Retrieves a collection of all embed objects in the document.
+ */
+ embeds: HTMLCollection;
+ /**
+ * Sets or gets the foreground (text) color of the document.
+ */
+ fgColor: string;
+ /**
+ * Retrieves a collection, in source order, of all form objects in the document.
+ */
+ forms: HTMLCollection;
+ fullscreenElement: Element;
+ fullscreenEnabled: boolean;
+ head: HTMLHeadElement;
+ hidden: boolean;
+ /**
+ * Retrieves a collection, in source order, of img objects in the document.
+ */
+ images: HTMLCollection;
+ /**
+ * Gets the implementation object of the current document.
+ */
+ implementation: DOMImplementation;
+ /**
+ * Returns the character encoding used to create the webpage that is loaded into the document object.
+ */
+ inputEncoding: string;
+ /**
+ * Gets the date that the page was last modified, if the page supplies one.
+ */
+ lastModified: string;
+ /**
+ * Sets or gets the color of the document links.
+ */
+ linkColor: string;
+ /**
+ * Retrieves a collection of all a objects that specify the href property and all area objects in the document.
+ */
+ links: HTMLCollection;
+ /**
+ * Contains information about the current URL.
+ */
+ location: Location;
+ media: string;
+ msCSSOMElementFloatMetrics: boolean;
+ msCapsLockWarningOff: boolean;
+ msHidden: boolean;
+ msVisibilityState: string;
+ /**
+ * Fires when the user aborts the download.
+ * @param ev The event.
+ */
+ onabort: (ev: Event) => any;
+ /**
+ * Fires when the object is set as the active element.
+ * @param ev The event.
+ */
+ onactivate: (ev: UIEvent) => any;
+ /**
+ * Fires immediately before the object is set as the active element.
+ * @param ev The event.
+ */
+ onbeforeactivate: (ev: UIEvent) => any;
+ /**
+ * Fires immediately before the activeElement is changed from the current object to another object in the parent document.
+ * @param ev The event.
+ */
+ onbeforedeactivate: (ev: UIEvent) => any;
+ /**
+ * Fires when the object loses the input focus.
+ * @param ev The focus event.
+ */
+ onblur: (ev: FocusEvent) => any;
+ /**
+ * Occurs when playback is possible, but would require further buffering.
+ * @param ev The event.
+ */
+ oncanplay: (ev: Event) => any;
+ oncanplaythrough: (ev: Event) => any;
+ /**
+ * Fires when the contents of the object or selection have changed.
+ * @param ev The event.
+ */
+ onchange: (ev: Event) => any;
+ /**
+ * Fires when the user clicks the left mouse button on the object
+ * @param ev The mouse event.
+ */
+ onclick: (ev: MouseEvent) => any;
+ /**
+ * Fires when the user clicks the right mouse button in the client area, opening the context menu.
+ * @param ev The mouse event.
+ */
+ oncontextmenu: (ev: PointerEvent) => any;
+ /**
+ * Fires when the user double-clicks the object.
+ * @param ev The mouse event.
+ */
+ ondblclick: (ev: MouseEvent) => any;
+ /**
+ * Fires when the activeElement is changed from the current object to another object in the parent document.
+ * @param ev The UI Event
+ */
+ ondeactivate: (ev: UIEvent) => any;
+ /**
+ * Fires on the source object continuously during a drag operation.
+ * @param ev The event.
+ */
+ ondrag: (ev: DragEvent) => any;
+ /**
+ * Fires on the source object when the user releases the mouse at the close of a drag operation.
+ * @param ev The event.
+ */
+ ondragend: (ev: DragEvent) => any;
+ /**
+ * Fires on the target element when the user drags the object to a valid drop target.
+ * @param ev The drag event.
+ */
+ ondragenter: (ev: DragEvent) => any;
+ /**
+ * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
+ * @param ev The drag event.
+ */
+ ondragleave: (ev: DragEvent) => any;
+ /**
+ * Fires on the target element continuously while the user drags the object over a valid drop target.
+ * @param ev The event.
+ */
+ ondragover: (ev: DragEvent) => any;
+ /**
+ * Fires on the source object when the user starts to drag a text selection or selected object.
+ * @param ev The event.
+ */
+ ondragstart: (ev: DragEvent) => any;
+ ondrop: (ev: DragEvent) => any;
+ /**
+ * Occurs when the duration attribute is updated.
+ * @param ev The event.
+ */
+ ondurationchange: (ev: Event) => any;
+ /**
+ * Occurs when the media element is reset to its initial state.
+ * @param ev The event.
+ */
+ onemptied: (ev: Event) => any;
+ /**
+ * Occurs when the end of playback is reached.
+ * @param ev The event
+ */
+ onended: (ev: Event) => any;
+ /**
+ * Fires when an error occurs during object loading.
+ * @param ev The event.
+ */
+ onerror: (ev: Event) => any;
+ /**
+ * Fires when the object receives focus.
+ * @param ev The event.
+ */
+ onfocus: (ev: FocusEvent) => any;
+ onfullscreenchange: (ev: Event) => any;
+ onfullscreenerror: (ev: Event) => any;
+ oninput: (ev: Event) => any;
+ /**
+ * Fires when the user presses a key.
+ * @param ev The keyboard event
+ */
+ onkeydown: (ev: KeyboardEvent) => any;
+ /**
+ * Fires when the user presses an alphanumeric key.
+ * @param ev The event.
+ */
+ onkeypress: (ev: KeyboardEvent) => any;
+ /**
+ * Fires when the user releases a key.
+ * @param ev The keyboard event
+ */
+ onkeyup: (ev: KeyboardEvent) => any;
+ /**
+ * Fires immediately after the browser loads the object.
+ * @param ev The event.
+ */
+ onload: (ev: Event) => any;
+ /**
+ * Occurs when media data is loaded at the current playback position.
+ * @param ev The event.
+ */
+ onloadeddata: (ev: Event) => any;
+ /**
+ * Occurs when the duration and dimensions of the media have been determined.
+ * @param ev The event.
+ */
+ onloadedmetadata: (ev: Event) => any;
+ /**
+ * Occurs when Internet Explorer begins looking for media data.
+ * @param ev The event.
+ */
+ onloadstart: (ev: Event) => any;
+ /**
+ * Fires when the user clicks the object with either mouse button.
+ * @param ev The mouse event.
+ */
+ onmousedown: (ev: MouseEvent) => any;
+ /**
+ * Fires when the user moves the mouse over the object.
+ * @param ev The mouse event.
+ */
+ onmousemove: (ev: MouseEvent) => any;
+ /**
+ * Fires when the user moves the mouse pointer outside the boundaries of the object.
+ * @param ev The mouse event.
+ */
+ onmouseout: (ev: MouseEvent) => any;
+ /**
+ * Fires when the user moves the mouse pointer into the object.
+ * @param ev The mouse event.
+ */
+ onmouseover: (ev: MouseEvent) => any;
+ /**
+ * Fires when the user releases a mouse button while the mouse is over the object.
+ * @param ev The mouse event.
+ */
+ onmouseup: (ev: MouseEvent) => any;
+ /**
+ * Fires when the wheel button is rotated.
+ * @param ev The mouse event
+ */
+ onmousewheel: (ev: MouseWheelEvent) => any;
+ onmscontentzoom: (ev: UIEvent) => any;
+ onmsgesturechange: (ev: MSGestureEvent) => any;
+ onmsgesturedoubletap: (ev: MSGestureEvent) => any;
+ onmsgestureend: (ev: MSGestureEvent) => any;
+ onmsgesturehold: (ev: MSGestureEvent) => any;
+ onmsgesturestart: (ev: MSGestureEvent) => any;
+ onmsgesturetap: (ev: MSGestureEvent) => any;
+ onmsinertiastart: (ev: MSGestureEvent) => any;
+ onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any;
+ onmspointercancel: (ev: MSPointerEvent) => any;
+ onmspointerdown: (ev: MSPointerEvent) => any;
+ onmspointerenter: (ev: MSPointerEvent) => any;
+ onmspointerleave: (ev: MSPointerEvent) => any;
+ onmspointermove: (ev: MSPointerEvent) => any;
+ onmspointerout: (ev: MSPointerEvent) => any;
+ onmspointerover: (ev: MSPointerEvent) => any;
+ onmspointerup: (ev: MSPointerEvent) => any;
+ /**
+ * Occurs when an item is removed from a Jump List of a webpage running in Site Mode.
+ * @param ev The event.
+ */
+ onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any;
+ /**
+ * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode.
+ * @param ev The event.
+ */
+ onmsthumbnailclick: (ev: MSSiteModeEvent) => any;
+ /**
+ * Occurs when playback is paused.
+ * @param ev The event.
+ */
+ onpause: (ev: Event) => any;
+ /**
+ * Occurs when the play method is requested.
+ * @param ev The event.
+ */
+ onplay: (ev: Event) => any;
+ /**
+ * Occurs when the audio or video has started playing.
+ * @param ev The event.
+ */
+ onplaying: (ev: Event) => any;
+ onpointerlockchange: (ev: Event) => any;
+ onpointerlockerror: (ev: Event) => any;
+ /**
+ * Occurs to indicate progress while downloading media data.
+ * @param ev The event.
+ */
+ onprogress: (ev: ProgressEvent) => any;
+ /**
+ * Occurs when the playback rate is increased or decreased.
+ * @param ev The event.
+ */
+ onratechange: (ev: Event) => any;
+ /**
+ * Fires when the state of the object has changed.
+ * @param ev The event
+ */
+ onreadystatechange: (ev: ProgressEvent) => any;
+ /**
+ * Fires when the user resets a form.
+ * @param ev The event.
+ */
+ onreset: (ev: Event) => any;
+ /**
+ * Fires when the user repositions the scroll box in the scroll bar on the object.
+ * @param ev The event.
+ */
+ onscroll: (ev: UIEvent) => any;
+ /**
+ * Occurs when the seek operation ends.
+ * @param ev The event.
+ */
+ onseeked: (ev: Event) => any;
+ /**
+ * Occurs when the current playback position is moved.
+ * @param ev The event.
+ */
+ onseeking: (ev: Event) => any;
+ /**
+ * Fires when the current selection changes.
+ * @param ev The event.
+ */
+ onselect: (ev: UIEvent) => any;
+ onselectstart: (ev: Event) => any;
+ /**
+ * Occurs when the download has stopped.
+ * @param ev The event.
+ */
+ onstalled: (ev: Event) => any;
+ /**
+ * Fires when the user clicks the Stop button or leaves the Web page.
+ * @param ev The event.
+ */
+ onstop: (ev: Event) => any;
+ onsubmit: (ev: Event) => any;
+ /**
+ * Occurs if the load operation has been intentionally halted.
+ * @param ev The event.
+ */
+ onsuspend: (ev: Event) => any;
+ /**
+ * Occurs to indicate the current playback position.
+ * @param ev The event.
+ */
+ ontimeupdate: (ev: Event) => any;
+ ontouchcancel: (ev: TouchEvent) => any;
+ ontouchend: (ev: TouchEvent) => any;
+ ontouchmove: (ev: TouchEvent) => any;
+ ontouchstart: (ev: TouchEvent) => any;
+ /**
+ * Occurs when the volume is changed, or playback is muted or unmuted.
+ * @param ev The event.
+ */
+ onvolumechange: (ev: Event) => any;
+ /**
+ * Occurs when playback stops because the next frame of a video resource is not available.
+ * @param ev The event.
+ */
+ onwaiting: (ev: Event) => any;
+ onwebkitfullscreenchange: (ev: Event) => any;
+ onwebkitfullscreenerror: (ev: Event) => any;
+ plugins: HTMLCollection;
+ pointerLockElement: Element;
+ /**
+ * Retrieves a value that indicates the current state of the object.
+ */
+ readyState: string;
+ /**
+ * Gets the URL of the location that referred the user to the current page.
+ */
+ referrer: string;
+ /**
+ * Gets the root svg element in the document hierarchy.
+ */
+ rootElement: SVGSVGElement;
+ /**
+ * Retrieves a collection of all script objects in the document.
+ */
+ scripts: HTMLCollection;
+ security: string;
+ /**
+ * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.
+ */
+ styleSheets: StyleSheetList;
+ /**
+ * Contains the title of the document.
+ */
+ title: string;
+ visibilityState: string;
+ /**
+ * Sets or gets the color of the links that the user has visited.
+ */
+ vlinkColor: string;
+ webkitCurrentFullScreenElement: Element;
+ webkitFullscreenElement: Element;
+ webkitFullscreenEnabled: boolean;
+ webkitIsFullScreen: boolean;
+ xmlEncoding: string;
+ xmlStandalone: boolean;
+ /**
+ * Gets or sets the version attribute specified in the declaration of an XML document.
+ */
+ xmlVersion: string;
+ currentScript: HTMLScriptElement;
+ adoptNode(source: Node): Node;
+ captureEvents(): void;
+ clear(): void;
+ /**
+ * Closes an output stream and forces the sent data to display.
+ */
+ close(): void;
+ /**
+ * Creates an attribute object with a specified name.
+ * @param name String that sets the attribute object's name.
+ */
+ createAttribute(name: string): Attr;
+ createAttributeNS(namespaceURI: string, qualifiedName: string): Attr;
+ createCDATASection(data: string): CDATASection;
+ /**
+ * Creates a comment object with the specified data.
+ * @param data Sets the comment object's data.
+ */
+ createComment(data: string): Comment;
+ /**
+ * Creates a new document.
+ */
+ createDocumentFragment(): DocumentFragment;
+ /**
+ * Creates an instance of the element for the specified tag.
+ * @param tagName The name of an element.
+ */
+ createElement(tagName: "a"): HTMLAnchorElement;
+ createElement(tagName: "abbr"): HTMLPhraseElement;
+ createElement(tagName: "acronym"): HTMLPhraseElement;
+ createElement(tagName: "address"): HTMLBlockElement;
+ createElement(tagName: "applet"): HTMLAppletElement;
+ createElement(tagName: "area"): HTMLAreaElement;
+ createElement(tagName: "audio"): HTMLAudioElement;
+ createElement(tagName: "b"): HTMLPhraseElement;
+ createElement(tagName: "base"): HTMLBaseElement;
+ createElement(tagName: "basefont"): HTMLBaseFontElement;
+ createElement(tagName: "bdo"): HTMLPhraseElement;
+ createElement(tagName: "big"): HTMLPhraseElement;
+ createElement(tagName: "blockquote"): HTMLBlockElement;
+ createElement(tagName: "body"): HTMLBodyElement;
+ createElement(tagName: "br"): HTMLBRElement;
+ createElement(tagName: "button"): HTMLButtonElement;
+ createElement(tagName: "canvas"): HTMLCanvasElement;
+ createElement(tagName: "caption"): HTMLTableCaptionElement;
+ createElement(tagName: "center"): HTMLBlockElement;
+ createElement(tagName: "cite"): HTMLPhraseElement;
+ createElement(tagName: "code"): HTMLPhraseElement;
+ createElement(tagName: "col"): HTMLTableColElement;
+ createElement(tagName: "colgroup"): HTMLTableColElement;
+ createElement(tagName: "datalist"): HTMLDataListElement;
+ createElement(tagName: "dd"): HTMLDDElement;
+ createElement(tagName: "del"): HTMLModElement;
+ createElement(tagName: "dfn"): HTMLPhraseElement;
+ createElement(tagName: "dir"): HTMLDirectoryElement;
+ createElement(tagName: "div"): HTMLDivElement;
+ createElement(tagName: "dl"): HTMLDListElement;
+ createElement(tagName: "dt"): HTMLDTElement;
+ createElement(tagName: "em"): HTMLPhraseElement;
+ createElement(tagName: "embed"): HTMLEmbedElement;
+ createElement(tagName: "fieldset"): HTMLFieldSetElement;
+ createElement(tagName: "font"): HTMLFontElement;
+ createElement(tagName: "form"): HTMLFormElement;
+ createElement(tagName: "frame"): HTMLFrameElement;
+ createElement(tagName: "frameset"): HTMLFrameSetElement;
+ createElement(tagName: "h1"): HTMLHeadingElement;
+ createElement(tagName: "h2"): HTMLHeadingElement;
+ createElement(tagName: "h3"): HTMLHeadingElement;
+ createElement(tagName: "h4"): HTMLHeadingElement;
+ createElement(tagName: "h5"): HTMLHeadingElement;
+ createElement(tagName: "h6"): HTMLHeadingElement;
+ createElement(tagName: "head"): HTMLHeadElement;
+ createElement(tagName: "hr"): HTMLHRElement;
+ createElement(tagName: "html"): HTMLHtmlElement;
+ createElement(tagName: "i"): HTMLPhraseElement;
+ createElement(tagName: "iframe"): HTMLIFrameElement;
+ createElement(tagName: "img"): HTMLImageElement;
+ createElement(tagName: "input"): HTMLInputElement;
+ createElement(tagName: "ins"): HTMLModElement;
+ createElement(tagName: "isindex"): HTMLIsIndexElement;
+ createElement(tagName: "kbd"): HTMLPhraseElement;
+ createElement(tagName: "keygen"): HTMLBlockElement;
+ createElement(tagName: "label"): HTMLLabelElement;
+ createElement(tagName: "legend"): HTMLLegendElement;
+ createElement(tagName: "li"): HTMLLIElement;
+ createElement(tagName: "link"): HTMLLinkElement;
+ createElement(tagName: "listing"): HTMLBlockElement;
+ createElement(tagName: "map"): HTMLMapElement;
+ createElement(tagName: "marquee"): HTMLMarqueeElement;
+ createElement(tagName: "menu"): HTMLMenuElement;
+ createElement(tagName: "meta"): HTMLMetaElement;
+ createElement(tagName: "nextid"): HTMLNextIdElement;
+ createElement(tagName: "nobr"): HTMLPhraseElement;
+ createElement(tagName: "object"): HTMLObjectElement;
+ createElement(tagName: "ol"): HTMLOListElement;
+ createElement(tagName: "optgroup"): HTMLOptGroupElement;
+ createElement(tagName: "option"): HTMLOptionElement;
+ createElement(tagName: "p"): HTMLParagraphElement;
+ createElement(tagName: "param"): HTMLParamElement;
+ createElement(tagName: "plaintext"): HTMLBlockElement;
+ createElement(tagName: "pre"): HTMLPreElement;
+ createElement(tagName: "progress"): HTMLProgressElement;
+ createElement(tagName: "q"): HTMLQuoteElement;
+ createElement(tagName: "rt"): HTMLPhraseElement;
+ createElement(tagName: "ruby"): HTMLPhraseElement;
+ createElement(tagName: "s"): HTMLPhraseElement;
+ createElement(tagName: "samp"): HTMLPhraseElement;
+ createElement(tagName: "script"): HTMLScriptElement;
+ createElement(tagName: "select"): HTMLSelectElement;
+ createElement(tagName: "small"): HTMLPhraseElement;
+ createElement(tagName: "source"): HTMLSourceElement;
+ createElement(tagName: "span"): HTMLSpanElement;
+ createElement(tagName: "strike"): HTMLPhraseElement;
+ createElement(tagName: "strong"): HTMLPhraseElement;
+ createElement(tagName: "style"): HTMLStyleElement;
+ createElement(tagName: "sub"): HTMLPhraseElement;
+ createElement(tagName: "sup"): HTMLPhraseElement;
+ createElement(tagName: "table"): HTMLTableElement;
+ createElement(tagName: "tbody"): HTMLTableSectionElement;
+ createElement(tagName: "td"): HTMLTableDataCellElement;
+ createElement(tagName: "textarea"): HTMLTextAreaElement;
+ createElement(tagName: "tfoot"): HTMLTableSectionElement;
+ createElement(tagName: "th"): HTMLTableHeaderCellElement;
+ createElement(tagName: "thead"): HTMLTableSectionElement;
+ createElement(tagName: "title"): HTMLTitleElement;
+ createElement(tagName: "tr"): HTMLTableRowElement;
+ createElement(tagName: "track"): HTMLTrackElement;
+ createElement(tagName: "tt"): HTMLPhraseElement;
+ createElement(tagName: "u"): HTMLPhraseElement;
+ createElement(tagName: "ul"): HTMLUListElement;
+ createElement(tagName: "var"): HTMLPhraseElement;
+ createElement(tagName: "video"): HTMLVideoElement;
+ createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement;
+ createElement(tagName: "xmp"): HTMLBlockElement;
+ createElement(tagName: string): HTMLElement;
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "clipPath"): SVGClipPathElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "componentTransferFunction"): SVGComponentTransferFunctionElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "defs"): SVGDefsElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "desc"): SVGDescElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "ellipse"): SVGEllipseElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feBlend"): SVGFEBlendElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feColorMatrix"): SVGFEColorMatrixElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComponentTransfer"): SVGFEComponentTransferElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feComposite"): SVGFECompositeElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feConvolveMatrix"): SVGFEConvolveMatrixElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDiffuseLighting"): SVGFEDiffuseLightingElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDisplacementMap"): SVGFEDisplacementMapElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feDistantLight"): SVGFEDistantLightElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFlood"): SVGFEFloodElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncA"): SVGFEFuncAElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncB"): SVGFEFuncBElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncG"): SVGFEFuncGElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feFuncR"): SVGFEFuncRElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feGaussianBlur"): SVGFEGaussianBlurElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feImage"): SVGFEImageElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMerge"): SVGFEMergeElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMergeNode"): SVGFEMergeNodeElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feMorphology"): SVGFEMorphologyElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feOffset"): SVGFEOffsetElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "fePointLight"): SVGFEPointLightElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpecularLighting"): SVGFESpecularLightingElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feSpotLight"): SVGFESpotLightElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTile"): SVGFETileElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "feTurbulence"): SVGFETurbulenceElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "filter"): SVGFilterElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "foreignObject"): SVGForeignObjectElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "g"): SVGGElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "image"): SVGImageElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "gradient"): SVGGradientElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "line"): SVGLineElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "linearGradient"): SVGLinearGradientElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "marker"): SVGMarkerElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "mask"): SVGMaskElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "path"): SVGPathElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "metadata"): SVGMetadataElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "pattern"): SVGPatternElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polygon"): SVGPolygonElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "polyline"): SVGPolylineElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "radialGradient"): SVGRadialGradientElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "rect"): SVGRectElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "svg"): SVGSVGElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "script"): SVGScriptElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "stop"): SVGStopElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "style"): SVGStyleElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "switch"): SVGSwitchElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "symbol"): SVGSymbolElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "tspan"): SVGTSpanElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textContent"): SVGTextContentElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "text"): SVGTextElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPath"): SVGTextPathElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "textPositioning"): SVGTextPositioningElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "title"): SVGTitleElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "use"): SVGUseElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "view"): SVGViewElement
+ createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement
+ createElementNS(namespaceURI: string, qualifiedName: string): Element;
+ createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;
+ createNSResolver(nodeResolver: Node): XPathNSResolver;
+ /**
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
+ * @param root The root element or node to start traversing on.
+ * @param whatToShow The type of nodes or elements to appear in the node list
+ * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.
+ * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.
+ */
+ createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator;
+ createProcessingInstruction(target: string, data: string): ProcessingInstruction;
+ /**
+ * Returns an empty range object that has both of its boundary points positioned at the beginning of the document.
+ */
+ createRange(): Range;
+ /**
+ * Creates a text string from the specified value.
+ * @param data String that specifies the nodeValue property of the text node.
+ */
+ createTextNode(data: string): Text;
+ createTouch(view: any, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch;
+ createTouchList(...touches: Touch[]): TouchList;
+ /**
+ * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.
+ * @param root The root element or node to start traversing on.
+ * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow.
+ * @param filter A custom NodeFilter function to use.
+ * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.
+ */
+ createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker;
+ /**
+ * Returns the element for the specified x coordinate and the specified y coordinate.
+ * @param x The x-offset
+ * @param y The y-offset
+ */
+ elementFromPoint(x: number, y: number): Element;
+ evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult;
+ /**
+ * Executes a command on the current document, current selection, or the given range.
+ * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
+ * @param showUI Display the user interface, defaults to false.
+ * @param value Value to assign.
+ */
+ execCommand(commandId: string, showUI?: boolean, value?: any): boolean;
+ /**
+ * Displays help information for the given command identifier.
+ * @param commandId Displays help information for the given command identifier.
+ */
+ execCommandShowHelp(commandId: string): boolean;
+ exitFullscreen(): void;
+ exitPointerLock(): void;
+ /**
+ * Causes the element to receive the focus and executes the code specified by the onfocus event.
+ */
+ focus(): void;
+ /**
+ * Returns a reference to the first object with the specified value of the ID or NAME attribute.
+ * @param elementId String that specifies the ID value. Case-insensitive.
+ */
+ getElementById(elementId: string): HTMLElement;
+ getElementsByClassName(classNames: string): NodeListOf<Element>;
+ /**
+ * Gets a collection of objects based on the value of the NAME or ID attribute.
+ * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.
+ */
+ getElementsByName(elementName: string): NodeListOf<Element>;
+ /**
+ * Retrieves a collection of objects based on the specified element name.
+ * @param name Specifies the name of an element.
+ */
+ getElementsByTagName(tagname: "a"): NodeListOf<HTMLAnchorElement>;
+ getElementsByTagName(tagname: "abbr"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "acronym"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "address"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(tagname: "applet"): NodeListOf<HTMLAppletElement>;
+ getElementsByTagName(tagname: "area"): NodeListOf<HTMLAreaElement>;
+ getElementsByTagName(tagname: "article"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "aside"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "audio"): NodeListOf<HTMLAudioElement>;
+ getElementsByTagName(tagname: "b"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "base"): NodeListOf<HTMLBaseElement>;
+ getElementsByTagName(tagname: "basefont"): NodeListOf<HTMLBaseFontElement>;
+ getElementsByTagName(tagname: "bdo"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "big"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "blockquote"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(tagname: "body"): NodeListOf<HTMLBodyElement>;
+ getElementsByTagName(tagname: "br"): NodeListOf<HTMLBRElement>;
+ getElementsByTagName(tagname: "button"): NodeListOf<HTMLButtonElement>;
+ getElementsByTagName(tagname: "canvas"): NodeListOf<HTMLCanvasElement>;
+ getElementsByTagName(tagname: "caption"): NodeListOf<HTMLTableCaptionElement>;
+ getElementsByTagName(tagname: "center"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(tagname: "circle"): NodeListOf<SVGCircleElement>;
+ getElementsByTagName(tagname: "cite"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "clippath"): NodeListOf<SVGClipPathElement>;
+ getElementsByTagName(tagname: "code"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "col"): NodeListOf<HTMLTableColElement>;
+ getElementsByTagName(tagname: "colgroup"): NodeListOf<HTMLTableColElement>;
+ getElementsByTagName(tagname: "datalist"): NodeListOf<HTMLDataListElement>;
+ getElementsByTagName(tagname: "dd"): NodeListOf<HTMLDDElement>;
+ getElementsByTagName(tagname: "defs"): NodeListOf<SVGDefsElement>;
+ getElementsByTagName(tagname: "del"): NodeListOf<HTMLModElement>;
+ getElementsByTagName(tagname: "desc"): NodeListOf<SVGDescElement>;
+ getElementsByTagName(tagname: "dfn"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "dir"): NodeListOf<HTMLDirectoryElement>;
+ getElementsByTagName(tagname: "div"): NodeListOf<HTMLDivElement>;
+ getElementsByTagName(tagname: "dl"): NodeListOf<HTMLDListElement>;
+ getElementsByTagName(tagname: "dt"): NodeListOf<HTMLDTElement>;
+ getElementsByTagName(tagname: "ellipse"): NodeListOf<SVGEllipseElement>;
+ getElementsByTagName(tagname: "em"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "embed"): NodeListOf<HTMLEmbedElement>;
+ getElementsByTagName(tagname: "feblend"): NodeListOf<SVGFEBlendElement>;
+ getElementsByTagName(tagname: "fecolormatrix"): NodeListOf<SVGFEColorMatrixElement>;
+ getElementsByTagName(tagname: "fecomponenttransfer"): NodeListOf<SVGFEComponentTransferElement>;
+ getElementsByTagName(tagname: "fecomposite"): NodeListOf<SVGFECompositeElement>;
+ getElementsByTagName(tagname: "feconvolvematrix"): NodeListOf<SVGFEConvolveMatrixElement>;
+ getElementsByTagName(tagname: "fediffuselighting"): NodeListOf<SVGFEDiffuseLightingElement>;
+ getElementsByTagName(tagname: "fedisplacementmap"): NodeListOf<SVGFEDisplacementMapElement>;
+ getElementsByTagName(tagname: "fedistantlight"): NodeListOf<SVGFEDistantLightElement>;
+ getElementsByTagName(tagname: "feflood"): NodeListOf<SVGFEFloodElement>;
+ getElementsByTagName(tagname: "fefunca"): NodeListOf<SVGFEFuncAElement>;
+ getElementsByTagName(tagname: "fefuncb"): NodeListOf<SVGFEFuncBElement>;
+ getElementsByTagName(tagname: "fefuncg"): NodeListOf<SVGFEFuncGElement>;
+ getElementsByTagName(tagname: "fefuncr"): NodeListOf<SVGFEFuncRElement>;
+ getElementsByTagName(tagname: "fegaussianblur"): NodeListOf<SVGFEGaussianBlurElement>;
+ getElementsByTagName(tagname: "feimage"): NodeListOf<SVGFEImageElement>;
+ getElementsByTagName(tagname: "femerge"): NodeListOf<SVGFEMergeElement>;
+ getElementsByTagName(tagname: "femergenode"): NodeListOf<SVGFEMergeNodeElement>;
+ getElementsByTagName(tagname: "femorphology"): NodeListOf<SVGFEMorphologyElement>;
+ getElementsByTagName(tagname: "feoffset"): NodeListOf<SVGFEOffsetElement>;
+ getElementsByTagName(tagname: "fepointlight"): NodeListOf<SVGFEPointLightElement>;
+ getElementsByTagName(tagname: "fespecularlighting"): NodeListOf<SVGFESpecularLightingElement>;
+ getElementsByTagName(tagname: "fespotlight"): NodeListOf<SVGFESpotLightElement>;
+ getElementsByTagName(tagname: "fetile"): NodeListOf<SVGFETileElement>;
+ getElementsByTagName(tagname: "feturbulence"): NodeListOf<SVGFETurbulenceElement>;
+ getElementsByTagName(tagname: "fieldset"): NodeListOf<HTMLFieldSetElement>;
+ getElementsByTagName(tagname: "figcaption"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "figure"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "filter"): NodeListOf<SVGFilterElement>;
+ getElementsByTagName(tagname: "font"): NodeListOf<HTMLFontElement>;
+ getElementsByTagName(tagname: "footer"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "foreignobject"): NodeListOf<SVGForeignObjectElement>;
+ getElementsByTagName(tagname: "form"): NodeListOf<HTMLFormElement>;
+ getElementsByTagName(tagname: "frame"): NodeListOf<HTMLFrameElement>;
+ getElementsByTagName(tagname: "frameset"): NodeListOf<HTMLFrameSetElement>;
+ getElementsByTagName(tagname: "g"): NodeListOf<SVGGElement>;
+ getElementsByTagName(tagname: "h1"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(tagname: "h2"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(tagname: "h3"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(tagname: "h4"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(tagname: "h5"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(tagname: "h6"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(tagname: "head"): NodeListOf<HTMLHeadElement>;
+ getElementsByTagName(tagname: "header"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "hgroup"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "hr"): NodeListOf<HTMLHRElement>;
+ getElementsByTagName(tagname: "html"): NodeListOf<HTMLHtmlElement>;
+ getElementsByTagName(tagname: "i"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "iframe"): NodeListOf<HTMLIFrameElement>;
+ getElementsByTagName(tagname: "image"): NodeListOf<SVGImageElement>;
+ getElementsByTagName(tagname: "img"): NodeListOf<HTMLImageElement>;
+ getElementsByTagName(tagname: "input"): NodeListOf<HTMLInputElement>;
+ getElementsByTagName(tagname: "ins"): NodeListOf<HTMLModElement>;
+ getElementsByTagName(tagname: "isindex"): NodeListOf<HTMLIsIndexElement>;
+ getElementsByTagName(tagname: "kbd"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "keygen"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(tagname: "label"): NodeListOf<HTMLLabelElement>;
+ getElementsByTagName(tagname: "legend"): NodeListOf<HTMLLegendElement>;
+ getElementsByTagName(tagname: "li"): NodeListOf<HTMLLIElement>;
+ getElementsByTagName(tagname: "line"): NodeListOf<SVGLineElement>;
+ getElementsByTagName(tagname: "lineargradient"): NodeListOf<SVGLinearGradientElement>;
+ getElementsByTagName(tagname: "link"): NodeListOf<HTMLLinkElement>;
+ getElementsByTagName(tagname: "listing"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(tagname: "map"): NodeListOf<HTMLMapElement>;
+ getElementsByTagName(tagname: "mark"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "marker"): NodeListOf<SVGMarkerElement>;
+ getElementsByTagName(tagname: "marquee"): NodeListOf<HTMLMarqueeElement>;
+ getElementsByTagName(tagname: "mask"): NodeListOf<SVGMaskElement>;
+ getElementsByTagName(tagname: "menu"): NodeListOf<HTMLMenuElement>;
+ getElementsByTagName(tagname: "meta"): NodeListOf<HTMLMetaElement>;
+ getElementsByTagName(tagname: "metadata"): NodeListOf<SVGMetadataElement>;
+ getElementsByTagName(tagname: "nav"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "nextid"): NodeListOf<HTMLNextIdElement>;
+ getElementsByTagName(tagname: "nobr"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "noframes"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "noscript"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "object"): NodeListOf<HTMLObjectElement>;
+ getElementsByTagName(tagname: "ol"): NodeListOf<HTMLOListElement>;
+ getElementsByTagName(tagname: "optgroup"): NodeListOf<HTMLOptGroupElement>;
+ getElementsByTagName(tagname: "option"): NodeListOf<HTMLOptionElement>;
+ getElementsByTagName(tagname: "p"): NodeListOf<HTMLParagraphElement>;
+ getElementsByTagName(tagname: "param"): NodeListOf<HTMLParamElement>;
+ getElementsByTagName(tagname: "path"): NodeListOf<SVGPathElement>;
+ getElementsByTagName(tagname: "pattern"): NodeListOf<SVGPatternElement>;
+ getElementsByTagName(tagname: "plaintext"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(tagname: "polygon"): NodeListOf<SVGPolygonElement>;
+ getElementsByTagName(tagname: "polyline"): NodeListOf<SVGPolylineElement>;
+ getElementsByTagName(tagname: "pre"): NodeListOf<HTMLPreElement>;
+ getElementsByTagName(tagname: "progress"): NodeListOf<HTMLProgressElement>;
+ getElementsByTagName(tagname: "q"): NodeListOf<HTMLQuoteElement>;
+ getElementsByTagName(tagname: "radialgradient"): NodeListOf<SVGRadialGradientElement>;
+ getElementsByTagName(tagname: "rect"): NodeListOf<SVGRectElement>;
+ getElementsByTagName(tagname: "rt"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "ruby"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "s"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "samp"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "script"): NodeListOf<HTMLScriptElement>;
+ getElementsByTagName(tagname: "section"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "select"): NodeListOf<HTMLSelectElement>;
+ getElementsByTagName(tagname: "small"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "source"): NodeListOf<HTMLSourceElement>;
+ getElementsByTagName(tagname: "span"): NodeListOf<HTMLSpanElement>;
+ getElementsByTagName(tagname: "stop"): NodeListOf<SVGStopElement>;
+ getElementsByTagName(tagname: "strike"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "strong"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "style"): NodeListOf<HTMLStyleElement>;
+ getElementsByTagName(tagname: "sub"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "sup"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "svg"): NodeListOf<SVGSVGElement>;
+ getElementsByTagName(tagname: "switch"): NodeListOf<SVGSwitchElement>;
+ getElementsByTagName(tagname: "symbol"): NodeListOf<SVGSymbolElement>;
+ getElementsByTagName(tagname: "table"): NodeListOf<HTMLTableElement>;
+ getElementsByTagName(tagname: "tbody"): NodeListOf<HTMLTableSectionElement>;
+ getElementsByTagName(tagname: "td"): NodeListOf<HTMLTableDataCellElement>;
+ getElementsByTagName(tagname: "text"): NodeListOf<SVGTextElement>;
+ getElementsByTagName(tagname: "textpath"): NodeListOf<SVGTextPathElement>;
+ getElementsByTagName(tagname: "textarea"): NodeListOf<HTMLTextAreaElement>;
+ getElementsByTagName(tagname: "tfoot"): NodeListOf<HTMLTableSectionElement>;
+ getElementsByTagName(tagname: "th"): NodeListOf<HTMLTableHeaderCellElement>;
+ getElementsByTagName(tagname: "thead"): NodeListOf<HTMLTableSectionElement>;
+ getElementsByTagName(tagname: "title"): NodeListOf<HTMLTitleElement>;
+ getElementsByTagName(tagname: "tr"): NodeListOf<HTMLTableRowElement>;
+ getElementsByTagName(tagname: "track"): NodeListOf<HTMLTrackElement>;
+ getElementsByTagName(tagname: "tspan"): NodeListOf<SVGTSpanElement>;
+ getElementsByTagName(tagname: "tt"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "u"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "ul"): NodeListOf<HTMLUListElement>;
+ getElementsByTagName(tagname: "use"): NodeListOf<SVGUseElement>;
+ getElementsByTagName(tagname: "var"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(tagname: "video"): NodeListOf<HTMLVideoElement>;
+ getElementsByTagName(tagname: "view"): NodeListOf<SVGViewElement>;
+ getElementsByTagName(tagname: "wbr"): NodeListOf<HTMLElement>;
+ getElementsByTagName(tagname: "x-ms-webview"): NodeListOf<MSHTMLWebViewElement>;
+ getElementsByTagName(tagname: "xmp"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(tagname: string): NodeListOf<Element>;
+ getElementsByTagNameNS(namespaceURI: string, localName: string): NodeListOf<Element>;
+ /**
+ * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.
+ */
+ getSelection(): Selection;
+ /**
+ * Gets a value indicating whether the object currently has focus.
+ */
+ hasFocus(): boolean;
+ importNode(importedNode: Node, deep: boolean): Node;
+ msElementsFromPoint(x: number, y: number): NodeList;
+ msElementsFromRect(left: number, top: number, width: number, height: number): NodeList;
+ /**
+ * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.
+ * @param url Specifies a MIME type for the document.
+ * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.
+ * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported.
+ * @param replace Specifies whether the existing entry for the document is replaced in the history list.
+ */
+ open(url?: string, name?: string, features?: string, replace?: boolean): Document;
+ /**
+ * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.
+ * @param commandId Specifies a command identifier.
+ */
+ queryCommandEnabled(commandId: string): boolean;
+ /**
+ * Returns a Boolean value that indicates whether the specified command is in the indeterminate state.
+ * @param commandId String that specifies a command identifier.
+ */
+ queryCommandIndeterm(commandId: string): boolean;
+ /**
+ * Returns a Boolean value that indicates the current state of the command.
+ * @param commandId String that specifies a command identifier.
+ */
+ queryCommandState(commandId: string): boolean;
+ /**
+ * Returns a Boolean value that indicates whether the current command is supported on the current range.
+ * @param commandId Specifies a command identifier.
+ */
+ queryCommandSupported(commandId: string): boolean;
+ /**
+ * Retrieves the string associated with a command.
+ * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers.
+ */
+ queryCommandText(commandId: string): string;
+ /**
+ * Returns the current value of the document, range, or current selection for the given command.
+ * @param commandId String that specifies a command identifier.
+ */
+ queryCommandValue(commandId: string): string;
+ releaseEvents(): void;
+ /**
+ * Allows updating the print settings for the page.
+ */
+ updateSettings(): void;
+ webkitCancelFullScreen(): void;
+ webkitExitFullscreen(): void;
+ /**
+ * Writes one or more HTML expressions to a document in the specified window.
+ * @param content Specifies the text and HTML tags to write.
+ */
+ write(...content: string[]): void;
+ /**
+ * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.
+ * @param content The text and HTML tags to write.
+ */
+ writeln(...content: string[]): void;
+ addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "fullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "fullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerlockchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerlockerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var Document: {
+ prototype: Document;
+ new(): Document;
+}
+
+interface DocumentFragment extends Node, NodeSelector {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var DocumentFragment: {
+ prototype: DocumentFragment;
+ new(): DocumentFragment;
+}
+
+interface DocumentType extends Node, ChildNode {
+ entities: NamedNodeMap;
+ internalSubset: string;
+ name: string;
+ notations: NamedNodeMap;
+ publicId: string;
+ systemId: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var DocumentType: {
+ prototype: DocumentType;
+ new(): DocumentType;
+}
+
+interface DragEvent extends MouseEvent {
+ dataTransfer: DataTransfer;
+ initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void;
+ msConvertURL(file: File, targetType: string, targetURL?: string): void;
+}
+
+declare var DragEvent: {
+ prototype: DragEvent;
+ new(): DragEvent;
+}
+
+interface DynamicsCompressorNode extends AudioNode {
+ attack: AudioParam;
+ knee: AudioParam;
+ ratio: AudioParam;
+ reduction: AudioParam;
+ release: AudioParam;
+ threshold: AudioParam;
+}
+
+declare var DynamicsCompressorNode: {
+ prototype: DynamicsCompressorNode;
+ new(): DynamicsCompressorNode;
+}
+
+interface EXT_texture_filter_anisotropic {
+ MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;
+ TEXTURE_MAX_ANISOTROPY_EXT: number;
+}
+
+declare var EXT_texture_filter_anisotropic: {
+ prototype: EXT_texture_filter_anisotropic;
+ new(): EXT_texture_filter_anisotropic;
+ MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;
+ TEXTURE_MAX_ANISOTROPY_EXT: number;
+}
+
+interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode {
+ classList: DOMTokenList;
+ clientHeight: number;
+ clientLeft: number;
+ clientTop: number;
+ clientWidth: number;
+ msContentZoomFactor: number;
+ msRegionOverflow: string;
+ onariarequest: (ev: AriaRequestEvent) => any;
+ oncommand: (ev: CommandEvent) => any;
+ ongotpointercapture: (ev: PointerEvent) => any;
+ onlostpointercapture: (ev: PointerEvent) => any;
+ onmsgesturechange: (ev: MSGestureEvent) => any;
+ onmsgesturedoubletap: (ev: MSGestureEvent) => any;
+ onmsgestureend: (ev: MSGestureEvent) => any;
+ onmsgesturehold: (ev: MSGestureEvent) => any;
+ onmsgesturestart: (ev: MSGestureEvent) => any;
+ onmsgesturetap: (ev: MSGestureEvent) => any;
+ onmsgotpointercapture: (ev: MSPointerEvent) => any;
+ onmsinertiastart: (ev: MSGestureEvent) => any;
+ onmslostpointercapture: (ev: MSPointerEvent) => any;
+ onmspointercancel: (ev: MSPointerEvent) => any;
+ onmspointerdown: (ev: MSPointerEvent) => any;
+ onmspointerenter: (ev: MSPointerEvent) => any;
+ onmspointerleave: (ev: MSPointerEvent) => any;
+ onmspointermove: (ev: MSPointerEvent) => any;
+ onmspointerout: (ev: MSPointerEvent) => any;
+ onmspointerover: (ev: MSPointerEvent) => any;
+ onmspointerup: (ev: MSPointerEvent) => any;
+ ontouchcancel: (ev: TouchEvent) => any;
+ ontouchend: (ev: TouchEvent) => any;
+ ontouchmove: (ev: TouchEvent) => any;
+ ontouchstart: (ev: TouchEvent) => any;
+ onwebkitfullscreenchange: (ev: Event) => any;
+ onwebkitfullscreenerror: (ev: Event) => any;
+ scrollHeight: number;
+ scrollLeft: number;
+ scrollTop: number;
+ scrollWidth: number;
+ tagName: string;
+ id: string;
+ className: string;
+ innerHTML: string;
+ getAttribute(name?: string): string;
+ getAttributeNS(namespaceURI: string, localName: string): string;
+ getAttributeNode(name: string): Attr;
+ getAttributeNodeNS(namespaceURI: string, localName: string): Attr;
+ getBoundingClientRect(): ClientRect;
+ getClientRects(): ClientRectList;
+ getElementsByTagName(name: "a"): NodeListOf<HTMLAnchorElement>;
+ getElementsByTagName(name: "abbr"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "acronym"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "address"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(name: "applet"): NodeListOf<HTMLAppletElement>;
+ getElementsByTagName(name: "area"): NodeListOf<HTMLAreaElement>;
+ getElementsByTagName(name: "article"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "aside"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "audio"): NodeListOf<HTMLAudioElement>;
+ getElementsByTagName(name: "b"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "base"): NodeListOf<HTMLBaseElement>;
+ getElementsByTagName(name: "basefont"): NodeListOf<HTMLBaseFontElement>;
+ getElementsByTagName(name: "bdo"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "big"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "blockquote"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(name: "body"): NodeListOf<HTMLBodyElement>;
+ getElementsByTagName(name: "br"): NodeListOf<HTMLBRElement>;
+ getElementsByTagName(name: "button"): NodeListOf<HTMLButtonElement>;
+ getElementsByTagName(name: "canvas"): NodeListOf<HTMLCanvasElement>;
+ getElementsByTagName(name: "caption"): NodeListOf<HTMLTableCaptionElement>;
+ getElementsByTagName(name: "center"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(name: "circle"): NodeListOf<SVGCircleElement>;
+ getElementsByTagName(name: "cite"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "clippath"): NodeListOf<SVGClipPathElement>;
+ getElementsByTagName(name: "code"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "col"): NodeListOf<HTMLTableColElement>;
+ getElementsByTagName(name: "colgroup"): NodeListOf<HTMLTableColElement>;
+ getElementsByTagName(name: "datalist"): NodeListOf<HTMLDataListElement>;
+ getElementsByTagName(name: "dd"): NodeListOf<HTMLDDElement>;
+ getElementsByTagName(name: "defs"): NodeListOf<SVGDefsElement>;
+ getElementsByTagName(name: "del"): NodeListOf<HTMLModElement>;
+ getElementsByTagName(name: "desc"): NodeListOf<SVGDescElement>;
+ getElementsByTagName(name: "dfn"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "dir"): NodeListOf<HTMLDirectoryElement>;
+ getElementsByTagName(name: "div"): NodeListOf<HTMLDivElement>;
+ getElementsByTagName(name: "dl"): NodeListOf<HTMLDListElement>;
+ getElementsByTagName(name: "dt"): NodeListOf<HTMLDTElement>;
+ getElementsByTagName(name: "ellipse"): NodeListOf<SVGEllipseElement>;
+ getElementsByTagName(name: "em"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "embed"): NodeListOf<HTMLEmbedElement>;
+ getElementsByTagName(name: "feblend"): NodeListOf<SVGFEBlendElement>;
+ getElementsByTagName(name: "fecolormatrix"): NodeListOf<SVGFEColorMatrixElement>;
+ getElementsByTagName(name: "fecomponenttransfer"): NodeListOf<SVGFEComponentTransferElement>;
+ getElementsByTagName(name: "fecomposite"): NodeListOf<SVGFECompositeElement>;
+ getElementsByTagName(name: "feconvolvematrix"): NodeListOf<SVGFEConvolveMatrixElement>;
+ getElementsByTagName(name: "fediffuselighting"): NodeListOf<SVGFEDiffuseLightingElement>;
+ getElementsByTagName(name: "fedisplacementmap"): NodeListOf<SVGFEDisplacementMapElement>;
+ getElementsByTagName(name: "fedistantlight"): NodeListOf<SVGFEDistantLightElement>;
+ getElementsByTagName(name: "feflood"): NodeListOf<SVGFEFloodElement>;
+ getElementsByTagName(name: "fefunca"): NodeListOf<SVGFEFuncAElement>;
+ getElementsByTagName(name: "fefuncb"): NodeListOf<SVGFEFuncBElement>;
+ getElementsByTagName(name: "fefuncg"): NodeListOf<SVGFEFuncGElement>;
+ getElementsByTagName(name: "fefuncr"): NodeListOf<SVGFEFuncRElement>;
+ getElementsByTagName(name: "fegaussianblur"): NodeListOf<SVGFEGaussianBlurElement>;
+ getElementsByTagName(name: "feimage"): NodeListOf<SVGFEImageElement>;
+ getElementsByTagName(name: "femerge"): NodeListOf<SVGFEMergeElement>;
+ getElementsByTagName(name: "femergenode"): NodeListOf<SVGFEMergeNodeElement>;
+ getElementsByTagName(name: "femorphology"): NodeListOf<SVGFEMorphologyElement>;
+ getElementsByTagName(name: "feoffset"): NodeListOf<SVGFEOffsetElement>;
+ getElementsByTagName(name: "fepointlight"): NodeListOf<SVGFEPointLightElement>;
+ getElementsByTagName(name: "fespecularlighting"): NodeListOf<SVGFESpecularLightingElement>;
+ getElementsByTagName(name: "fespotlight"): NodeListOf<SVGFESpotLightElement>;
+ getElementsByTagName(name: "fetile"): NodeListOf<SVGFETileElement>;
+ getElementsByTagName(name: "feturbulence"): NodeListOf<SVGFETurbulenceElement>;
+ getElementsByTagName(name: "fieldset"): NodeListOf<HTMLFieldSetElement>;
+ getElementsByTagName(name: "figcaption"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "figure"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "filter"): NodeListOf<SVGFilterElement>;
+ getElementsByTagName(name: "font"): NodeListOf<HTMLFontElement>;
+ getElementsByTagName(name: "footer"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "foreignobject"): NodeListOf<SVGForeignObjectElement>;
+ getElementsByTagName(name: "form"): NodeListOf<HTMLFormElement>;
+ getElementsByTagName(name: "frame"): NodeListOf<HTMLFrameElement>;
+ getElementsByTagName(name: "frameset"): NodeListOf<HTMLFrameSetElement>;
+ getElementsByTagName(name: "g"): NodeListOf<SVGGElement>;
+ getElementsByTagName(name: "h1"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(name: "h2"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(name: "h3"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(name: "h4"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(name: "h5"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(name: "h6"): NodeListOf<HTMLHeadingElement>;
+ getElementsByTagName(name: "head"): NodeListOf<HTMLHeadElement>;
+ getElementsByTagName(name: "header"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "hgroup"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "hr"): NodeListOf<HTMLHRElement>;
+ getElementsByTagName(name: "html"): NodeListOf<HTMLHtmlElement>;
+ getElementsByTagName(name: "i"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "iframe"): NodeListOf<HTMLIFrameElement>;
+ getElementsByTagName(name: "image"): NodeListOf<SVGImageElement>;
+ getElementsByTagName(name: "img"): NodeListOf<HTMLImageElement>;
+ getElementsByTagName(name: "input"): NodeListOf<HTMLInputElement>;
+ getElementsByTagName(name: "ins"): NodeListOf<HTMLModElement>;
+ getElementsByTagName(name: "isindex"): NodeListOf<HTMLIsIndexElement>;
+ getElementsByTagName(name: "kbd"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "keygen"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(name: "label"): NodeListOf<HTMLLabelElement>;
+ getElementsByTagName(name: "legend"): NodeListOf<HTMLLegendElement>;
+ getElementsByTagName(name: "li"): NodeListOf<HTMLLIElement>;
+ getElementsByTagName(name: "line"): NodeListOf<SVGLineElement>;
+ getElementsByTagName(name: "lineargradient"): NodeListOf<SVGLinearGradientElement>;
+ getElementsByTagName(name: "link"): NodeListOf<HTMLLinkElement>;
+ getElementsByTagName(name: "listing"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(name: "map"): NodeListOf<HTMLMapElement>;
+ getElementsByTagName(name: "mark"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "marker"): NodeListOf<SVGMarkerElement>;
+ getElementsByTagName(name: "marquee"): NodeListOf<HTMLMarqueeElement>;
+ getElementsByTagName(name: "mask"): NodeListOf<SVGMaskElement>;
+ getElementsByTagName(name: "menu"): NodeListOf<HTMLMenuElement>;
+ getElementsByTagName(name: "meta"): NodeListOf<HTMLMetaElement>;
+ getElementsByTagName(name: "metadata"): NodeListOf<SVGMetadataElement>;
+ getElementsByTagName(name: "nav"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "nextid"): NodeListOf<HTMLNextIdElement>;
+ getElementsByTagName(name: "nobr"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "noframes"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "noscript"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "object"): NodeListOf<HTMLObjectElement>;
+ getElementsByTagName(name: "ol"): NodeListOf<HTMLOListElement>;
+ getElementsByTagName(name: "optgroup"): NodeListOf<HTMLOptGroupElement>;
+ getElementsByTagName(name: "option"): NodeListOf<HTMLOptionElement>;
+ getElementsByTagName(name: "p"): NodeListOf<HTMLParagraphElement>;
+ getElementsByTagName(name: "param"): NodeListOf<HTMLParamElement>;
+ getElementsByTagName(name: "path"): NodeListOf<SVGPathElement>;
+ getElementsByTagName(name: "pattern"): NodeListOf<SVGPatternElement>;
+ getElementsByTagName(name: "plaintext"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(name: "polygon"): NodeListOf<SVGPolygonElement>;
+ getElementsByTagName(name: "polyline"): NodeListOf<SVGPolylineElement>;
+ getElementsByTagName(name: "pre"): NodeListOf<HTMLPreElement>;
+ getElementsByTagName(name: "progress"): NodeListOf<HTMLProgressElement>;
+ getElementsByTagName(name: "q"): NodeListOf<HTMLQuoteElement>;
+ getElementsByTagName(name: "radialgradient"): NodeListOf<SVGRadialGradientElement>;
+ getElementsByTagName(name: "rect"): NodeListOf<SVGRectElement>;
+ getElementsByTagName(name: "rt"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "ruby"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "s"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "samp"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "script"): NodeListOf<HTMLScriptElement>;
+ getElementsByTagName(name: "section"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "select"): NodeListOf<HTMLSelectElement>;
+ getElementsByTagName(name: "small"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "source"): NodeListOf<HTMLSourceElement>;
+ getElementsByTagName(name: "span"): NodeListOf<HTMLSpanElement>;
+ getElementsByTagName(name: "stop"): NodeListOf<SVGStopElement>;
+ getElementsByTagName(name: "strike"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "strong"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "style"): NodeListOf<HTMLStyleElement>;
+ getElementsByTagName(name: "sub"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "sup"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "svg"): NodeListOf<SVGSVGElement>;
+ getElementsByTagName(name: "switch"): NodeListOf<SVGSwitchElement>;
+ getElementsByTagName(name: "symbol"): NodeListOf<SVGSymbolElement>;
+ getElementsByTagName(name: "table"): NodeListOf<HTMLTableElement>;
+ getElementsByTagName(name: "tbody"): NodeListOf<HTMLTableSectionElement>;
+ getElementsByTagName(name: "td"): NodeListOf<HTMLTableDataCellElement>;
+ getElementsByTagName(name: "text"): NodeListOf<SVGTextElement>;
+ getElementsByTagName(name: "textpath"): NodeListOf<SVGTextPathElement>;
+ getElementsByTagName(name: "textarea"): NodeListOf<HTMLTextAreaElement>;
+ getElementsByTagName(name: "tfoot"): NodeListOf<HTMLTableSectionElement>;
+ getElementsByTagName(name: "th"): NodeListOf<HTMLTableHeaderCellElement>;
+ getElementsByTagName(name: "thead"): NodeListOf<HTMLTableSectionElement>;
+ getElementsByTagName(name: "title"): NodeListOf<HTMLTitleElement>;
+ getElementsByTagName(name: "tr"): NodeListOf<HTMLTableRowElement>;
+ getElementsByTagName(name: "track"): NodeListOf<HTMLTrackElement>;
+ getElementsByTagName(name: "tspan"): NodeListOf<SVGTSpanElement>;
+ getElementsByTagName(name: "tt"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "u"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "ul"): NodeListOf<HTMLUListElement>;
+ getElementsByTagName(name: "use"): NodeListOf<SVGUseElement>;
+ getElementsByTagName(name: "var"): NodeListOf<HTMLPhraseElement>;
+ getElementsByTagName(name: "video"): NodeListOf<HTMLVideoElement>;
+ getElementsByTagName(name: "view"): NodeListOf<SVGViewElement>;
+ getElementsByTagName(name: "wbr"): NodeListOf<HTMLElement>;
+ getElementsByTagName(name: "x-ms-webview"): NodeListOf<MSHTMLWebViewElement>;
+ getElementsByTagName(name: "xmp"): NodeListOf<HTMLBlockElement>;
+ getElementsByTagName(name: string): NodeListOf<Element>;
+ getElementsByTagNameNS(namespaceURI: string, localName: string): NodeListOf<Element>;
+ hasAttribute(name: string): boolean;
+ hasAttributeNS(namespaceURI: string, localName: string): boolean;
+ msGetRegionContent(): MSRangeCollection;
+ msGetUntransformedBounds(): ClientRect;
+ msMatchesSelector(selectors: string): boolean;
+ msReleasePointerCapture(pointerId: number): void;
+ msSetPointerCapture(pointerId: number): void;
+ msZoomTo(args: MsZoomToOptions): void;
+ releasePointerCapture(pointerId: number): void;
+ removeAttribute(name?: string): void;
+ removeAttributeNS(namespaceURI: string, localName: string): void;
+ removeAttributeNode(oldAttr: Attr): Attr;
+ requestFullscreen(): void;
+ requestPointerLock(): void;
+ setAttribute(name: string, value: string): void;
+ setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void;
+ setAttributeNode(newAttr: Attr): Attr;
+ setAttributeNodeNS(newAttr: Attr): Attr;
+ setPointerCapture(pointerId: number): void;
+ webkitMatchesSelector(selectors: string): boolean;
+ webkitRequestFullScreen(): void;
+ webkitRequestFullscreen(): void;
+ getElementsByClassName(classNames: string): NodeListOf<Element>;
+ matches(selector: string): boolean;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var Element: {
+ prototype: Element;
+ new(): Element;
+}
+
+interface ErrorEvent extends Event {
+ colno: number;
+ error: any;
+ filename: string;
+ lineno: number;
+ message: string;
+ initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void;
+}
+
+declare var ErrorEvent: {
+ prototype: ErrorEvent;
+ new(): ErrorEvent;
+}
+
+interface Event {
+ bubbles: boolean;
+ cancelBubble: boolean;
+ cancelable: boolean;
+ currentTarget: EventTarget;
+ defaultPrevented: boolean;
+ eventPhase: number;
+ isTrusted: boolean;
+ returnValue: boolean;
+ srcElement: Element;
+ target: EventTarget;
+ timeStamp: number;
+ type: string;
+ initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void;
+ preventDefault(): void;
+ stopImmediatePropagation(): void;
+ stopPropagation(): void;
+ AT_TARGET: number;
+ BUBBLING_PHASE: number;
+ CAPTURING_PHASE: number;
+}
+
+declare var Event: {
+ prototype: Event;
+ new(type: string, eventInitDict?: EventInit): Event;
+ AT_TARGET: number;
+ BUBBLING_PHASE: number;
+ CAPTURING_PHASE: number;
+}
+
+interface EventTarget {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+ dispatchEvent(evt: Event): boolean;
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var EventTarget: {
+ prototype: EventTarget;
+ new(): EventTarget;
+}
+
+interface External {
+}
+
+declare var External: {
+ prototype: External;
+ new(): External;
+}
+
+interface File extends Blob {
+ lastModifiedDate: any;
+ name: string;
+}
+
+declare var File: {
+ prototype: File;
+ new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File;
+}
+
+interface FileList {
+ length: number;
+ item(index: number): File;
+ [index: number]: File;
+}
+
+declare var FileList: {
+ prototype: FileList;
+ new(): FileList;
+}
+
+interface FileReader extends EventTarget, MSBaseReader {
+ error: DOMError;
+ readAsArrayBuffer(blob: Blob): void;
+ readAsBinaryString(blob: Blob): void;
+ readAsDataURL(blob: Blob): void;
+ readAsText(blob: Blob, encoding?: string): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var FileReader: {
+ prototype: FileReader;
+ new(): FileReader;
+}
+
+interface FocusEvent extends UIEvent {
+ relatedTarget: EventTarget;
+ initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void;
+}
+
+declare var FocusEvent: {
+ prototype: FocusEvent;
+ new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent;
+}
+
+interface FormData {
+ append(name: any, value: any, blobName?: string): void;
+}
+
+declare var FormData: {
+ prototype: FormData;
+ new (form?: HTMLFormElement): FormData;
+}
+
+interface GainNode extends AudioNode {
+ gain: AudioParam;
+}
+
+declare var GainNode: {
+ prototype: GainNode;
+ new(): GainNode;
+}
+
+interface Gamepad {
+ axes: number[];
+ buttons: GamepadButton[];
+ connected: boolean;
+ id: string;
+ index: number;
+ mapping: string;
+ timestamp: number;
+}
+
+declare var Gamepad: {
+ prototype: Gamepad;
+ new(): Gamepad;
+}
+
+interface GamepadButton {
+ pressed: boolean;
+ value: number;
+}
+
+declare var GamepadButton: {
+ prototype: GamepadButton;
+ new(): GamepadButton;
+}
+
+interface GamepadEvent extends Event {
+ gamepad: Gamepad;
+}
+
+declare var GamepadEvent: {
+ prototype: GamepadEvent;
+ new(): GamepadEvent;
+}
+
+interface Geolocation {
+ clearWatch(watchId: number): void;
+ getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void;
+ watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number;
+}
+
+declare var Geolocation: {
+ prototype: Geolocation;
+ new(): Geolocation;
+}
+
+interface HTMLAllCollection extends HTMLCollection {
+ namedItem(name: string): Element;
+}
+
+declare var HTMLAllCollection: {
+ prototype: HTMLAllCollection;
+ new(): HTMLAllCollection;
+}
+
+interface HTMLAnchorElement extends HTMLElement {
+ Methods: string;
+ /**
+ * Sets or retrieves the character set used to encode the object.
+ */
+ charset: string;
+ /**
+ * Sets or retrieves the coordinates of the object.
+ */
+ coords: string;
+ /**
+ * Contains the anchor portion of the URL including the hash sign (#).
+ */
+ hash: string;
+ /**
+ * Contains the hostname and port values of the URL.
+ */
+ host: string;
+ /**
+ * Contains the hostname of a URL.
+ */
+ hostname: string;
+ /**
+ * Sets or retrieves a destination URL or an anchor point.
+ */
+ href: string;
+ /**
+ * Sets or retrieves the language code of the object.
+ */
+ hreflang: string;
+ mimeType: string;
+ /**
+ * Sets or retrieves the shape of the object.
+ */
+ name: string;
+ nameProp: string;
+ /**
+ * Contains the pathname of the URL.
+ */
+ pathname: string;
+ /**
+ * Sets or retrieves the port number associated with a URL.
+ */
+ port: string;
+ /**
+ * Contains the protocol of the URL.
+ */
+ protocol: string;
+ protocolLong: string;
+ /**
+ * Sets or retrieves the relationship between the object and the destination of the link.
+ */
+ rel: string;
+ /**
+ * Sets or retrieves the relationship between the object and the destination of the link.
+ */
+ rev: string;
+ /**
+ * Sets or retrieves the substring of the href property that follows the question mark.
+ */
+ search: string;
+ /**
+ * Sets or retrieves the shape of the object.
+ */
+ shape: string;
+ /**
+ * Sets or retrieves the window or frame at which to target content.
+ */
+ target: string;
+ /**
+ * Retrieves or sets the text of the object as a string.
+ */
+ text: string;
+ type: string;
+ urn: string;
+ /**
+ * Returns a string representation of an object.
+ */
+ toString(): string;
+}
+
+declare var HTMLAnchorElement: {
+ prototype: HTMLAnchorElement;
+ new(): HTMLAnchorElement;
+}
+
+interface HTMLAppletElement extends HTMLElement {
+ /**
+ * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element.
+ */
+ BaseHref: string;
+ align: string;
+ /**
+ * Sets or retrieves a text alternative to the graphic.
+ */
+ alt: string;
+ /**
+ * Gets or sets the optional alternative HTML script to execute if the object fails to load.
+ */
+ altHtml: string;
+ /**
+ * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.
+ */
+ archive: string;
+ border: string;
+ code: string;
+ /**
+ * Sets or retrieves the URL of the component.
+ */
+ codeBase: string;
+ /**
+ * Sets or retrieves the Internet media type for the code associated with the object.
+ */
+ codeType: string;
+ /**
+ * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned.
+ */
+ contentDocument: Document;
+ /**
+ * Sets or retrieves the URL that references the data of the object.
+ */
+ data: string;
+ /**
+ * Sets or retrieves a character string that can be used to implement your own declare functionality for the object.
+ */
+ declare: boolean;
+ form: HTMLFormElement;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: string;
+ hspace: number;
+ /**
+ * Sets or retrieves the shape of the object.
+ */
+ name: string;
+ object: string;
+ /**
+ * Sets or retrieves a message to be displayed while an object is loading.
+ */
+ standby: string;
+ /**
+ * Returns the content type of the object.
+ */
+ type: string;
+ /**
+ * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
+ */
+ useMap: string;
+ vspace: number;
+ width: number;
+}
+
+declare var HTMLAppletElement: {
+ prototype: HTMLAppletElement;
+ new(): HTMLAppletElement;
+}
+
+interface HTMLAreaElement extends HTMLElement {
+ /**
+ * Sets or retrieves a text alternative to the graphic.
+ */
+ alt: string;
+ /**
+ * Sets or retrieves the coordinates of the object.
+ */
+ coords: string;
+ /**
+ * Sets or retrieves the subsection of the href property that follows the number sign (#).
+ */
+ hash: string;
+ /**
+ * Sets or retrieves the hostname and port number of the location or URL.
+ */
+ host: string;
+ /**
+ * Sets or retrieves the host name part of the location or URL.
+ */
+ hostname: string;
+ /**
+ * Sets or retrieves a destination URL or an anchor point.
+ */
+ href: string;
+ /**
+ * Sets or gets whether clicks in this region cause action.
+ */
+ noHref: boolean;
+ /**
+ * Sets or retrieves the file name or path specified by the object.
+ */
+ pathname: string;
+ /**
+ * Sets or retrieves the port number associated with a URL.
+ */
+ port: string;
+ /**
+ * Sets or retrieves the protocol portion of a URL.
+ */
+ protocol: string;
+ rel: string;
+ /**
+ * Sets or retrieves the substring of the href property that follows the question mark.
+ */
+ search: string;
+ /**
+ * Sets or retrieves the shape of the object.
+ */
+ shape: string;
+ /**
+ * Sets or retrieves the window or frame at which to target content.
+ */
+ target: string;
+ /**
+ * Returns a string representation of an object.
+ */
+ toString(): string;
+}
+
+declare var HTMLAreaElement: {
+ prototype: HTMLAreaElement;
+ new(): HTMLAreaElement;
+}
+
+interface HTMLAreasCollection extends HTMLCollection {
+ /**
+ * Adds an element to the areas, controlRange, or options collection.
+ */
+ add(element: HTMLElement, before?: HTMLElement | number): void;
+ /**
+ * Removes an element from the collection.
+ */
+ remove(index?: number): void;
+}
+
+declare var HTMLAreasCollection: {
+ prototype: HTMLAreasCollection;
+ new(): HTMLAreasCollection;
+}
+
+interface HTMLAudioElement extends HTMLMediaElement {
+}
+
+declare var HTMLAudioElement: {
+ prototype: HTMLAudioElement;
+ new(): HTMLAudioElement;
+}
+
+interface HTMLBRElement extends HTMLElement {
+ /**
+ * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document.
+ */
+ clear: string;
+}
+
+declare var HTMLBRElement: {
+ prototype: HTMLBRElement;
+ new(): HTMLBRElement;
+}
+
+interface HTMLBaseElement extends HTMLElement {
+ /**
+ * Gets or sets the baseline URL on which relative links are based.
+ */
+ href: string;
+ /**
+ * Sets or retrieves the window or frame at which to target content.
+ */
+ target: string;
+}
+
+declare var HTMLBaseElement: {
+ prototype: HTMLBaseElement;
+ new(): HTMLBaseElement;
+}
+
+interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty {
+ /**
+ * Sets or retrieves the current typeface family.
+ */
+ face: string;
+ /**
+ * Sets or retrieves the font size of the object.
+ */
+ size: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLBaseFontElement: {
+ prototype: HTMLBaseFontElement;
+ new(): HTMLBaseFontElement;
+}
+
+interface HTMLBlockElement extends HTMLElement {
+ /**
+ * Sets or retrieves reference information about the object.
+ */
+ cite: string;
+ clear: string;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: number;
+}
+
+declare var HTMLBlockElement: {
+ prototype: HTMLBlockElement;
+ new(): HTMLBlockElement;
+}
+
+interface HTMLBodyElement extends HTMLElement {
+ aLink: any;
+ background: string;
+ bgColor: any;
+ bgProperties: string;
+ link: any;
+ noWrap: boolean;
+ onafterprint: (ev: Event) => any;
+ onbeforeprint: (ev: Event) => any;
+ onbeforeunload: (ev: BeforeUnloadEvent) => any;
+ onblur: (ev: FocusEvent) => any;
+ onerror: (ev: Event) => any;
+ onfocus: (ev: FocusEvent) => any;
+ onhashchange: (ev: HashChangeEvent) => any;
+ onload: (ev: Event) => any;
+ onmessage: (ev: MessageEvent) => any;
+ onoffline: (ev: Event) => any;
+ ononline: (ev: Event) => any;
+ onorientationchange: (ev: Event) => any;
+ onpagehide: (ev: PageTransitionEvent) => any;
+ onpageshow: (ev: PageTransitionEvent) => any;
+ onpopstate: (ev: PopStateEvent) => any;
+ onresize: (ev: UIEvent) => any;
+ onstorage: (ev: StorageEvent) => any;
+ onunload: (ev: Event) => any;
+ text: any;
+ vLink: any;
+ createTextRange(): TextRange;
+ addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLBodyElement: {
+ prototype: HTMLBodyElement;
+ new(): HTMLBodyElement;
+}
+
+interface HTMLButtonElement extends HTMLElement {
+ /**
+ * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
+ */
+ autofocus: boolean;
+ disabled: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ form: HTMLFormElement;
+ /**
+ * Overrides the action attribute (where the data on a form is sent) on the parent form element.
+ */
+ formAction: string;
+ /**
+ * Used to override the encoding (formEnctype attribute) specified on the form element.
+ */
+ formEnctype: string;
+ /**
+ * Overrides the submit method attribute previously specified on a form element.
+ */
+ formMethod: string;
+ /**
+ * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option.
+ */
+ formNoValidate: string;
+ /**
+ * Overrides the target attribute on a form element.
+ */
+ formTarget: string;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ status: any;
+ /**
+ * Gets the classification and default behavior of the button.
+ */
+ type: string;
+ /**
+ * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
+ */
+ validationMessage: string;
+ /**
+ * Returns a ValidityState object that represents the validity states of an element.
+ */
+ validity: ValidityState;
+ /**
+ * Sets or retrieves the default or selected value of the control.
+ */
+ value: string;
+ /**
+ * Returns whether an element will successfully validate based on forms validation rules and constraints.
+ */
+ willValidate: boolean;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Creates a TextRange object for the element.
+ */
+ createTextRange(): TextRange;
+ /**
+ * Sets a custom error message that is displayed when a form is submitted.
+ * @param error Sets a custom error message that is displayed when a form is submitted.
+ */
+ setCustomValidity(error: string): void;
+}
+
+declare var HTMLButtonElement: {
+ prototype: HTMLButtonElement;
+ new(): HTMLButtonElement;
+}
+
+interface HTMLCanvasElement extends HTMLElement {
+ /**
+ * Gets or sets the height of a canvas element on a document.
+ */
+ height: number;
+ /**
+ * Gets or sets the width of a canvas element on a document.
+ */
+ width: number;
+ /**
+ * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.
+ * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl");
+ */
+ getContext(contextId: "2d"): CanvasRenderingContext2D;
+ getContext(contextId: "experimental-webgl"): WebGLRenderingContext;
+ getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext;
+ /**
+ * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing.
+ */
+ msToBlob(): Blob;
+ /**
+ * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.
+ * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.
+ */
+ toDataURL(type?: string, ...args: any[]): string;
+}
+
+declare var HTMLCanvasElement: {
+ prototype: HTMLCanvasElement;
+ new(): HTMLCanvasElement;
+}
+
+interface HTMLCollection {
+ /**
+ * Sets or retrieves the number of objects in a collection.
+ */
+ length: number;
+ /**
+ * Retrieves an object from various collections.
+ */
+ item(nameOrIndex?: any, optionalIndex?: any): Element;
+ /**
+ * Retrieves a select object or an object from an options collection.
+ */
+ namedItem(name: string): Element;
+ [index: number]: Element;
+}
+
+declare var HTMLCollection: {
+ prototype: HTMLCollection;
+ new(): HTMLCollection;
+}
+
+interface HTMLDDElement extends HTMLElement {
+ /**
+ * Sets or retrieves whether the browser automatically performs wordwrap.
+ */
+ noWrap: boolean;
+}
+
+declare var HTMLDDElement: {
+ prototype: HTMLDDElement;
+ new(): HTMLDDElement;
+}
+
+interface HTMLDListElement extends HTMLElement {
+ compact: boolean;
+}
+
+declare var HTMLDListElement: {
+ prototype: HTMLDListElement;
+ new(): HTMLDListElement;
+}
+
+interface HTMLDTElement extends HTMLElement {
+ /**
+ * Sets or retrieves whether the browser automatically performs wordwrap.
+ */
+ noWrap: boolean;
+}
+
+declare var HTMLDTElement: {
+ prototype: HTMLDTElement;
+ new(): HTMLDTElement;
+}
+
+interface HTMLDataListElement extends HTMLElement {
+ options: HTMLCollection;
+}
+
+declare var HTMLDataListElement: {
+ prototype: HTMLDataListElement;
+ new(): HTMLDataListElement;
+}
+
+interface HTMLDirectoryElement extends HTMLElement {
+ compact: boolean;
+}
+
+declare var HTMLDirectoryElement: {
+ prototype: HTMLDirectoryElement;
+ new(): HTMLDirectoryElement;
+}
+
+interface HTMLDivElement extends HTMLElement {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ /**
+ * Sets or retrieves whether the browser automatically performs wordwrap.
+ */
+ noWrap: boolean;
+}
+
+declare var HTMLDivElement: {
+ prototype: HTMLDivElement;
+ new(): HTMLDivElement;
+}
+
+interface HTMLDocument extends Document {
+}
+
+declare var HTMLDocument: {
+ prototype: HTMLDocument;
+ new(): HTMLDocument;
+}
+
+interface HTMLElement extends Element {
+ accessKey: string;
+ children: HTMLCollection;
+ contentEditable: string;
+ dataset: DOMStringMap;
+ dir: string;
+ draggable: boolean;
+ hidden: boolean;
+ hideFocus: boolean;
+ innerHTML: string;
+ innerText: string;
+ isContentEditable: boolean;
+ lang: string;
+ offsetHeight: number;
+ offsetLeft: number;
+ offsetParent: Element;
+ offsetTop: number;
+ offsetWidth: number;
+ onabort: (ev: Event) => any;
+ onactivate: (ev: UIEvent) => any;
+ onbeforeactivate: (ev: UIEvent) => any;
+ onbeforecopy: (ev: DragEvent) => any;
+ onbeforecut: (ev: DragEvent) => any;
+ onbeforedeactivate: (ev: UIEvent) => any;
+ onbeforepaste: (ev: DragEvent) => any;
+ onblur: (ev: FocusEvent) => any;
+ oncanplay: (ev: Event) => any;
+ oncanplaythrough: (ev: Event) => any;
+ onchange: (ev: Event) => any;
+ onclick: (ev: MouseEvent) => any;
+ oncontextmenu: (ev: PointerEvent) => any;
+ oncopy: (ev: DragEvent) => any;
+ oncuechange: (ev: Event) => any;
+ oncut: (ev: DragEvent) => any;
+ ondblclick: (ev: MouseEvent) => any;
+ ondeactivate: (ev: UIEvent) => any;
+ ondrag: (ev: DragEvent) => any;
+ ondragend: (ev: DragEvent) => any;
+ ondragenter: (ev: DragEvent) => any;
+ ondragleave: (ev: DragEvent) => any;
+ ondragover: (ev: DragEvent) => any;
+ ondragstart: (ev: DragEvent) => any;
+ ondrop: (ev: DragEvent) => any;
+ ondurationchange: (ev: Event) => any;
+ onemptied: (ev: Event) => any;
+ onended: (ev: Event) => any;
+ onerror: (ev: Event) => any;
+ onfocus: (ev: FocusEvent) => any;
+ oninput: (ev: Event) => any;
+ onkeydown: (ev: KeyboardEvent) => any;
+ onkeypress: (ev: KeyboardEvent) => any;
+ onkeyup: (ev: KeyboardEvent) => any;
+ onload: (ev: Event) => any;
+ onloadeddata: (ev: Event) => any;
+ onloadedmetadata: (ev: Event) => any;
+ onloadstart: (ev: Event) => any;
+ onmousedown: (ev: MouseEvent) => any;
+ onmouseenter: (ev: MouseEvent) => any;
+ onmouseleave: (ev: MouseEvent) => any;
+ onmousemove: (ev: MouseEvent) => any;
+ onmouseout: (ev: MouseEvent) => any;
+ onmouseover: (ev: MouseEvent) => any;
+ onmouseup: (ev: MouseEvent) => any;
+ onmousewheel: (ev: MouseWheelEvent) => any;
+ onmscontentzoom: (ev: UIEvent) => any;
+ onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any;
+ onpaste: (ev: DragEvent) => any;
+ onpause: (ev: Event) => any;
+ onplay: (ev: Event) => any;
+ onplaying: (ev: Event) => any;
+ onprogress: (ev: ProgressEvent) => any;
+ onratechange: (ev: Event) => any;
+ onreset: (ev: Event) => any;
+ onscroll: (ev: UIEvent) => any;
+ onseeked: (ev: Event) => any;
+ onseeking: (ev: Event) => any;
+ onselect: (ev: UIEvent) => any;
+ onselectstart: (ev: Event) => any;
+ onstalled: (ev: Event) => any;
+ onsubmit: (ev: Event) => any;
+ onsuspend: (ev: Event) => any;
+ ontimeupdate: (ev: Event) => any;
+ onvolumechange: (ev: Event) => any;
+ onwaiting: (ev: Event) => any;
+ outerHTML: string;
+ outerText: string;
+ spellcheck: boolean;
+ style: CSSStyleDeclaration;
+ tabIndex: number;
+ title: string;
+ blur(): void;
+ click(): void;
+ dragDrop(): boolean;
+ focus(): void;
+ insertAdjacentElement(position: string, insertedElement: Element): Element;
+ insertAdjacentHTML(where: string, html: string): void;
+ insertAdjacentText(where: string, text: string): void;
+ msGetInputContext(): MSInputMethodContext;
+ scrollIntoView(top?: boolean): void;
+ setActive(): void;
+ addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLElement: {
+ prototype: HTMLElement;
+ new(): HTMLElement;
+}
+
+interface HTMLEmbedElement extends HTMLElement, GetSVGDocument {
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: string;
+ hidden: any;
+ /**
+ * Gets or sets whether the DLNA PlayTo device is available.
+ */
+ msPlayToDisabled: boolean;
+ /**
+ * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.
+ */
+ msPlayToPreferredSourceUri: string;
+ /**
+ * Gets or sets the primary DLNA PlayTo device.
+ */
+ msPlayToPrimary: boolean;
+ /**
+ * Gets the source associated with the media element for use by the PlayToManager.
+ */
+ msPlayToSource: any;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ /**
+ * Retrieves the palette used for the embedded document.
+ */
+ palette: string;
+ /**
+ * Retrieves the URL of the plug-in used to view an embedded document.
+ */
+ pluginspage: string;
+ readyState: string;
+ /**
+ * Sets or retrieves a URL to be loaded by the object.
+ */
+ src: string;
+ /**
+ * Sets or retrieves the height and width units of the embed object.
+ */
+ units: string;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLEmbedElement: {
+ prototype: HTMLEmbedElement;
+ new(): HTMLEmbedElement;
+}
+
+interface HTMLFieldSetElement extends HTMLElement {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ disabled: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ form: HTMLFormElement;
+ /**
+ * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
+ */
+ validationMessage: string;
+ /**
+ * Returns a ValidityState object that represents the validity states of an element.
+ */
+ validity: ValidityState;
+ /**
+ * Returns whether an element will successfully validate based on forms validation rules and constraints.
+ */
+ willValidate: boolean;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Sets a custom error message that is displayed when a form is submitted.
+ * @param error Sets a custom error message that is displayed when a form is submitted.
+ */
+ setCustomValidity(error: string): void;
+}
+
+declare var HTMLFieldSetElement: {
+ prototype: HTMLFieldSetElement;
+ new(): HTMLFieldSetElement;
+}
+
+interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty {
+ /**
+ * Sets or retrieves the current typeface family.
+ */
+ face: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLFontElement: {
+ prototype: HTMLFontElement;
+ new(): HTMLFontElement;
+}
+
+interface HTMLFormElement extends HTMLElement {
+ /**
+ * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form.
+ */
+ acceptCharset: string;
+ /**
+ * Sets or retrieves the URL to which the form content is sent for processing.
+ */
+ action: string;
+ /**
+ * Specifies whether autocomplete is applied to an editable text field.
+ */
+ autocomplete: string;
+ /**
+ * Retrieves a collection, in source order, of all controls in a given form.
+ */
+ elements: HTMLCollection;
+ /**
+ * Sets or retrieves the MIME encoding for the form.
+ */
+ encoding: string;
+ /**
+ * Sets or retrieves the encoding type for the form.
+ */
+ enctype: string;
+ /**
+ * Sets or retrieves the number of objects in a collection.
+ */
+ length: number;
+ /**
+ * Sets or retrieves how to send the form data to the server.
+ */
+ method: string;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ /**
+ * Designates a form that is not validated when submitted.
+ */
+ noValidate: boolean;
+ /**
+ * Sets or retrieves the window or frame at which to target content.
+ */
+ target: string;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Retrieves a form object or an object from an elements collection.
+ * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.
+ * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.
+ */
+ item(name?: any, index?: any): any;
+ /**
+ * Retrieves a form object or an object from an elements collection.
+ */
+ namedItem(name: string): any;
+ /**
+ * Fires when the user resets a form.
+ */
+ reset(): void;
+ /**
+ * Fires when a FORM is about to be submitted.
+ */
+ submit(): void;
+ [name: string]: any;
+}
+
+declare var HTMLFormElement: {
+ prototype: HTMLFormElement;
+ new(): HTMLFormElement;
+}
+
+interface HTMLFrameElement extends HTMLElement, GetSVGDocument {
+ /**
+ * Specifies the properties of a border drawn around an object.
+ */
+ border: string;
+ /**
+ * Sets or retrieves the border color of the object.
+ */
+ borderColor: any;
+ /**
+ * Retrieves the document object of the page or frame.
+ */
+ contentDocument: Document;
+ /**
+ * Retrieves the object of the specified.
+ */
+ contentWindow: Window;
+ /**
+ * Sets or retrieves whether to display a border for the frame.
+ */
+ frameBorder: string;
+ /**
+ * Sets or retrieves the amount of additional space between the frames.
+ */
+ frameSpacing: any;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: string | number;
+ /**
+ * Sets or retrieves a URI to a long description of the object.
+ */
+ longDesc: string;
+ /**
+ * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.
+ */
+ marginHeight: string;
+ /**
+ * Sets or retrieves the left and right margin widths before displaying the text in a frame.
+ */
+ marginWidth: string;
+ /**
+ * Sets or retrieves the frame name.
+ */
+ name: string;
+ /**
+ * Sets or retrieves whether the user can resize the frame.
+ */
+ noResize: boolean;
+ /**
+ * Raised when the object has been completely received from the server.
+ */
+ onload: (ev: Event) => any;
+ /**
+ * Sets or retrieves whether the frame can be scrolled.
+ */
+ scrolling: string;
+ /**
+ * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied.
+ */
+ security: any;
+ /**
+ * Sets or retrieves a URL to be loaded by the object.
+ */
+ src: string;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string | number;
+ addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLFrameElement: {
+ prototype: HTMLFrameElement;
+ new(): HTMLFrameElement;
+}
+
+interface HTMLFrameSetElement extends HTMLElement {
+ border: string;
+ /**
+ * Sets or retrieves the border color of the object.
+ */
+ borderColor: any;
+ /**
+ * Sets or retrieves the frame widths of the object.
+ */
+ cols: string;
+ /**
+ * Sets or retrieves whether to display a border for the frame.
+ */
+ frameBorder: string;
+ /**
+ * Sets or retrieves the amount of additional space between the frames.
+ */
+ frameSpacing: any;
+ name: string;
+ onafterprint: (ev: Event) => any;
+ onbeforeprint: (ev: Event) => any;
+ onbeforeunload: (ev: BeforeUnloadEvent) => any;
+ /**
+ * Fires when the object loses the input focus.
+ */
+ onblur: (ev: FocusEvent) => any;
+ onerror: (ev: Event) => any;
+ /**
+ * Fires when the object receives focus.
+ */
+ onfocus: (ev: FocusEvent) => any;
+ onhashchange: (ev: HashChangeEvent) => any;
+ onload: (ev: Event) => any;
+ onmessage: (ev: MessageEvent) => any;
+ onoffline: (ev: Event) => any;
+ ononline: (ev: Event) => any;
+ onorientationchange: (ev: Event) => any;
+ onpagehide: (ev: PageTransitionEvent) => any;
+ onpageshow: (ev: PageTransitionEvent) => any;
+ onresize: (ev: UIEvent) => any;
+ onstorage: (ev: StorageEvent) => any;
+ onunload: (ev: Event) => any;
+ /**
+ * Sets or retrieves the frame heights of the object.
+ */
+ rows: string;
+ addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLFrameSetElement: {
+ prototype: HTMLFrameSetElement;
+ new(): HTMLFrameSetElement;
+}
+
+interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ /**
+ * Sets or retrieves whether the horizontal rule is drawn with 3-D shading.
+ */
+ noShade: boolean;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLHRElement: {
+ prototype: HTMLHRElement;
+ new(): HTMLHRElement;
+}
+
+interface HTMLHeadElement extends HTMLElement {
+ profile: string;
+}
+
+declare var HTMLHeadElement: {
+ prototype: HTMLHeadElement;
+ new(): HTMLHeadElement;
+}
+
+interface HTMLHeadingElement extends HTMLElement {
+ /**
+ * Sets or retrieves a value that indicates the table alignment.
+ */
+ align: string;
+ clear: string;
+}
+
+declare var HTMLHeadingElement: {
+ prototype: HTMLHeadingElement;
+ new(): HTMLHeadingElement;
+}
+
+interface HTMLHtmlElement extends HTMLElement {
+ /**
+ * Sets or retrieves the DTD version that governs the current document.
+ */
+ version: string;
+}
+
+declare var HTMLHtmlElement: {
+ prototype: HTMLHtmlElement;
+ new(): HTMLHtmlElement;
+}
+
+interface HTMLIFrameElement extends HTMLElement, GetSVGDocument {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ allowFullscreen: boolean;
+ /**
+ * Specifies the properties of a border drawn around an object.
+ */
+ border: string;
+ /**
+ * Retrieves the document object of the page or frame.
+ */
+ contentDocument: Document;
+ /**
+ * Retrieves the object of the specified.
+ */
+ contentWindow: Window;
+ /**
+ * Sets or retrieves whether to display a border for the frame.
+ */
+ frameBorder: string;
+ /**
+ * Sets or retrieves the amount of additional space between the frames.
+ */
+ frameSpacing: any;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: string;
+ /**
+ * Sets or retrieves the horizontal margin for the object.
+ */
+ hspace: number;
+ /**
+ * Sets or retrieves a URI to a long description of the object.
+ */
+ longDesc: string;
+ /**
+ * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.
+ */
+ marginHeight: string;
+ /**
+ * Sets or retrieves the left and right margin widths before displaying the text in a frame.
+ */
+ marginWidth: string;
+ /**
+ * Sets or retrieves the frame name.
+ */
+ name: string;
+ /**
+ * Sets or retrieves whether the user can resize the frame.
+ */
+ noResize: boolean;
+ /**
+ * Raised when the object has been completely received from the server.
+ */
+ onload: (ev: Event) => any;
+ sandbox: DOMSettableTokenList;
+ /**
+ * Sets or retrieves whether the frame can be scrolled.
+ */
+ scrolling: string;
+ /**
+ * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied.
+ */
+ security: any;
+ /**
+ * Sets or retrieves a URL to be loaded by the object.
+ */
+ src: string;
+ /**
+ * Sets or retrieves the vertical margin for the object.
+ */
+ vspace: number;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string;
+ addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLIFrameElement: {
+ prototype: HTMLIFrameElement;
+ new(): HTMLIFrameElement;
+}
+
+interface HTMLImageElement extends HTMLElement {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ /**
+ * Sets or retrieves a text alternative to the graphic.
+ */
+ alt: string;
+ /**
+ * Specifies the properties of a border drawn around an object.
+ */
+ border: string;
+ /**
+ * Retrieves whether the object is fully loaded.
+ */
+ complete: boolean;
+ crossOrigin: string;
+ currentSrc: string;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: number;
+ /**
+ * Sets or retrieves the width of the border to draw around the object.
+ */
+ hspace: number;
+ /**
+ * Sets or retrieves whether the image is a server-side image map.
+ */
+ isMap: boolean;
+ /**
+ * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object.
+ */
+ longDesc: string;
+ /**
+ * Gets or sets whether the DLNA PlayTo device is available.
+ */
+ msPlayToDisabled: boolean;
+ msPlayToPreferredSourceUri: string;
+ /**
+ * Gets or sets the primary DLNA PlayTo device.
+ */
+ msPlayToPrimary: boolean;
+ /**
+ * Gets the source associated with the media element for use by the PlayToManager.
+ */
+ msPlayToSource: any;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ /**
+ * The original height of the image resource before sizing.
+ */
+ naturalHeight: number;
+ /**
+ * The original width of the image resource before sizing.
+ */
+ naturalWidth: number;
+ /**
+ * The address or URL of the a media resource that is to be considered.
+ */
+ src: string;
+ srcset: string;
+ /**
+ * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
+ */
+ useMap: string;
+ /**
+ * Sets or retrieves the vertical margin for the object.
+ */
+ vspace: number;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: number;
+ x: number;
+ y: number;
+ msGetAsCastingSource(): any;
+}
+
+declare var HTMLImageElement: {
+ prototype: HTMLImageElement;
+ new(): HTMLImageElement;
+ create(): HTMLImageElement;
+}
+
+interface HTMLInputElement extends HTMLElement {
+ /**
+ * Sets or retrieves a comma-separated list of content types.
+ */
+ accept: string;
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ /**
+ * Sets or retrieves a text alternative to the graphic.
+ */
+ alt: string;
+ /**
+ * Specifies whether autocomplete is applied to an editable text field.
+ */
+ autocomplete: string;
+ /**
+ * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
+ */
+ autofocus: boolean;
+ /**
+ * Sets or retrieves the width of the border to draw around the object.
+ */
+ border: string;
+ /**
+ * Sets or retrieves the state of the check box or radio button.
+ */
+ checked: boolean;
+ /**
+ * Retrieves whether the object is fully loaded.
+ */
+ complete: boolean;
+ /**
+ * Sets or retrieves the state of the check box or radio button.
+ */
+ defaultChecked: boolean;
+ /**
+ * Sets or retrieves the initial contents of the object.
+ */
+ defaultValue: string;
+ disabled: boolean;
+ /**
+ * Returns a FileList object on a file type input object.
+ */
+ files: FileList;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ form: HTMLFormElement;
+ /**
+ * Overrides the action attribute (where the data on a form is sent) on the parent form element.
+ */
+ formAction: string;
+ /**
+ * Used to override the encoding (formEnctype attribute) specified on the form element.
+ */
+ formEnctype: string;
+ /**
+ * Overrides the submit method attribute previously specified on a form element.
+ */
+ formMethod: string;
+ /**
+ * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option.
+ */
+ formNoValidate: string;
+ /**
+ * Overrides the target attribute on a form element.
+ */
+ formTarget: string;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: string;
+ /**
+ * Sets or retrieves the width of the border to draw around the object.
+ */
+ hspace: number;
+ indeterminate: boolean;
+ /**
+ * Specifies the ID of a pre-defined datalist of options for an input element.
+ */
+ list: HTMLElement;
+ /**
+ * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field.
+ */
+ max: string;
+ /**
+ * Sets or retrieves the maximum number of characters that the user can enter in a text control.
+ */
+ maxLength: number;
+ /**
+ * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field.
+ */
+ min: string;
+ /**
+ * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.
+ */
+ multiple: boolean;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ /**
+ * Gets or sets a string containing a regular expression that the user's input must match.
+ */
+ pattern: string;
+ /**
+ * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.
+ */
+ placeholder: string;
+ readOnly: boolean;
+ /**
+ * When present, marks an element that can't be submitted without a value.
+ */
+ required: boolean;
+ /**
+ * Gets or sets the end position or offset of a text selection.
+ */
+ selectionEnd: number;
+ /**
+ * Gets or sets the starting position or offset of a text selection.
+ */
+ selectionStart: number;
+ size: number;
+ /**
+ * The address or URL of the a media resource that is to be considered.
+ */
+ src: string;
+ status: boolean;
+ /**
+ * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field.
+ */
+ step: string;
+ /**
+ * Returns the content type of the object.
+ */
+ type: string;
+ /**
+ * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
+ */
+ useMap: string;
+ /**
+ * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
+ */
+ validationMessage: string;
+ /**
+ * Returns a ValidityState object that represents the validity states of an element.
+ */
+ validity: ValidityState;
+ /**
+ * Returns the value of the data at the cursor's current position.
+ */
+ value: string;
+ valueAsDate: Date;
+ /**
+ * Returns the input field value as a number.
+ */
+ valueAsNumber: number;
+ /**
+ * Sets or retrieves the vertical margin for the object.
+ */
+ vspace: number;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string;
+ /**
+ * Returns whether an element will successfully validate based on forms validation rules and constraints.
+ */
+ willValidate: boolean;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Creates a TextRange object for the element.
+ */
+ createTextRange(): TextRange;
+ /**
+ * Makes the selection equal to the current object.
+ */
+ select(): void;
+ /**
+ * Sets a custom error message that is displayed when a form is submitted.
+ * @param error Sets a custom error message that is displayed when a form is submitted.
+ */
+ setCustomValidity(error: string): void;
+ /**
+ * Sets the start and end positions of a selection in a text field.
+ * @param start The offset into the text field for the start of the selection.
+ * @param end The offset into the text field for the end of the selection.
+ */
+ setSelectionRange(start: number, end: number): void;
+ /**
+ * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value.
+ * @param n Value to decrement the value by.
+ */
+ stepDown(n?: number): void;
+ /**
+ * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value.
+ * @param n Value to increment the value by.
+ */
+ stepUp(n?: number): void;
+}
+
+declare var HTMLInputElement: {
+ prototype: HTMLInputElement;
+ new(): HTMLInputElement;
+}
+
+interface HTMLIsIndexElement extends HTMLElement {
+ /**
+ * Sets or retrieves the URL to which the form content is sent for processing.
+ */
+ action: string;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ form: HTMLFormElement;
+ prompt: string;
+}
+
+declare var HTMLIsIndexElement: {
+ prototype: HTMLIsIndexElement;
+ new(): HTMLIsIndexElement;
+}
+
+interface HTMLLIElement extends HTMLElement {
+ type: string;
+ /**
+ * Sets or retrieves the value of a list item.
+ */
+ value: number;
+}
+
+declare var HTMLLIElement: {
+ prototype: HTMLLIElement;
+ new(): HTMLLIElement;
+}
+
+interface HTMLLabelElement extends HTMLElement {
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ form: HTMLFormElement;
+ /**
+ * Sets or retrieves the object to which the given label object is assigned.
+ */
+ htmlFor: string;
+}
+
+declare var HTMLLabelElement: {
+ prototype: HTMLLabelElement;
+ new(): HTMLLabelElement;
+}
+
+interface HTMLLegendElement extends HTMLElement {
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ align: string;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ form: HTMLFormElement;
+}
+
+declare var HTMLLegendElement: {
+ prototype: HTMLLegendElement;
+ new(): HTMLLegendElement;
+}
+
+interface HTMLLinkElement extends HTMLElement, LinkStyle {
+ /**
+ * Sets or retrieves the character set used to encode the object.
+ */
+ charset: string;
+ disabled: boolean;
+ /**
+ * Sets or retrieves a destination URL or an anchor point.
+ */
+ href: string;
+ /**
+ * Sets or retrieves the language code of the object.
+ */
+ hreflang: string;
+ /**
+ * Sets or retrieves the media type.
+ */
+ media: string;
+ /**
+ * Sets or retrieves the relationship between the object and the destination of the link.
+ */
+ rel: string;
+ /**
+ * Sets or retrieves the relationship between the object and the destination of the link.
+ */
+ rev: string;
+ /**
+ * Sets or retrieves the window or frame at which to target content.
+ */
+ target: string;
+ /**
+ * Sets or retrieves the MIME type of the object.
+ */
+ type: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLLinkElement: {
+ prototype: HTMLLinkElement;
+ new(): HTMLLinkElement;
+}
+
+interface HTMLMapElement extends HTMLElement {
+ /**
+ * Retrieves a collection of the area objects defined for the given map object.
+ */
+ areas: HTMLAreasCollection;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+}
+
+declare var HTMLMapElement: {
+ prototype: HTMLMapElement;
+ new(): HTMLMapElement;
+}
+
+interface HTMLMarqueeElement extends HTMLElement {
+ behavior: string;
+ bgColor: any;
+ direction: string;
+ height: string;
+ hspace: number;
+ loop: number;
+ onbounce: (ev: Event) => any;
+ onfinish: (ev: Event) => any;
+ onstart: (ev: Event) => any;
+ scrollAmount: number;
+ scrollDelay: number;
+ trueSpeed: boolean;
+ vspace: number;
+ width: string;
+ start(): void;
+ stop(): void;
+ addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLMarqueeElement: {
+ prototype: HTMLMarqueeElement;
+ new(): HTMLMarqueeElement;
+}
+
+interface HTMLMediaElement extends HTMLElement {
+ /**
+ * Returns an AudioTrackList object with the audio tracks for a given video element.
+ */
+ audioTracks: AudioTrackList;
+ /**
+ * Gets or sets a value that indicates whether to start playing the media automatically.
+ */
+ autoplay: boolean;
+ /**
+ * Gets a collection of buffered time ranges.
+ */
+ buffered: TimeRanges;
+ /**
+ * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player).
+ */
+ controls: boolean;
+ /**
+ * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement.
+ */
+ currentSrc: string;
+ /**
+ * Gets or sets the current playback position, in seconds.
+ */
+ currentTime: number;
+ defaultMuted: boolean;
+ /**
+ * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource.
+ */
+ defaultPlaybackRate: number;
+ /**
+ * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming.
+ */
+ duration: number;
+ /**
+ * Gets information about whether the playback has ended or not.
+ */
+ ended: boolean;
+ /**
+ * Returns an object representing the current error state of the audio or video element.
+ */
+ error: MediaError;
+ /**
+ * Gets or sets a flag to specify whether playback should restart after it completes.
+ */
+ loop: boolean;
+ /**
+ * Specifies the purpose of the audio or video media, such as background audio or alerts.
+ */
+ msAudioCategory: string;
+ /**
+ * Specifies the output device id that the audio will be sent to.
+ */
+ msAudioDeviceType: string;
+ msGraphicsTrustStatus: MSGraphicsTrust;
+ /**
+ * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element.
+ */
+ msKeys: MSMediaKeys;
+ /**
+ * Gets or sets whether the DLNA PlayTo device is available.
+ */
+ msPlayToDisabled: boolean;
+ /**
+ * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.
+ */
+ msPlayToPreferredSourceUri: string;
+ /**
+ * Gets or sets the primary DLNA PlayTo device.
+ */
+ msPlayToPrimary: boolean;
+ /**
+ * Gets the source associated with the media element for use by the PlayToManager.
+ */
+ msPlayToSource: any;
+ /**
+ * Specifies whether or not to enable low-latency playback on the media element.
+ */
+ msRealTime: boolean;
+ /**
+ * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted.
+ */
+ muted: boolean;
+ /**
+ * Gets the current network activity for the element.
+ */
+ networkState: number;
+ onmsneedkey: (ev: MSMediaKeyNeededEvent) => any;
+ /**
+ * Gets a flag that specifies whether playback is paused.
+ */
+ paused: boolean;
+ /**
+ * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource.
+ */
+ playbackRate: number;
+ /**
+ * Gets TimeRanges for the current media resource that has been played.
+ */
+ played: TimeRanges;
+ /**
+ * Gets or sets the current playback position, in seconds.
+ */
+ preload: string;
+ readyState: number;
+ /**
+ * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked.
+ */
+ seekable: TimeRanges;
+ /**
+ * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource.
+ */
+ seeking: boolean;
+ /**
+ * The address or URL of the a media resource that is to be considered.
+ */
+ src: string;
+ textTracks: TextTrackList;
+ videoTracks: VideoTrackList;
+ /**
+ * Gets or sets the volume level for audio portions of the media element.
+ */
+ volume: number;
+ addTextTrack(kind: string, label?: string, language?: string): TextTrack;
+ /**
+ * Returns a string that specifies whether the client can play a given media resource type.
+ */
+ canPlayType(type: string): string;
+ /**
+ * Fires immediately after the client loads the object.
+ */
+ load(): void;
+ /**
+ * Clears all effects from the media pipeline.
+ */
+ msClearEffects(): void;
+ msGetAsCastingSource(): any;
+ /**
+ * Inserts the specified audio effect into media pipeline.
+ */
+ msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;
+ msSetMediaKeys(mediaKeys: MSMediaKeys): void;
+ /**
+ * Specifies the media protection manager for a given media pipeline.
+ */
+ msSetMediaProtectionManager(mediaProtectionManager?: any): void;
+ /**
+ * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not.
+ */
+ pause(): void;
+ /**
+ * Loads and starts playback of a media resource.
+ */
+ play(): void;
+ HAVE_CURRENT_DATA: number;
+ HAVE_ENOUGH_DATA: number;
+ HAVE_FUTURE_DATA: number;
+ HAVE_METADATA: number;
+ HAVE_NOTHING: number;
+ NETWORK_EMPTY: number;
+ NETWORK_IDLE: number;
+ NETWORK_LOADING: number;
+ NETWORK_NO_SOURCE: number;
+ addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLMediaElement: {
+ prototype: HTMLMediaElement;
+ new(): HTMLMediaElement;
+ HAVE_CURRENT_DATA: number;
+ HAVE_ENOUGH_DATA: number;
+ HAVE_FUTURE_DATA: number;
+ HAVE_METADATA: number;
+ HAVE_NOTHING: number;
+ NETWORK_EMPTY: number;
+ NETWORK_IDLE: number;
+ NETWORK_LOADING: number;
+ NETWORK_NO_SOURCE: number;
+}
+
+interface HTMLMenuElement extends HTMLElement {
+ compact: boolean;
+ type: string;
+}
+
+declare var HTMLMenuElement: {
+ prototype: HTMLMenuElement;
+ new(): HTMLMenuElement;
+}
+
+interface HTMLMetaElement extends HTMLElement {
+ /**
+ * Sets or retrieves the character set used to encode the object.
+ */
+ charset: string;
+ /**
+ * Gets or sets meta-information to associate with httpEquiv or name.
+ */
+ content: string;
+ /**
+ * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header.
+ */
+ httpEquiv: string;
+ /**
+ * Sets or retrieves the value specified in the content attribute of the meta object.
+ */
+ name: string;
+ /**
+ * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object.
+ */
+ scheme: string;
+ /**
+ * Sets or retrieves the URL property that will be loaded after the specified time has elapsed.
+ */
+ url: string;
+}
+
+declare var HTMLMetaElement: {
+ prototype: HTMLMetaElement;
+ new(): HTMLMetaElement;
+}
+
+interface HTMLModElement extends HTMLElement {
+ /**
+ * Sets or retrieves reference information about the object.
+ */
+ cite: string;
+ /**
+ * Sets or retrieves the date and time of a modification to the object.
+ */
+ dateTime: string;
+}
+
+declare var HTMLModElement: {
+ prototype: HTMLModElement;
+ new(): HTMLModElement;
+}
+
+interface HTMLNextIdElement extends HTMLElement {
+ n: string;
+}
+
+declare var HTMLNextIdElement: {
+ prototype: HTMLNextIdElement;
+ new(): HTMLNextIdElement;
+}
+
+interface HTMLOListElement extends HTMLElement {
+ compact: boolean;
+ /**
+ * The starting number.
+ */
+ start: number;
+ type: string;
+}
+
+declare var HTMLOListElement: {
+ prototype: HTMLOListElement;
+ new(): HTMLOListElement;
+}
+
+interface HTMLObjectElement extends HTMLElement, GetSVGDocument {
+ /**
+ * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element.
+ */
+ BaseHref: string;
+ align: string;
+ /**
+ * Sets or retrieves a text alternative to the graphic.
+ */
+ alt: string;
+ /**
+ * Gets or sets the optional alternative HTML script to execute if the object fails to load.
+ */
+ altHtml: string;
+ /**
+ * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.
+ */
+ archive: string;
+ border: string;
+ /**
+ * Sets or retrieves the URL of the file containing the compiled Java class.
+ */
+ code: string;
+ /**
+ * Sets or retrieves the URL of the component.
+ */
+ codeBase: string;
+ /**
+ * Sets or retrieves the Internet media type for the code associated with the object.
+ */
+ codeType: string;
+ /**
+ * Retrieves the document object of the page or frame.
+ */
+ contentDocument: Document;
+ /**
+ * Sets or retrieves the URL that references the data of the object.
+ */
+ data: string;
+ declare: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ form: HTMLFormElement;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: string;
+ hspace: number;
+ /**
+ * Gets or sets whether the DLNA PlayTo device is available.
+ */
+ msPlayToDisabled: boolean;
+ /**
+ * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.
+ */
+ msPlayToPreferredSourceUri: string;
+ /**
+ * Gets or sets the primary DLNA PlayTo device.
+ */
+ msPlayToPrimary: boolean;
+ /**
+ * Gets the source associated with the media element for use by the PlayToManager.
+ */
+ msPlayToSource: any;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ /**
+ * Retrieves the contained object.
+ */
+ object: any;
+ readyState: number;
+ /**
+ * Sets or retrieves a message to be displayed while an object is loading.
+ */
+ standby: string;
+ /**
+ * Sets or retrieves the MIME type of the object.
+ */
+ type: string;
+ /**
+ * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.
+ */
+ useMap: string;
+ /**
+ * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
+ */
+ validationMessage: string;
+ /**
+ * Returns a ValidityState object that represents the validity states of an element.
+ */
+ validity: ValidityState;
+ vspace: number;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string;
+ /**
+ * Returns whether an element will successfully validate based on forms validation rules and constraints.
+ */
+ willValidate: boolean;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Sets a custom error message that is displayed when a form is submitted.
+ * @param error Sets a custom error message that is displayed when a form is submitted.
+ */
+ setCustomValidity(error: string): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLObjectElement: {
+ prototype: HTMLObjectElement;
+ new(): HTMLObjectElement;
+}
+
+interface HTMLOptGroupElement extends HTMLElement {
+ /**
+ * Sets or retrieves the status of an option.
+ */
+ defaultSelected: boolean;
+ disabled: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ form: HTMLFormElement;
+ /**
+ * Sets or retrieves the ordinal position of an option in a list box.
+ */
+ index: number;
+ /**
+ * Sets or retrieves a value that you can use to implement your own label functionality for the object.
+ */
+ label: string;
+ /**
+ * Sets or retrieves whether the option in the list box is the default item.
+ */
+ selected: boolean;
+ /**
+ * Sets or retrieves the text string specified by the option tag.
+ */
+ text: string;
+ /**
+ * Sets or retrieves the value which is returned to the server when the form control is submitted.
+ */
+ value: string;
+}
+
+declare var HTMLOptGroupElement: {
+ prototype: HTMLOptGroupElement;
+ new(): HTMLOptGroupElement;
+}
+
+interface HTMLOptionElement extends HTMLElement {
+ /**
+ * Sets or retrieves the status of an option.
+ */
+ defaultSelected: boolean;
+ disabled: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ form: HTMLFormElement;
+ /**
+ * Sets or retrieves the ordinal position of an option in a list box.
+ */
+ index: number;
+ /**
+ * Sets or retrieves a value that you can use to implement your own label functionality for the object.
+ */
+ label: string;
+ /**
+ * Sets or retrieves whether the option in the list box is the default item.
+ */
+ selected: boolean;
+ /**
+ * Sets or retrieves the text string specified by the option tag.
+ */
+ text: string;
+ /**
+ * Sets or retrieves the value which is returned to the server when the form control is submitted.
+ */
+ value: string;
+}
+
+declare var HTMLOptionElement: {
+ prototype: HTMLOptionElement;
+ new(): HTMLOptionElement;
+ create(): HTMLOptionElement;
+}
+
+interface HTMLParagraphElement extends HTMLElement {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ clear: string;
+}
+
+declare var HTMLParagraphElement: {
+ prototype: HTMLParagraphElement;
+ new(): HTMLParagraphElement;
+}
+
+interface HTMLParamElement extends HTMLElement {
+ /**
+ * Sets or retrieves the name of an input parameter for an element.
+ */
+ name: string;
+ /**
+ * Sets or retrieves the content type of the resource designated by the value attribute.
+ */
+ type: string;
+ /**
+ * Sets or retrieves the value of an input parameter for an element.
+ */
+ value: string;
+ /**
+ * Sets or retrieves the data type of the value attribute.
+ */
+ valueType: string;
+}
+
+declare var HTMLParamElement: {
+ prototype: HTMLParamElement;
+ new(): HTMLParamElement;
+}
+
+interface HTMLPhraseElement extends HTMLElement {
+ /**
+ * Sets or retrieves reference information about the object.
+ */
+ cite: string;
+ /**
+ * Sets or retrieves the date and time of a modification to the object.
+ */
+ dateTime: string;
+}
+
+declare var HTMLPhraseElement: {
+ prototype: HTMLPhraseElement;
+ new(): HTMLPhraseElement;
+}
+
+interface HTMLPreElement extends HTMLElement {
+ /**
+ * Indicates a citation by rendering text in italic type.
+ */
+ cite: string;
+ clear: string;
+ /**
+ * Sets or gets a value that you can use to implement your own width functionality for the object.
+ */
+ width: number;
+}
+
+declare var HTMLPreElement: {
+ prototype: HTMLPreElement;
+ new(): HTMLPreElement;
+}
+
+interface HTMLProgressElement extends HTMLElement {
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ form: HTMLFormElement;
+ /**
+ * Defines the maximum, or "done" value for a progress element.
+ */
+ max: number;
+ /**
+ * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar).
+ */
+ position: number;
+ /**
+ * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value.
+ */
+ value: number;
+}
+
+declare var HTMLProgressElement: {
+ prototype: HTMLProgressElement;
+ new(): HTMLProgressElement;
+}
+
+interface HTMLQuoteElement extends HTMLElement {
+ /**
+ * Sets or retrieves reference information about the object.
+ */
+ cite: string;
+ /**
+ * Sets or retrieves the date and time of a modification to the object.
+ */
+ dateTime: string;
+}
+
+declare var HTMLQuoteElement: {
+ prototype: HTMLQuoteElement;
+ new(): HTMLQuoteElement;
+}
+
+interface HTMLScriptElement extends HTMLElement {
+ async: boolean;
+ /**
+ * Sets or retrieves the character set used to encode the object.
+ */
+ charset: string;
+ /**
+ * Sets or retrieves the status of the script.
+ */
+ defer: boolean;
+ /**
+ * Sets or retrieves the event for which the script is written.
+ */
+ event: string;
+ /**
+ * Sets or retrieves the object that is bound to the event script.
+ */
+ htmlFor: string;
+ /**
+ * Retrieves the URL to an external file that contains the source code or data.
+ */
+ src: string;
+ /**
+ * Retrieves or sets the text of the object as a string.
+ */
+ text: string;
+ /**
+ * Sets or retrieves the MIME type for the associated scripting engine.
+ */
+ type: string;
+}
+
+declare var HTMLScriptElement: {
+ prototype: HTMLScriptElement;
+ new(): HTMLScriptElement;
+}
+
+interface HTMLSelectElement extends HTMLElement {
+ /**
+ * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
+ */
+ autofocus: boolean;
+ disabled: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ form: HTMLFormElement;
+ /**
+ * Sets or retrieves the number of objects in a collection.
+ */
+ length: number;
+ /**
+ * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.
+ */
+ multiple: boolean;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ options: HTMLCollection;
+ /**
+ * When present, marks an element that can't be submitted without a value.
+ */
+ required: boolean;
+ /**
+ * Sets or retrieves the index of the selected option in a select object.
+ */
+ selectedIndex: number;
+ /**
+ * Sets or retrieves the number of rows in the list box.
+ */
+ size: number;
+ /**
+ * Retrieves the type of select control based on the value of the MULTIPLE attribute.
+ */
+ type: string;
+ /**
+ * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
+ */
+ validationMessage: string;
+ /**
+ * Returns a ValidityState object that represents the validity states of an element.
+ */
+ validity: ValidityState;
+ /**
+ * Sets or retrieves the value which is returned to the server when the form control is submitted.
+ */
+ value: string;
+ /**
+ * Returns whether an element will successfully validate based on forms validation rules and constraints.
+ */
+ willValidate: boolean;
+ selectedOptions: HTMLCollection;
+ /**
+ * Adds an element to the areas, controlRange, or options collection.
+ * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.
+ * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.
+ */
+ add(element: HTMLElement, before?: HTMLElement | number): void;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Retrieves a select object or an object from an options collection.
+ * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.
+ * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.
+ */
+ item(name?: any, index?: any): any;
+ /**
+ * Retrieves a select object or an object from an options collection.
+ * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made.
+ */
+ namedItem(name: string): any;
+ /**
+ * Removes an element from the collection.
+ * @param index Number that specifies the zero-based index of the element to remove from the collection.
+ */
+ remove(index?: number): void;
+ /**
+ * Sets a custom error message that is displayed when a form is submitted.
+ * @param error Sets a custom error message that is displayed when a form is submitted.
+ */
+ setCustomValidity(error: string): void;
+ [name: string]: any;
+}
+
+declare var HTMLSelectElement: {
+ prototype: HTMLSelectElement;
+ new(): HTMLSelectElement;
+}
+
+interface HTMLSourceElement extends HTMLElement {
+ /**
+ * Gets or sets the intended media type of the media source.
+ */
+ media: string;
+ msKeySystem: string;
+ /**
+ * The address or URL of the a media resource that is to be considered.
+ */
+ src: string;
+ /**
+ * Gets or sets the MIME type of a media resource.
+ */
+ type: string;
+}
+
+declare var HTMLSourceElement: {
+ prototype: HTMLSourceElement;
+ new(): HTMLSourceElement;
+}
+
+interface HTMLSpanElement extends HTMLElement {
+}
+
+declare var HTMLSpanElement: {
+ prototype: HTMLSpanElement;
+ new(): HTMLSpanElement;
+}
+
+interface HTMLStyleElement extends HTMLElement, LinkStyle {
+ /**
+ * Sets or retrieves the media type.
+ */
+ media: string;
+ /**
+ * Retrieves the CSS language in which the style sheet is written.
+ */
+ type: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLStyleElement: {
+ prototype: HTMLStyleElement;
+ new(): HTMLStyleElement;
+}
+
+interface HTMLTableCaptionElement extends HTMLElement {
+ /**
+ * Sets or retrieves the alignment of the caption or legend.
+ */
+ align: string;
+ /**
+ * Sets or retrieves whether the caption appears at the top or bottom of the table.
+ */
+ vAlign: string;
+}
+
+declare var HTMLTableCaptionElement: {
+ prototype: HTMLTableCaptionElement;
+ new(): HTMLTableCaptionElement;
+}
+
+interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment {
+ /**
+ * Sets or retrieves abbreviated text for the object.
+ */
+ abbr: string;
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ /**
+ * Sets or retrieves a comma-delimited list of conceptual categories associated with the object.
+ */
+ axis: string;
+ bgColor: any;
+ /**
+ * Retrieves the position of the object in the cells collection of a row.
+ */
+ cellIndex: number;
+ /**
+ * Sets or retrieves the number columns in the table that the object should span.
+ */
+ colSpan: number;
+ /**
+ * Sets or retrieves a list of header cells that provide information for the object.
+ */
+ headers: string;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: any;
+ /**
+ * Sets or retrieves whether the browser automatically performs wordwrap.
+ */
+ noWrap: boolean;
+ /**
+ * Sets or retrieves how many rows in a table the cell should span.
+ */
+ rowSpan: number;
+ /**
+ * Sets or retrieves the group of cells in a table to which the object's information applies.
+ */
+ scope: string;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLTableCellElement: {
+ prototype: HTMLTableCellElement;
+ new(): HTMLTableCellElement;
+}
+
+interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment {
+ /**
+ * Sets or retrieves the alignment of the object relative to the display or table.
+ */
+ align: string;
+ /**
+ * Sets or retrieves the number of columns in the group.
+ */
+ span: number;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: any;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLTableColElement: {
+ prototype: HTMLTableColElement;
+ new(): HTMLTableColElement;
+}
+
+interface HTMLTableDataCellElement extends HTMLTableCellElement {
+}
+
+declare var HTMLTableDataCellElement: {
+ prototype: HTMLTableDataCellElement;
+ new(): HTMLTableDataCellElement;
+}
+
+interface HTMLTableElement extends HTMLElement {
+ /**
+ * Sets or retrieves a value that indicates the table alignment.
+ */
+ align: string;
+ bgColor: any;
+ /**
+ * Sets or retrieves the width of the border to draw around the object.
+ */
+ border: string;
+ /**
+ * Sets or retrieves the border color of the object.
+ */
+ borderColor: any;
+ /**
+ * Retrieves the caption object of a table.
+ */
+ caption: HTMLTableCaptionElement;
+ /**
+ * Sets or retrieves the amount of space between the border of the cell and the content of the cell.
+ */
+ cellPadding: string;
+ /**
+ * Sets or retrieves the amount of space between cells in a table.
+ */
+ cellSpacing: string;
+ /**
+ * Sets or retrieves the number of columns in the table.
+ */
+ cols: number;
+ /**
+ * Sets or retrieves the way the border frame around the table is displayed.
+ */
+ frame: string;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: any;
+ /**
+ * Sets or retrieves the number of horizontal rows contained in the object.
+ */
+ rows: HTMLCollection;
+ /**
+ * Sets or retrieves which dividing lines (inner borders) are displayed.
+ */
+ rules: string;
+ /**
+ * Sets or retrieves a description and/or structure of the object.
+ */
+ summary: string;
+ /**
+ * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order.
+ */
+ tBodies: HTMLCollection;
+ /**
+ * Retrieves the tFoot object of the table.
+ */
+ tFoot: HTMLTableSectionElement;
+ /**
+ * Retrieves the tHead object of the table.
+ */
+ tHead: HTMLTableSectionElement;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ width: string;
+ /**
+ * Creates an empty caption element in the table.
+ */
+ createCaption(): HTMLTableCaptionElement;
+ /**
+ * Creates an empty tBody element in the table.
+ */
+ createTBody(): HTMLTableSectionElement;
+ /**
+ * Creates an empty tFoot element in the table.
+ */
+ createTFoot(): HTMLTableSectionElement;
+ /**
+ * Returns the tHead element object if successful, or null otherwise.
+ */
+ createTHead(): HTMLTableSectionElement;
+ /**
+ * Deletes the caption element and its contents from the table.
+ */
+ deleteCaption(): void;
+ /**
+ * Removes the specified row (tr) from the element and from the rows collection.
+ * @param index Number that specifies the zero-based position in the rows collection of the row to remove.
+ */
+ deleteRow(index?: number): void;
+ /**
+ * Deletes the tFoot element and its contents from the table.
+ */
+ deleteTFoot(): void;
+ /**
+ * Deletes the tHead element and its contents from the table.
+ */
+ deleteTHead(): void;
+ /**
+ * Creates a new row (tr) in the table, and adds the row to the rows collection.
+ * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.
+ */
+ insertRow(index?: number): HTMLTableRowElement;
+}
+
+declare var HTMLTableElement: {
+ prototype: HTMLTableElement;
+ new(): HTMLTableElement;
+}
+
+interface HTMLTableHeaderCellElement extends HTMLTableCellElement {
+ /**
+ * Sets or retrieves the group of cells in a table to which the object's information applies.
+ */
+ scope: string;
+}
+
+declare var HTMLTableHeaderCellElement: {
+ prototype: HTMLTableHeaderCellElement;
+ new(): HTMLTableHeaderCellElement;
+}
+
+interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment {
+ /**
+ * Sets or retrieves how the object is aligned with adjacent text.
+ */
+ align: string;
+ bgColor: any;
+ /**
+ * Retrieves a collection of all cells in the table row.
+ */
+ cells: HTMLCollection;
+ /**
+ * Sets or retrieves the height of the object.
+ */
+ height: any;
+ /**
+ * Retrieves the position of the object in the rows collection for the table.
+ */
+ rowIndex: number;
+ /**
+ * Retrieves the position of the object in the collection.
+ */
+ sectionRowIndex: number;
+ /**
+ * Removes the specified cell from the table row, as well as from the cells collection.
+ * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted.
+ */
+ deleteCell(index?: number): void;
+ /**
+ * Creates a new cell in the table row, and adds the cell to the cells collection.
+ * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection.
+ */
+ insertCell(index?: number): HTMLTableCellElement;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLTableRowElement: {
+ prototype: HTMLTableRowElement;
+ new(): HTMLTableRowElement;
+}
+
+interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment {
+ /**
+ * Sets or retrieves a value that indicates the table alignment.
+ */
+ align: string;
+ /**
+ * Sets or retrieves the number of horizontal rows contained in the object.
+ */
+ rows: HTMLCollection;
+ /**
+ * Removes the specified row (tr) from the element and from the rows collection.
+ * @param index Number that specifies the zero-based position in the rows collection of the row to remove.
+ */
+ deleteRow(index?: number): void;
+ /**
+ * Creates a new row (tr) in the table, and adds the row to the rows collection.
+ * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.
+ */
+ insertRow(index?: number): HTMLTableRowElement;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLTableSectionElement: {
+ prototype: HTMLTableSectionElement;
+ new(): HTMLTableSectionElement;
+}
+
+interface HTMLTextAreaElement extends HTMLElement {
+ /**
+ * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.
+ */
+ autofocus: boolean;
+ /**
+ * Sets or retrieves the width of the object.
+ */
+ cols: number;
+ /**
+ * Sets or retrieves the initial contents of the object.
+ */
+ defaultValue: string;
+ disabled: boolean;
+ /**
+ * Retrieves a reference to the form that the object is embedded in.
+ */
+ form: HTMLFormElement;
+ /**
+ * Sets or retrieves the maximum number of characters that the user can enter in a text control.
+ */
+ maxLength: number;
+ /**
+ * Sets or retrieves the name of the object.
+ */
+ name: string;
+ /**
+ * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.
+ */
+ placeholder: string;
+ /**
+ * Sets or retrieves the value indicated whether the content of the object is read-only.
+ */
+ readOnly: boolean;
+ /**
+ * When present, marks an element that can't be submitted without a value.
+ */
+ required: boolean;
+ /**
+ * Sets or retrieves the number of horizontal rows contained in the object.
+ */
+ rows: number;
+ /**
+ * Gets or sets the end position or offset of a text selection.
+ */
+ selectionEnd: number;
+ /**
+ * Gets or sets the starting position or offset of a text selection.
+ */
+ selectionStart: number;
+ /**
+ * Sets or retrieves the value indicating whether the control is selected.
+ */
+ status: any;
+ /**
+ * Retrieves the type of control.
+ */
+ type: string;
+ /**
+ * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.
+ */
+ validationMessage: string;
+ /**
+ * Returns a ValidityState object that represents the validity states of an element.
+ */
+ validity: ValidityState;
+ /**
+ * Retrieves or sets the text in the entry field of the textArea element.
+ */
+ value: string;
+ /**
+ * Returns whether an element will successfully validate based on forms validation rules and constraints.
+ */
+ willValidate: boolean;
+ /**
+ * Sets or retrieves how to handle wordwrapping in the object.
+ */
+ wrap: string;
+ /**
+ * Returns whether a form will validate when it is submitted, without having to submit it.
+ */
+ checkValidity(): boolean;
+ /**
+ * Creates a TextRange object for the element.
+ */
+ createTextRange(): TextRange;
+ /**
+ * Highlights the input area of a form element.
+ */
+ select(): void;
+ /**
+ * Sets a custom error message that is displayed when a form is submitted.
+ * @param error Sets a custom error message that is displayed when a form is submitted.
+ */
+ setCustomValidity(error: string): void;
+ /**
+ * Sets the start and end positions of a selection in a text field.
+ * @param start The offset into the text field for the start of the selection.
+ * @param end The offset into the text field for the end of the selection.
+ */
+ setSelectionRange(start: number, end: number): void;
+}
+
+declare var HTMLTextAreaElement: {
+ prototype: HTMLTextAreaElement;
+ new(): HTMLTextAreaElement;
+}
+
+interface HTMLTitleElement extends HTMLElement {
+ /**
+ * Retrieves or sets the text of the object as a string.
+ */
+ text: string;
+}
+
+declare var HTMLTitleElement: {
+ prototype: HTMLTitleElement;
+ new(): HTMLTitleElement;
+}
+
+interface HTMLTrackElement extends HTMLElement {
+ default: boolean;
+ kind: string;
+ label: string;
+ readyState: number;
+ src: string;
+ srclang: string;
+ track: TextTrack;
+ ERROR: number;
+ LOADED: number;
+ LOADING: number;
+ NONE: number;
+}
+
+declare var HTMLTrackElement: {
+ prototype: HTMLTrackElement;
+ new(): HTMLTrackElement;
+ ERROR: number;
+ LOADED: number;
+ LOADING: number;
+ NONE: number;
+}
+
+interface HTMLUListElement extends HTMLElement {
+ compact: boolean;
+ type: string;
+}
+
+declare var HTMLUListElement: {
+ prototype: HTMLUListElement;
+ new(): HTMLUListElement;
+}
+
+interface HTMLUnknownElement extends HTMLElement {
+}
+
+declare var HTMLUnknownElement: {
+ prototype: HTMLUnknownElement;
+ new(): HTMLUnknownElement;
+}
+
+interface HTMLVideoElement extends HTMLMediaElement {
+ /**
+ * Gets or sets the height of the video element.
+ */
+ height: number;
+ msHorizontalMirror: boolean;
+ msIsLayoutOptimalForPlayback: boolean;
+ msIsStereo3D: boolean;
+ msStereo3DPackingMode: string;
+ msStereo3DRenderMode: string;
+ msZoom: boolean;
+ onMSVideoFormatChanged: (ev: Event) => any;
+ onMSVideoFrameStepCompleted: (ev: Event) => any;
+ onMSVideoOptimalLayoutChanged: (ev: Event) => any;
+ /**
+ * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available.
+ */
+ poster: string;
+ /**
+ * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known.
+ */
+ videoHeight: number;
+ /**
+ * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known.
+ */
+ videoWidth: number;
+ webkitDisplayingFullscreen: boolean;
+ webkitSupportsFullscreen: boolean;
+ /**
+ * Gets or sets the width of the video element.
+ */
+ width: number;
+ getVideoPlaybackQuality(): VideoPlaybackQuality;
+ msFrameStep(forward: boolean): void;
+ msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;
+ msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void;
+ webkitEnterFullScreen(): void;
+ webkitEnterFullscreen(): void;
+ webkitExitFullScreen(): void;
+ webkitExitFullscreen(): void;
+ addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSVideoFormatChanged", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var HTMLVideoElement: {
+ prototype: HTMLVideoElement;
+ new(): HTMLVideoElement;
+}
+
+interface HashChangeEvent extends Event {
+ newURL: string;
+ oldURL: string;
+}
+
+declare var HashChangeEvent: {
+ prototype: HashChangeEvent;
+ new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent;
+}
+
+interface History {
+ length: number;
+ state: any;
+ back(distance?: any): void;
+ forward(distance?: any): void;
+ go(delta?: any): void;
+ pushState(statedata: any, title?: string, url?: string): void;
+ replaceState(statedata: any, title?: string, url?: string): void;
+}
+
+declare var History: {
+ prototype: History;
+ new(): History;
+}
+
+interface IDBCursor {
+ direction: string;
+ key: any;
+ primaryKey: any;
+ source: any;
+ advance(count: number): void;
+ continue(key?: any): void;
+ delete(): IDBRequest;
+ update(value: any): IDBRequest;
+ NEXT: string;
+ NEXT_NO_DUPLICATE: string;
+ PREV: string;
+ PREV_NO_DUPLICATE: string;
+}
+
+declare var IDBCursor: {
+ prototype: IDBCursor;
+ new(): IDBCursor;
+ NEXT: string;
+ NEXT_NO_DUPLICATE: string;
+ PREV: string;
+ PREV_NO_DUPLICATE: string;
+}
+
+interface IDBCursorWithValue extends IDBCursor {
+ value: any;
+}
+
+declare var IDBCursorWithValue: {
+ prototype: IDBCursorWithValue;
+ new(): IDBCursorWithValue;
+}
+
+interface IDBDatabase extends EventTarget {
+ name: string;
+ objectStoreNames: DOMStringList;
+ onabort: (ev: Event) => any;
+ onerror: (ev: Event) => any;
+ version: string;
+ close(): void;
+ createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;
+ deleteObjectStore(name: string): void;
+ transaction(storeNames: any, mode?: string): IDBTransaction;
+ addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var IDBDatabase: {
+ prototype: IDBDatabase;
+ new(): IDBDatabase;
+}
+
+interface IDBFactory {
+ cmp(first: any, second: any): number;
+ deleteDatabase(name: string): IDBOpenDBRequest;
+ open(name: string, version?: number): IDBOpenDBRequest;
+}
+
+declare var IDBFactory: {
+ prototype: IDBFactory;
+ new(): IDBFactory;
+}
+
+interface IDBIndex {
+ keyPath: string | string[];
+ name: string;
+ objectStore: IDBObjectStore;
+ unique: boolean;
+ multiEntry: boolean;
+ count(key?: any): IDBRequest;
+ get(key: any): IDBRequest;
+ getKey(key: any): IDBRequest;
+ openCursor(range?: IDBKeyRange, direction?: string): IDBRequest;
+ openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest;
+}
+
+declare var IDBIndex: {
+ prototype: IDBIndex;
+ new(): IDBIndex;
+}
+
+interface IDBKeyRange {
+ lower: any;
+ lowerOpen: boolean;
+ upper: any;
+ upperOpen: boolean;
+}
+
+declare var IDBKeyRange: {
+ prototype: IDBKeyRange;
+ new(): IDBKeyRange;
+ bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;
+ lowerBound(bound: any, open?: boolean): IDBKeyRange;
+ only(value: any): IDBKeyRange;
+ upperBound(bound: any, open?: boolean): IDBKeyRange;
+}
+
+interface IDBObjectStore {
+ indexNames: DOMStringList;
+ keyPath: string;
+ name: string;
+ transaction: IDBTransaction;
+ add(value: any, key?: any): IDBRequest;
+ clear(): IDBRequest;
+ count(key?: any): IDBRequest;
+ createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex;
+ delete(key: any): IDBRequest;
+ deleteIndex(indexName: string): void;
+ get(key: any): IDBRequest;
+ index(name: string): IDBIndex;
+ openCursor(range?: any, direction?: string): IDBRequest;
+ put(value: any, key?: any): IDBRequest;
+}
+
+declare var IDBObjectStore: {
+ prototype: IDBObjectStore;
+ new(): IDBObjectStore;
+}
+
+interface IDBOpenDBRequest extends IDBRequest {
+ onblocked: (ev: Event) => any;
+ onupgradeneeded: (ev: IDBVersionChangeEvent) => any;
+ addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var IDBOpenDBRequest: {
+ prototype: IDBOpenDBRequest;
+ new(): IDBOpenDBRequest;
+}
+
+interface IDBRequest extends EventTarget {
+ error: DOMError;
+ onerror: (ev: Event) => any;
+ onsuccess: (ev: Event) => any;
+ readyState: string;
+ result: any;
+ source: any;
+ transaction: IDBTransaction;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var IDBRequest: {
+ prototype: IDBRequest;
+ new(): IDBRequest;
+}
+
+interface IDBTransaction extends EventTarget {
+ db: IDBDatabase;
+ error: DOMError;
+ mode: string;
+ onabort: (ev: Event) => any;
+ oncomplete: (ev: Event) => any;
+ onerror: (ev: Event) => any;
+ abort(): void;
+ objectStore(name: string): IDBObjectStore;
+ READ_ONLY: string;
+ READ_WRITE: string;
+ VERSION_CHANGE: string;
+ addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var IDBTransaction: {
+ prototype: IDBTransaction;
+ new(): IDBTransaction;
+ READ_ONLY: string;
+ READ_WRITE: string;
+ VERSION_CHANGE: string;
+}
+
+interface IDBVersionChangeEvent extends Event {
+ newVersion: number;
+ oldVersion: number;
+}
+
+declare var IDBVersionChangeEvent: {
+ prototype: IDBVersionChangeEvent;
+ new(): IDBVersionChangeEvent;
+}
+
+interface ImageData {
+ data: Uint8ClampedArray;
+ height: number;
+ width: number;
+}
+
+declare var ImageData: {
+ prototype: ImageData;
+ new(width: number, height: number): ImageData;
+ new(array: Uint8ClampedArray, width: number, height: number): ImageData;
+}
+
+interface KeyboardEvent extends UIEvent {
+ altKey: boolean;
+ char: string;
+ charCode: number;
+ ctrlKey: boolean;
+ key: string;
+ keyCode: number;
+ locale: string;
+ location: number;
+ metaKey: boolean;
+ repeat: boolean;
+ shiftKey: boolean;
+ which: number;
+ getModifierState(keyArg: string): boolean;
+ initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void;
+ DOM_KEY_LOCATION_JOYSTICK: number;
+ DOM_KEY_LOCATION_LEFT: number;
+ DOM_KEY_LOCATION_MOBILE: number;
+ DOM_KEY_LOCATION_NUMPAD: number;
+ DOM_KEY_LOCATION_RIGHT: number;
+ DOM_KEY_LOCATION_STANDARD: number;
+}
+
+declare var KeyboardEvent: {
+ prototype: KeyboardEvent;
+ new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent;
+ DOM_KEY_LOCATION_JOYSTICK: number;
+ DOM_KEY_LOCATION_LEFT: number;
+ DOM_KEY_LOCATION_MOBILE: number;
+ DOM_KEY_LOCATION_NUMPAD: number;
+ DOM_KEY_LOCATION_RIGHT: number;
+ DOM_KEY_LOCATION_STANDARD: number;
+}
+
+interface Location {
+ hash: string;
+ host: string;
+ hostname: string;
+ href: string;
+ origin: string;
+ pathname: string;
+ port: string;
+ protocol: string;
+ search: string;
+ assign(url: string): void;
+ reload(forcedReload?: boolean): void;
+ replace(url: string): void;
+ toString(): string;
+}
+
+declare var Location: {
+ prototype: Location;
+ new(): Location;
+}
+
+interface LongRunningScriptDetectedEvent extends Event {
+ executionTime: number;
+ stopPageScriptExecution: boolean;
+}
+
+declare var LongRunningScriptDetectedEvent: {
+ prototype: LongRunningScriptDetectedEvent;
+ new(): LongRunningScriptDetectedEvent;
+}
+
+interface MSApp {
+ clearTemporaryWebDataAsync(): MSAppAsyncOperation;
+ createBlobFromRandomAccessStream(type: string, seeker: any): Blob;
+ createDataPackage(object: any): any;
+ createDataPackageFromSelection(): any;
+ createFileFromStorageFile(storageFile: any): File;
+ createStreamFromInputStream(type: string, inputStream: any): MSStream;
+ execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void;
+ execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any;
+ getCurrentPriority(): string;
+ getHtmlPrintDocumentSourceAsync(htmlDoc: any): any;
+ getViewId(view: any): any;
+ isTaskScheduledAtPriorityOrHigher(priority: string): boolean;
+ pageHandlesAllApplicationActivations(enabled: boolean): void;
+ suppressSubdownloadCredentialPrompts(suppress: boolean): void;
+ terminateApp(exceptionObject: any): void;
+ CURRENT: string;
+ HIGH: string;
+ IDLE: string;
+ NORMAL: string;
+}
+declare var MSApp: MSApp;
+
+interface MSAppAsyncOperation extends EventTarget {
+ error: DOMError;
+ oncomplete: (ev: Event) => any;
+ onerror: (ev: Event) => any;
+ readyState: number;
+ result: any;
+ start(): void;
+ COMPLETED: number;
+ ERROR: number;
+ STARTED: number;
+ addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MSAppAsyncOperation: {
+ prototype: MSAppAsyncOperation;
+ new(): MSAppAsyncOperation;
+ COMPLETED: number;
+ ERROR: number;
+ STARTED: number;
+}
+
+interface MSBlobBuilder {
+ append(data: any, endings?: string): void;
+ getBlob(contentType?: string): Blob;
+}
+
+declare var MSBlobBuilder: {
+ prototype: MSBlobBuilder;
+ new(): MSBlobBuilder;
+}
+
+interface MSCSSMatrix {
+ a: number;
+ b: number;
+ c: number;
+ d: number;
+ e: number;
+ f: number;
+ m11: number;
+ m12: number;
+ m13: number;
+ m14: number;
+ m21: number;
+ m22: number;
+ m23: number;
+ m24: number;
+ m31: number;
+ m32: number;
+ m33: number;
+ m34: number;
+ m41: number;
+ m42: number;
+ m43: number;
+ m44: number;
+ inverse(): MSCSSMatrix;
+ multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix;
+ rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix;
+ rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix;
+ scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix;
+ setMatrixValue(value: string): void;
+ skewX(angle: number): MSCSSMatrix;
+ skewY(angle: number): MSCSSMatrix;
+ toString(): string;
+ translate(x: number, y: number, z?: number): MSCSSMatrix;
+}
+
+declare var MSCSSMatrix: {
+ prototype: MSCSSMatrix;
+ new(text?: string): MSCSSMatrix;
+}
+
+interface MSGesture {
+ target: Element;
+ addPointer(pointerId: number): void;
+ stop(): void;
+}
+
+declare var MSGesture: {
+ prototype: MSGesture;
+ new(): MSGesture;
+}
+
+interface MSGestureEvent extends UIEvent {
+ clientX: number;
+ clientY: number;
+ expansion: number;
+ gestureObject: any;
+ hwTimestamp: number;
+ offsetX: number;
+ offsetY: number;
+ rotation: number;
+ scale: number;
+ screenX: number;
+ screenY: number;
+ translationX: number;
+ translationY: number;
+ velocityAngular: number;
+ velocityExpansion: number;
+ velocityX: number;
+ velocityY: number;
+ initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void;
+ MSGESTURE_FLAG_BEGIN: number;
+ MSGESTURE_FLAG_CANCEL: number;
+ MSGESTURE_FLAG_END: number;
+ MSGESTURE_FLAG_INERTIA: number;
+ MSGESTURE_FLAG_NONE: number;
+}
+
+declare var MSGestureEvent: {
+ prototype: MSGestureEvent;
+ new(): MSGestureEvent;
+ MSGESTURE_FLAG_BEGIN: number;
+ MSGESTURE_FLAG_CANCEL: number;
+ MSGESTURE_FLAG_END: number;
+ MSGESTURE_FLAG_INERTIA: number;
+ MSGESTURE_FLAG_NONE: number;
+}
+
+interface MSGraphicsTrust {
+ constrictionActive: boolean;
+ status: string;
+}
+
+declare var MSGraphicsTrust: {
+ prototype: MSGraphicsTrust;
+ new(): MSGraphicsTrust;
+}
+
+interface MSHTMLWebViewElement extends HTMLElement {
+ canGoBack: boolean;
+ canGoForward: boolean;
+ containsFullScreenElement: boolean;
+ documentTitle: string;
+ height: number;
+ settings: MSWebViewSettings;
+ src: string;
+ width: number;
+ addWebAllowedObject(name: string, applicationObject: any): void;
+ buildLocalStreamUri(contentIdentifier: string, relativePath: string): string;
+ capturePreviewToBlobAsync(): MSWebViewAsyncOperation;
+ captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation;
+ getDeferredPermissionRequestById(id: number): DeferredPermissionRequest;
+ getDeferredPermissionRequests(): DeferredPermissionRequest[];
+ goBack(): void;
+ goForward(): void;
+ invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation;
+ navigate(uri: string): void;
+ navigateToLocalStreamUri(source: string, streamResolver: any): void;
+ navigateToString(contents: string): void;
+ navigateWithHttpRequestMessage(requestMessage: any): void;
+ refresh(): void;
+ stop(): void;
+}
+
+declare var MSHTMLWebViewElement: {
+ prototype: MSHTMLWebViewElement;
+ new(): MSHTMLWebViewElement;
+}
+
+interface MSInputMethodContext extends EventTarget {
+ compositionEndOffset: number;
+ compositionStartOffset: number;
+ oncandidatewindowhide: (ev: Event) => any;
+ oncandidatewindowshow: (ev: Event) => any;
+ oncandidatewindowupdate: (ev: Event) => any;
+ target: HTMLElement;
+ getCandidateWindowClientRect(): ClientRect;
+ getCompositionAlternatives(): string[];
+ hasComposition(): boolean;
+ isCandidateWindowVisible(): boolean;
+ addEventListener(type: "MSCandidateWindowHide", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSCandidateWindowShow", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSCandidateWindowUpdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MSInputMethodContext: {
+ prototype: MSInputMethodContext;
+ new(): MSInputMethodContext;
+}
+
+interface MSManipulationEvent extends UIEvent {
+ currentState: number;
+ inertiaDestinationX: number;
+ inertiaDestinationY: number;
+ lastState: number;
+ initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void;
+ MS_MANIPULATION_STATE_ACTIVE: number;
+ MS_MANIPULATION_STATE_CANCELLED: number;
+ MS_MANIPULATION_STATE_COMMITTED: number;
+ MS_MANIPULATION_STATE_DRAGGING: number;
+ MS_MANIPULATION_STATE_INERTIA: number;
+ MS_MANIPULATION_STATE_PRESELECT: number;
+ MS_MANIPULATION_STATE_SELECTING: number;
+ MS_MANIPULATION_STATE_STOPPED: number;
+}
+
+declare var MSManipulationEvent: {
+ prototype: MSManipulationEvent;
+ new(): MSManipulationEvent;
+ MS_MANIPULATION_STATE_ACTIVE: number;
+ MS_MANIPULATION_STATE_CANCELLED: number;
+ MS_MANIPULATION_STATE_COMMITTED: number;
+ MS_MANIPULATION_STATE_DRAGGING: number;
+ MS_MANIPULATION_STATE_INERTIA: number;
+ MS_MANIPULATION_STATE_PRESELECT: number;
+ MS_MANIPULATION_STATE_SELECTING: number;
+ MS_MANIPULATION_STATE_STOPPED: number;
+}
+
+interface MSMediaKeyError {
+ code: number;
+ systemCode: number;
+ MS_MEDIA_KEYERR_CLIENT: number;
+ MS_MEDIA_KEYERR_DOMAIN: number;
+ MS_MEDIA_KEYERR_HARDWARECHANGE: number;
+ MS_MEDIA_KEYERR_OUTPUT: number;
+ MS_MEDIA_KEYERR_SERVICE: number;
+ MS_MEDIA_KEYERR_UNKNOWN: number;
+}
+
+declare var MSMediaKeyError: {
+ prototype: MSMediaKeyError;
+ new(): MSMediaKeyError;
+ MS_MEDIA_KEYERR_CLIENT: number;
+ MS_MEDIA_KEYERR_DOMAIN: number;
+ MS_MEDIA_KEYERR_HARDWARECHANGE: number;
+ MS_MEDIA_KEYERR_OUTPUT: number;
+ MS_MEDIA_KEYERR_SERVICE: number;
+ MS_MEDIA_KEYERR_UNKNOWN: number;
+}
+
+interface MSMediaKeyMessageEvent extends Event {
+ destinationURL: string;
+ message: Uint8Array;
+}
+
+declare var MSMediaKeyMessageEvent: {
+ prototype: MSMediaKeyMessageEvent;
+ new(): MSMediaKeyMessageEvent;
+}
+
+interface MSMediaKeyNeededEvent extends Event {
+ initData: Uint8Array;
+}
+
+declare var MSMediaKeyNeededEvent: {
+ prototype: MSMediaKeyNeededEvent;
+ new(): MSMediaKeyNeededEvent;
+}
+
+interface MSMediaKeySession extends EventTarget {
+ error: MSMediaKeyError;
+ keySystem: string;
+ sessionId: string;
+ close(): void;
+ update(key: Uint8Array): void;
+}
+
+declare var MSMediaKeySession: {
+ prototype: MSMediaKeySession;
+ new(): MSMediaKeySession;
+}
+
+interface MSMediaKeys {
+ keySystem: string;
+ createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession;
+}
+
+declare var MSMediaKeys: {
+ prototype: MSMediaKeys;
+ new(keySystem: string): MSMediaKeys;
+ isTypeSupported(keySystem: string, type?: string): boolean;
+}
+
+interface MSMimeTypesCollection {
+ length: number;
+}
+
+declare var MSMimeTypesCollection: {
+ prototype: MSMimeTypesCollection;
+ new(): MSMimeTypesCollection;
+}
+
+interface MSPluginsCollection {
+ length: number;
+ refresh(reload?: boolean): void;
+}
+
+declare var MSPluginsCollection: {
+ prototype: MSPluginsCollection;
+ new(): MSPluginsCollection;
+}
+
+interface MSPointerEvent extends MouseEvent {
+ currentPoint: any;
+ height: number;
+ hwTimestamp: number;
+ intermediatePoints: any;
+ isPrimary: boolean;
+ pointerId: number;
+ pointerType: any;
+ pressure: number;
+ rotation: number;
+ tiltX: number;
+ tiltY: number;
+ width: number;
+ getCurrentPoint(element: Element): void;
+ getIntermediatePoints(element: Element): void;
+ initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;
+}
+
+declare var MSPointerEvent: {
+ prototype: MSPointerEvent;
+ new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent;
+}
+
+interface MSRangeCollection {
+ length: number;
+ item(index: number): Range;
+ [index: number]: Range;
+}
+
+declare var MSRangeCollection: {
+ prototype: MSRangeCollection;
+ new(): MSRangeCollection;
+}
+
+interface MSSiteModeEvent extends Event {
+ actionURL: string;
+ buttonID: number;
+}
+
+declare var MSSiteModeEvent: {
+ prototype: MSSiteModeEvent;
+ new(): MSSiteModeEvent;
+}
+
+interface MSStream {
+ type: string;
+ msClose(): void;
+ msDetachStream(): any;
+}
+
+declare var MSStream: {
+ prototype: MSStream;
+ new(): MSStream;
+}
+
+interface MSStreamReader extends EventTarget, MSBaseReader {
+ error: DOMError;
+ readAsArrayBuffer(stream: MSStream, size?: number): void;
+ readAsBinaryString(stream: MSStream, size?: number): void;
+ readAsBlob(stream: MSStream, size?: number): void;
+ readAsDataURL(stream: MSStream, size?: number): void;
+ readAsText(stream: MSStream, encoding?: string, size?: number): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MSStreamReader: {
+ prototype: MSStreamReader;
+ new(): MSStreamReader;
+}
+
+interface MSWebViewAsyncOperation extends EventTarget {
+ error: DOMError;
+ oncomplete: (ev: Event) => any;
+ onerror: (ev: Event) => any;
+ readyState: number;
+ result: any;
+ target: MSHTMLWebViewElement;
+ type: number;
+ start(): void;
+ COMPLETED: number;
+ ERROR: number;
+ STARTED: number;
+ TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number;
+ TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number;
+ TYPE_INVOKE_SCRIPT: number;
+ addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MSWebViewAsyncOperation: {
+ prototype: MSWebViewAsyncOperation;
+ new(): MSWebViewAsyncOperation;
+ COMPLETED: number;
+ ERROR: number;
+ STARTED: number;
+ TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number;
+ TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number;
+ TYPE_INVOKE_SCRIPT: number;
+}
+
+interface MSWebViewSettings {
+ isIndexedDBEnabled: boolean;
+ isJavaScriptEnabled: boolean;
+}
+
+declare var MSWebViewSettings: {
+ prototype: MSWebViewSettings;
+ new(): MSWebViewSettings;
+}
+
+interface MediaElementAudioSourceNode extends AudioNode {
+}
+
+declare var MediaElementAudioSourceNode: {
+ prototype: MediaElementAudioSourceNode;
+ new(): MediaElementAudioSourceNode;
+}
+
+interface MediaError {
+ code: number;
+ msExtendedCode: number;
+ MEDIA_ERR_ABORTED: number;
+ MEDIA_ERR_DECODE: number;
+ MEDIA_ERR_NETWORK: number;
+ MEDIA_ERR_SRC_NOT_SUPPORTED: number;
+ MS_MEDIA_ERR_ENCRYPTED: number;
+}
+
+declare var MediaError: {
+ prototype: MediaError;
+ new(): MediaError;
+ MEDIA_ERR_ABORTED: number;
+ MEDIA_ERR_DECODE: number;
+ MEDIA_ERR_NETWORK: number;
+ MEDIA_ERR_SRC_NOT_SUPPORTED: number;
+ MS_MEDIA_ERR_ENCRYPTED: number;
+}
+
+interface MediaList {
+ length: number;
+ mediaText: string;
+ appendMedium(newMedium: string): void;
+ deleteMedium(oldMedium: string): void;
+ item(index: number): string;
+ toString(): string;
+ [index: number]: string;
+}
+
+declare var MediaList: {
+ prototype: MediaList;
+ new(): MediaList;
+}
+
+interface MediaQueryList {
+ matches: boolean;
+ media: string;
+ addListener(listener: MediaQueryListListener): void;
+ removeListener(listener: MediaQueryListListener): void;
+}
+
+declare var MediaQueryList: {
+ prototype: MediaQueryList;
+ new(): MediaQueryList;
+}
+
+interface MediaSource extends EventTarget {
+ activeSourceBuffers: SourceBufferList;
+ duration: number;
+ readyState: number;
+ sourceBuffers: SourceBufferList;
+ addSourceBuffer(type: string): SourceBuffer;
+ endOfStream(error?: number): void;
+ removeSourceBuffer(sourceBuffer: SourceBuffer): void;
+}
+
+declare var MediaSource: {
+ prototype: MediaSource;
+ new(): MediaSource;
+ isTypeSupported(type: string): boolean;
+}
+
+interface MessageChannel {
+ port1: MessagePort;
+ port2: MessagePort;
+}
+
+declare var MessageChannel: {
+ prototype: MessageChannel;
+ new(): MessageChannel;
+}
+
+interface MessageEvent extends Event {
+ data: any;
+ origin: string;
+ ports: any;
+ source: Window;
+ initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void;
+}
+
+declare var MessageEvent: {
+ prototype: MessageEvent;
+ new(type: string, eventInitDict?: MessageEventInit): MessageEvent;
+}
+
+interface MessagePort extends EventTarget {
+ onmessage: (ev: MessageEvent) => any;
+ close(): void;
+ postMessage(message?: any, ports?: any): void;
+ start(): void;
+ addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var MessagePort: {
+ prototype: MessagePort;
+ new(): MessagePort;
+}
+
+interface MimeType {
+ description: string;
+ enabledPlugin: Plugin;
+ suffixes: string;
+ type: string;
+}
+
+declare var MimeType: {
+ prototype: MimeType;
+ new(): MimeType;
+}
+
+interface MimeTypeArray {
+ length: number;
+ item(index: number): Plugin;
+ namedItem(type: string): Plugin;
+ [index: number]: Plugin;
+}
+
+declare var MimeTypeArray: {
+ prototype: MimeTypeArray;
+ new(): MimeTypeArray;
+}
+
+interface MouseEvent extends UIEvent {
+ altKey: boolean;
+ button: number;
+ buttons: number;
+ clientX: number;
+ clientY: number;
+ ctrlKey: boolean;
+ fromElement: Element;
+ layerX: number;
+ layerY: number;
+ metaKey: boolean;
+ movementX: number;
+ movementY: number;
+ offsetX: number;
+ offsetY: number;
+ pageX: number;
+ pageY: number;
+ relatedTarget: EventTarget;
+ screenX: number;
+ screenY: number;
+ shiftKey: boolean;
+ toElement: Element;
+ which: number;
+ x: number;
+ y: number;
+ getModifierState(keyArg: string): boolean;
+ initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void;
+}
+
+declare var MouseEvent: {
+ prototype: MouseEvent;
+ new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent;
+}
+
+interface MouseWheelEvent extends MouseEvent {
+ wheelDelta: number;
+ wheelDeltaX: number;
+ wheelDeltaY: number;
+ initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void;
+}
+
+declare var MouseWheelEvent: {
+ prototype: MouseWheelEvent;
+ new(): MouseWheelEvent;
+}
+
+interface MutationEvent extends Event {
+ attrChange: number;
+ attrName: string;
+ newValue: string;
+ prevValue: string;
+ relatedNode: Node;
+ initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void;
+ ADDITION: number;
+ MODIFICATION: number;
+ REMOVAL: number;
+}
+
+declare var MutationEvent: {
+ prototype: MutationEvent;
+ new(): MutationEvent;
+ ADDITION: number;
+ MODIFICATION: number;
+ REMOVAL: number;
+}
+
+interface MutationObserver {
+ disconnect(): void;
+ observe(target: Node, options: MutationObserverInit): void;
+ takeRecords(): MutationRecord[];
+}
+
+declare var MutationObserver: {
+ prototype: MutationObserver;
+ new(callback: MutationCallback): MutationObserver;
+}
+
+interface MutationRecord {
+ addedNodes: NodeList;
+ attributeName: string;
+ attributeNamespace: string;
+ nextSibling: Node;
+ oldValue: string;
+ previousSibling: Node;
+ removedNodes: NodeList;
+ target: Node;
+ type: string;
+}
+
+declare var MutationRecord: {
+ prototype: MutationRecord;
+ new(): MutationRecord;
+}
+
+interface NamedNodeMap {
+ length: number;
+ getNamedItem(name: string): Attr;
+ getNamedItemNS(namespaceURI: string, localName: string): Attr;
+ item(index: number): Attr;
+ removeNamedItem(name: string): Attr;
+ removeNamedItemNS(namespaceURI: string, localName: string): Attr;
+ setNamedItem(arg: Attr): Attr;
+ setNamedItemNS(arg: Attr): Attr;
+ [index: number]: Attr;
+}
+
+declare var NamedNodeMap: {
+ prototype: NamedNodeMap;
+ new(): NamedNodeMap;
+}
+
+interface NavigationCompletedEvent extends NavigationEvent {
+ isSuccess: boolean;
+ webErrorStatus: number;
+}
+
+declare var NavigationCompletedEvent: {
+ prototype: NavigationCompletedEvent;
+ new(): NavigationCompletedEvent;
+}
+
+interface NavigationEvent extends Event {
+ uri: string;
+}
+
+declare var NavigationEvent: {
+ prototype: NavigationEvent;
+ new(): NavigationEvent;
+}
+
+interface NavigationEventWithReferrer extends NavigationEvent {
+ referer: string;
+}
+
+declare var NavigationEventWithReferrer: {
+ prototype: NavigationEventWithReferrer;
+ new(): NavigationEventWithReferrer;
+}
+
+interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver {
+ appCodeName: string;
+ appMinorVersion: string;
+ browserLanguage: string;
+ connectionSpeed: number;
+ cookieEnabled: boolean;
+ cpuClass: string;
+ language: string;
+ maxTouchPoints: number;
+ mimeTypes: MSMimeTypesCollection;
+ msManipulationViewsEnabled: boolean;
+ msMaxTouchPoints: number;
+ msPointerEnabled: boolean;
+ plugins: MSPluginsCollection;
+ pointerEnabled: boolean;
+ systemLanguage: string;
+ userLanguage: string;
+ webdriver: boolean;
+ getGamepads(): Gamepad[];
+ javaEnabled(): boolean;
+ msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;
+ vibrate(pattern: number | number[]): boolean;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var Navigator: {
+ prototype: Navigator;
+ new(): Navigator;
+}
+
+interface Node extends EventTarget {
+ attributes: NamedNodeMap;
+ baseURI: string;
+ childNodes: NodeList;
+ firstChild: Node;
+ lastChild: Node;
+ localName: string;
+ namespaceURI: string;
+ nextSibling: Node;
+ nodeName: string;
+ nodeType: number;
+ nodeValue: string;
+ ownerDocument: Document;
+ parentElement: HTMLElement;
+ parentNode: Node;
+ prefix: string;
+ previousSibling: Node;
+ textContent: string;
+ appendChild(newChild: Node): Node;
+ cloneNode(deep?: boolean): Node;
+ compareDocumentPosition(other: Node): number;
+ hasAttributes(): boolean;
+ hasChildNodes(): boolean;
+ insertBefore(newChild: Node, refChild?: Node): Node;
+ isDefaultNamespace(namespaceURI: string): boolean;
+ isEqualNode(arg: Node): boolean;
+ isSameNode(other: Node): boolean;
+ lookupNamespaceURI(prefix: string): string;
+ lookupPrefix(namespaceURI: string): string;
+ normalize(): void;
+ removeChild(oldChild: Node): Node;
+ replaceChild(newChild: Node, oldChild: Node): Node;
+ contains(node: Node): boolean;
+ ATTRIBUTE_NODE: number;
+ CDATA_SECTION_NODE: number;
+ COMMENT_NODE: number;
+ DOCUMENT_FRAGMENT_NODE: number;
+ DOCUMENT_NODE: number;
+ DOCUMENT_POSITION_CONTAINED_BY: number;
+ DOCUMENT_POSITION_CONTAINS: number;
+ DOCUMENT_POSITION_DISCONNECTED: number;
+ DOCUMENT_POSITION_FOLLOWING: number;
+ DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
+ DOCUMENT_POSITION_PRECEDING: number;
+ DOCUMENT_TYPE_NODE: number;
+ ELEMENT_NODE: number;
+ ENTITY_NODE: number;
+ ENTITY_REFERENCE_NODE: number;
+ NOTATION_NODE: number;
+ PROCESSING_INSTRUCTION_NODE: number;
+ TEXT_NODE: number;
+}
+
+declare var Node: {
+ prototype: Node;
+ new(): Node;
+ ATTRIBUTE_NODE: number;
+ CDATA_SECTION_NODE: number;
+ COMMENT_NODE: number;
+ DOCUMENT_FRAGMENT_NODE: number;
+ DOCUMENT_NODE: number;
+ DOCUMENT_POSITION_CONTAINED_BY: number;
+ DOCUMENT_POSITION_CONTAINS: number;
+ DOCUMENT_POSITION_DISCONNECTED: number;
+ DOCUMENT_POSITION_FOLLOWING: number;
+ DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
+ DOCUMENT_POSITION_PRECEDING: number;
+ DOCUMENT_TYPE_NODE: number;
+ ELEMENT_NODE: number;
+ ENTITY_NODE: number;
+ ENTITY_REFERENCE_NODE: number;
+ NOTATION_NODE: number;
+ PROCESSING_INSTRUCTION_NODE: number;
+ TEXT_NODE: number;
+}
+
+interface NodeFilter {
+ acceptNode(n: Node): number;
+}
+
+declare var NodeFilter: {
+ FILTER_ACCEPT: number;
+ FILTER_REJECT: number;
+ FILTER_SKIP: number;
+ SHOW_ALL: number;
+ SHOW_ATTRIBUTE: number;
+ SHOW_CDATA_SECTION: number;
+ SHOW_COMMENT: number;
+ SHOW_DOCUMENT: number;
+ SHOW_DOCUMENT_FRAGMENT: number;
+ SHOW_DOCUMENT_TYPE: number;
+ SHOW_ELEMENT: number;
+ SHOW_ENTITY: number;
+ SHOW_ENTITY_REFERENCE: number;
+ SHOW_NOTATION: number;
+ SHOW_PROCESSING_INSTRUCTION: number;
+ SHOW_TEXT: number;
+}
+
+interface NodeIterator {
+ expandEntityReferences: boolean;
+ filter: NodeFilter;
+ root: Node;
+ whatToShow: number;
+ detach(): void;
+ nextNode(): Node;
+ previousNode(): Node;
+}
+
+declare var NodeIterator: {
+ prototype: NodeIterator;
+ new(): NodeIterator;
+}
+
+interface NodeList {
+ length: number;
+ item(index: number): Node;
+ [index: number]: Node;
+}
+
+declare var NodeList: {
+ prototype: NodeList;
+ new(): NodeList;
+}
+
+interface OES_element_index_uint {
+}
+
+declare var OES_element_index_uint: {
+ prototype: OES_element_index_uint;
+ new(): OES_element_index_uint;
+}
+
+interface OES_standard_derivatives {
+ FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;
+}
+
+declare var OES_standard_derivatives: {
+ prototype: OES_standard_derivatives;
+ new(): OES_standard_derivatives;
+ FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;
+}
+
+interface OES_texture_float {
+}
+
+declare var OES_texture_float: {
+ prototype: OES_texture_float;
+ new(): OES_texture_float;
+}
+
+interface OES_texture_float_linear {
+}
+
+declare var OES_texture_float_linear: {
+ prototype: OES_texture_float_linear;
+ new(): OES_texture_float_linear;
+}
+
+interface OfflineAudioCompletionEvent extends Event {
+ renderedBuffer: AudioBuffer;
+}
+
+declare var OfflineAudioCompletionEvent: {
+ prototype: OfflineAudioCompletionEvent;
+ new(): OfflineAudioCompletionEvent;
+}
+
+interface OfflineAudioContext extends AudioContext {
+ oncomplete: (ev: Event) => any;
+ startRendering(): void;
+ addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var OfflineAudioContext: {
+ prototype: OfflineAudioContext;
+ new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext;
+}
+
+interface OscillatorNode extends AudioNode {
+ detune: AudioParam;
+ frequency: AudioParam;
+ onended: (ev: Event) => any;
+ type: string;
+ setPeriodicWave(periodicWave: PeriodicWave): void;
+ start(when?: number): void;
+ stop(when?: number): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var OscillatorNode: {
+ prototype: OscillatorNode;
+ new(): OscillatorNode;
+}
+
+interface PageTransitionEvent extends Event {
+ persisted: boolean;
+}
+
+declare var PageTransitionEvent: {
+ prototype: PageTransitionEvent;
+ new(): PageTransitionEvent;
+}
+
+interface PannerNode extends AudioNode {
+ coneInnerAngle: number;
+ coneOuterAngle: number;
+ coneOuterGain: number;
+ distanceModel: string;
+ maxDistance: number;
+ panningModel: string;
+ refDistance: number;
+ rolloffFactor: number;
+ setOrientation(x: number, y: number, z: number): void;
+ setPosition(x: number, y: number, z: number): void;
+ setVelocity(x: number, y: number, z: number): void;
+}
+
+declare var PannerNode: {
+ prototype: PannerNode;
+ new(): PannerNode;
+}
+
+interface PerfWidgetExternal {
+ activeNetworkRequestCount: number;
+ averageFrameTime: number;
+ averagePaintTime: number;
+ extraInformationEnabled: boolean;
+ independentRenderingEnabled: boolean;
+ irDisablingContentString: string;
+ irStatusAvailable: boolean;
+ maxCpuSpeed: number;
+ paintRequestsPerSecond: number;
+ performanceCounter: number;
+ performanceCounterFrequency: number;
+ addEventListener(eventType: string, callback: Function): void;
+ getMemoryUsage(): number;
+ getProcessCpuUsage(): number;
+ getRecentCpuUsage(last: number): any;
+ getRecentFrames(last: number): any;
+ getRecentMemoryUsage(last: number): any;
+ getRecentPaintRequests(last: number): any;
+ removeEventListener(eventType: string, callback: Function): void;
+ repositionWindow(x: number, y: number): void;
+ resizeWindow(width: number, height: number): void;
+}
+
+declare var PerfWidgetExternal: {
+ prototype: PerfWidgetExternal;
+ new(): PerfWidgetExternal;
+}
+
+interface Performance {
+ navigation: PerformanceNavigation;
+ timing: PerformanceTiming;
+ clearMarks(markName?: string): void;
+ clearMeasures(measureName?: string): void;
+ clearResourceTimings(): void;
+ getEntries(): any;
+ getEntriesByName(name: string, entryType?: string): any;
+ getEntriesByType(entryType: string): any;
+ getMarks(markName?: string): any;
+ getMeasures(measureName?: string): any;
+ mark(markName: string): void;
+ measure(measureName: string, startMarkName?: string, endMarkName?: string): void;
+ now(): number;
+ setResourceTimingBufferSize(maxSize: number): void;
+ toJSON(): any;
+}
+
+declare var Performance: {
+ prototype: Performance;
+ new(): Performance;
+}
+
+interface PerformanceEntry {
+ duration: number;
+ entryType: string;
+ name: string;
+ startTime: number;
+}
+
+declare var PerformanceEntry: {
+ prototype: PerformanceEntry;
+ new(): PerformanceEntry;
+}
+
+interface PerformanceMark extends PerformanceEntry {
+}
+
+declare var PerformanceMark: {
+ prototype: PerformanceMark;
+ new(): PerformanceMark;
+}
+
+interface PerformanceMeasure extends PerformanceEntry {
+}
+
+declare var PerformanceMeasure: {
+ prototype: PerformanceMeasure;
+ new(): PerformanceMeasure;
+}
+
+interface PerformanceNavigation {
+ redirectCount: number;
+ type: number;
+ toJSON(): any;
+ TYPE_BACK_FORWARD: number;
+ TYPE_NAVIGATE: number;
+ TYPE_RELOAD: number;
+ TYPE_RESERVED: number;
+}
+
+declare var PerformanceNavigation: {
+ prototype: PerformanceNavigation;
+ new(): PerformanceNavigation;
+ TYPE_BACK_FORWARD: number;
+ TYPE_NAVIGATE: number;
+ TYPE_RELOAD: number;
+ TYPE_RESERVED: number;
+}
+
+interface PerformanceNavigationTiming extends PerformanceEntry {
+ connectEnd: number;
+ connectStart: number;
+ domComplete: number;
+ domContentLoadedEventEnd: number;
+ domContentLoadedEventStart: number;
+ domInteractive: number;
+ domLoading: number;
+ domainLookupEnd: number;
+ domainLookupStart: number;
+ fetchStart: number;
+ loadEventEnd: number;
+ loadEventStart: number;
+ navigationStart: number;
+ redirectCount: number;
+ redirectEnd: number;
+ redirectStart: number;
+ requestStart: number;
+ responseEnd: number;
+ responseStart: number;
+ type: string;
+ unloadEventEnd: number;
+ unloadEventStart: number;
+}
+
+declare var PerformanceNavigationTiming: {
+ prototype: PerformanceNavigationTiming;
+ new(): PerformanceNavigationTiming;
+}
+
+interface PerformanceResourceTiming extends PerformanceEntry {
+ connectEnd: number;
+ connectStart: number;
+ domainLookupEnd: number;
+ domainLookupStart: number;
+ fetchStart: number;
+ initiatorType: string;
+ redirectEnd: number;
+ redirectStart: number;
+ requestStart: number;
+ responseEnd: number;
+ responseStart: number;
+}
+
+declare var PerformanceResourceTiming: {
+ prototype: PerformanceResourceTiming;
+ new(): PerformanceResourceTiming;
+}
+
+interface PerformanceTiming {
+ connectEnd: number;
+ connectStart: number;
+ domComplete: number;
+ domContentLoadedEventEnd: number;
+ domContentLoadedEventStart: number;
+ domInteractive: number;
+ domLoading: number;
+ domainLookupEnd: number;
+ domainLookupStart: number;
+ fetchStart: number;
+ loadEventEnd: number;
+ loadEventStart: number;
+ msFirstPaint: number;
+ navigationStart: number;
+ redirectEnd: number;
+ redirectStart: number;
+ requestStart: number;
+ responseEnd: number;
+ responseStart: number;
+ unloadEventEnd: number;
+ unloadEventStart: number;
+ toJSON(): any;
+}
+
+declare var PerformanceTiming: {
+ prototype: PerformanceTiming;
+ new(): PerformanceTiming;
+}
+
+interface PeriodicWave {
+}
+
+declare var PeriodicWave: {
+ prototype: PeriodicWave;
+ new(): PeriodicWave;
+}
+
+interface PermissionRequest extends DeferredPermissionRequest {
+ state: string;
+ defer(): void;
+}
+
+declare var PermissionRequest: {
+ prototype: PermissionRequest;
+ new(): PermissionRequest;
+}
+
+interface PermissionRequestedEvent extends Event {
+ permissionRequest: PermissionRequest;
+}
+
+declare var PermissionRequestedEvent: {
+ prototype: PermissionRequestedEvent;
+ new(): PermissionRequestedEvent;
+}
+
+interface Plugin {
+ description: string;
+ filename: string;
+ length: number;
+ name: string;
+ version: string;
+ item(index: number): MimeType;
+ namedItem(type: string): MimeType;
+ [index: number]: MimeType;
+}
+
+declare var Plugin: {
+ prototype: Plugin;
+ new(): Plugin;
+}
+
+interface PluginArray {
+ length: number;
+ item(index: number): Plugin;
+ namedItem(name: string): Plugin;
+ refresh(reload?: boolean): void;
+ [index: number]: Plugin;
+}
+
+declare var PluginArray: {
+ prototype: PluginArray;
+ new(): PluginArray;
+}
+
+interface PointerEvent extends MouseEvent {
+ currentPoint: any;
+ height: number;
+ hwTimestamp: number;
+ intermediatePoints: any;
+ isPrimary: boolean;
+ pointerId: number;
+ pointerType: any;
+ pressure: number;
+ rotation: number;
+ tiltX: number;
+ tiltY: number;
+ width: number;
+ getCurrentPoint(element: Element): void;
+ getIntermediatePoints(element: Element): void;
+ initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;
+}
+
+declare var PointerEvent: {
+ prototype: PointerEvent;
+ new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent;
+}
+
+interface PopStateEvent extends Event {
+ state: any;
+ initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void;
+}
+
+declare var PopStateEvent: {
+ prototype: PopStateEvent;
+ new(): PopStateEvent;
+}
+
+interface Position {
+ coords: Coordinates;
+ timestamp: number;
+}
+
+declare var Position: {
+ prototype: Position;
+ new(): Position;
+}
+
+interface PositionError {
+ code: number;
+ message: string;
+ toString(): string;
+ PERMISSION_DENIED: number;
+ POSITION_UNAVAILABLE: number;
+ TIMEOUT: number;
+}
+
+declare var PositionError: {
+ prototype: PositionError;
+ new(): PositionError;
+ PERMISSION_DENIED: number;
+ POSITION_UNAVAILABLE: number;
+ TIMEOUT: number;
+}
+
+interface ProcessingInstruction extends CharacterData {
+ target: string;
+}
+
+declare var ProcessingInstruction: {
+ prototype: ProcessingInstruction;
+ new(): ProcessingInstruction;
+}
+
+interface ProgressEvent extends Event {
+ lengthComputable: boolean;
+ loaded: number;
+ total: number;
+ initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void;
+}
+
+declare var ProgressEvent: {
+ prototype: ProgressEvent;
+ new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent;
+}
+
+interface Range {
+ collapsed: boolean;
+ commonAncestorContainer: Node;
+ endContainer: Node;
+ endOffset: number;
+ startContainer: Node;
+ startOffset: number;
+ cloneContents(): DocumentFragment;
+ cloneRange(): Range;
+ collapse(toStart: boolean): void;
+ compareBoundaryPoints(how: number, sourceRange: Range): number;
+ createContextualFragment(fragment: string): DocumentFragment;
+ deleteContents(): void;
+ detach(): void;
+ expand(Unit: string): boolean;
+ extractContents(): DocumentFragment;
+ getBoundingClientRect(): ClientRect;
+ getClientRects(): ClientRectList;
+ insertNode(newNode: Node): void;
+ selectNode(refNode: Node): void;
+ selectNodeContents(refNode: Node): void;
+ setEnd(refNode: Node, offset: number): void;
+ setEndAfter(refNode: Node): void;
+ setEndBefore(refNode: Node): void;
+ setStart(refNode: Node, offset: number): void;
+ setStartAfter(refNode: Node): void;
+ setStartBefore(refNode: Node): void;
+ surroundContents(newParent: Node): void;
+ toString(): string;
+ END_TO_END: number;
+ END_TO_START: number;
+ START_TO_END: number;
+ START_TO_START: number;
+}
+
+declare var Range: {
+ prototype: Range;
+ new(): Range;
+ END_TO_END: number;
+ END_TO_START: number;
+ START_TO_END: number;
+ START_TO_START: number;
+}
+
+interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference {
+ target: SVGAnimatedString;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGAElement: {
+ prototype: SVGAElement;
+ new(): SVGAElement;
+}
+
+interface SVGAngle {
+ unitType: number;
+ value: number;
+ valueAsString: string;
+ valueInSpecifiedUnits: number;
+ convertToSpecifiedUnits(unitType: number): void;
+ newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;
+ SVG_ANGLETYPE_DEG: number;
+ SVG_ANGLETYPE_GRAD: number;
+ SVG_ANGLETYPE_RAD: number;
+ SVG_ANGLETYPE_UNKNOWN: number;
+ SVG_ANGLETYPE_UNSPECIFIED: number;
+}
+
+declare var SVGAngle: {
+ prototype: SVGAngle;
+ new(): SVGAngle;
+ SVG_ANGLETYPE_DEG: number;
+ SVG_ANGLETYPE_GRAD: number;
+ SVG_ANGLETYPE_RAD: number;
+ SVG_ANGLETYPE_UNKNOWN: number;
+ SVG_ANGLETYPE_UNSPECIFIED: number;
+}
+
+interface SVGAnimatedAngle {
+ animVal: SVGAngle;
+ baseVal: SVGAngle;
+}
+
+declare var SVGAnimatedAngle: {
+ prototype: SVGAnimatedAngle;
+ new(): SVGAnimatedAngle;
+}
+
+interface SVGAnimatedBoolean {
+ animVal: boolean;
+ baseVal: boolean;
+}
+
+declare var SVGAnimatedBoolean: {
+ prototype: SVGAnimatedBoolean;
+ new(): SVGAnimatedBoolean;
+}
+
+interface SVGAnimatedEnumeration {
+ animVal: number;
+ baseVal: number;
+}
+
+declare var SVGAnimatedEnumeration: {
+ prototype: SVGAnimatedEnumeration;
+ new(): SVGAnimatedEnumeration;
+}
+
+interface SVGAnimatedInteger {
+ animVal: number;
+ baseVal: number;
+}
+
+declare var SVGAnimatedInteger: {
+ prototype: SVGAnimatedInteger;
+ new(): SVGAnimatedInteger;
+}
+
+interface SVGAnimatedLength {
+ animVal: SVGLength;
+ baseVal: SVGLength;
+}
+
+declare var SVGAnimatedLength: {
+ prototype: SVGAnimatedLength;
+ new(): SVGAnimatedLength;
+}
+
+interface SVGAnimatedLengthList {
+ animVal: SVGLengthList;
+ baseVal: SVGLengthList;
+}
+
+declare var SVGAnimatedLengthList: {
+ prototype: SVGAnimatedLengthList;
+ new(): SVGAnimatedLengthList;
+}
+
+interface SVGAnimatedNumber {
+ animVal: number;
+ baseVal: number;
+}
+
+declare var SVGAnimatedNumber: {
+ prototype: SVGAnimatedNumber;
+ new(): SVGAnimatedNumber;
+}
+
+interface SVGAnimatedNumberList {
+ animVal: SVGNumberList;
+ baseVal: SVGNumberList;
+}
+
+declare var SVGAnimatedNumberList: {
+ prototype: SVGAnimatedNumberList;
+ new(): SVGAnimatedNumberList;
+}
+
+interface SVGAnimatedPreserveAspectRatio {
+ animVal: SVGPreserveAspectRatio;
+ baseVal: SVGPreserveAspectRatio;
+}
+
+declare var SVGAnimatedPreserveAspectRatio: {
+ prototype: SVGAnimatedPreserveAspectRatio;
+ new(): SVGAnimatedPreserveAspectRatio;
+}
+
+interface SVGAnimatedRect {
+ animVal: SVGRect;
+ baseVal: SVGRect;
+}
+
+declare var SVGAnimatedRect: {
+ prototype: SVGAnimatedRect;
+ new(): SVGAnimatedRect;
+}
+
+interface SVGAnimatedString {
+ animVal: string;
+ baseVal: string;
+}
+
+declare var SVGAnimatedString: {
+ prototype: SVGAnimatedString;
+ new(): SVGAnimatedString;
+}
+
+interface SVGAnimatedTransformList {
+ animVal: SVGTransformList;
+ baseVal: SVGTransformList;
+}
+
+declare var SVGAnimatedTransformList: {
+ prototype: SVGAnimatedTransformList;
+ new(): SVGAnimatedTransformList;
+}
+
+interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ cx: SVGAnimatedLength;
+ cy: SVGAnimatedLength;
+ r: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGCircleElement: {
+ prototype: SVGCircleElement;
+ new(): SVGCircleElement;
+}
+
+interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes {
+ clipPathUnits: SVGAnimatedEnumeration;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGClipPathElement: {
+ prototype: SVGClipPathElement;
+ new(): SVGClipPathElement;
+}
+
+interface SVGComponentTransferFunctionElement extends SVGElement {
+ amplitude: SVGAnimatedNumber;
+ exponent: SVGAnimatedNumber;
+ intercept: SVGAnimatedNumber;
+ offset: SVGAnimatedNumber;
+ slope: SVGAnimatedNumber;
+ tableValues: SVGAnimatedNumberList;
+ type: SVGAnimatedEnumeration;
+ SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;
+ SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;
+ SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;
+ SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;
+ SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;
+ SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;
+}
+
+declare var SVGComponentTransferFunctionElement: {
+ prototype: SVGComponentTransferFunctionElement;
+ new(): SVGComponentTransferFunctionElement;
+ SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;
+ SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;
+ SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;
+ SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;
+ SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;
+ SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;
+}
+
+interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGDefsElement: {
+ prototype: SVGDefsElement;
+ new(): SVGDefsElement;
+}
+
+interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGDescElement: {
+ prototype: SVGDescElement;
+ new(): SVGDescElement;
+}
+
+interface SVGElement extends Element {
+ id: string;
+ onclick: (ev: MouseEvent) => any;
+ ondblclick: (ev: MouseEvent) => any;
+ onfocusin: (ev: FocusEvent) => any;
+ onfocusout: (ev: FocusEvent) => any;
+ onload: (ev: Event) => any;
+ onmousedown: (ev: MouseEvent) => any;
+ onmousemove: (ev: MouseEvent) => any;
+ onmouseout: (ev: MouseEvent) => any;
+ onmouseover: (ev: MouseEvent) => any;
+ onmouseup: (ev: MouseEvent) => any;
+ ownerSVGElement: SVGSVGElement;
+ viewportElement: SVGElement;
+ xmlbase: string;
+ className: any;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGElement: {
+ prototype: SVGElement;
+ new(): SVGElement;
+}
+
+interface SVGElementInstance extends EventTarget {
+ childNodes: SVGElementInstanceList;
+ correspondingElement: SVGElement;
+ correspondingUseElement: SVGUseElement;
+ firstChild: SVGElementInstance;
+ lastChild: SVGElementInstance;
+ nextSibling: SVGElementInstance;
+ parentNode: SVGElementInstance;
+ previousSibling: SVGElementInstance;
+}
+
+declare var SVGElementInstance: {
+ prototype: SVGElementInstance;
+ new(): SVGElementInstance;
+}
+
+interface SVGElementInstanceList {
+ length: number;
+ item(index: number): SVGElementInstance;
+}
+
+declare var SVGElementInstanceList: {
+ prototype: SVGElementInstanceList;
+ new(): SVGElementInstanceList;
+}
+
+interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ cx: SVGAnimatedLength;
+ cy: SVGAnimatedLength;
+ rx: SVGAnimatedLength;
+ ry: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGEllipseElement: {
+ prototype: SVGEllipseElement;
+ new(): SVGEllipseElement;
+}
+
+interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ in1: SVGAnimatedString;
+ in2: SVGAnimatedString;
+ mode: SVGAnimatedEnumeration;
+ SVG_FEBLEND_MODE_COLOR: number;
+ SVG_FEBLEND_MODE_COLOR_BURN: number;
+ SVG_FEBLEND_MODE_COLOR_DODGE: number;
+ SVG_FEBLEND_MODE_DARKEN: number;
+ SVG_FEBLEND_MODE_DIFFERENCE: number;
+ SVG_FEBLEND_MODE_EXCLUSION: number;
+ SVG_FEBLEND_MODE_HARD_LIGHT: number;
+ SVG_FEBLEND_MODE_HUE: number;
+ SVG_FEBLEND_MODE_LIGHTEN: number;
+ SVG_FEBLEND_MODE_LUMINOSITY: number;
+ SVG_FEBLEND_MODE_MULTIPLY: number;
+ SVG_FEBLEND_MODE_NORMAL: number;
+ SVG_FEBLEND_MODE_OVERLAY: number;
+ SVG_FEBLEND_MODE_SATURATION: number;
+ SVG_FEBLEND_MODE_SCREEN: number;
+ SVG_FEBLEND_MODE_SOFT_LIGHT: number;
+ SVG_FEBLEND_MODE_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEBlendElement: {
+ prototype: SVGFEBlendElement;
+ new(): SVGFEBlendElement;
+ SVG_FEBLEND_MODE_COLOR: number;
+ SVG_FEBLEND_MODE_COLOR_BURN: number;
+ SVG_FEBLEND_MODE_COLOR_DODGE: number;
+ SVG_FEBLEND_MODE_DARKEN: number;
+ SVG_FEBLEND_MODE_DIFFERENCE: number;
+ SVG_FEBLEND_MODE_EXCLUSION: number;
+ SVG_FEBLEND_MODE_HARD_LIGHT: number;
+ SVG_FEBLEND_MODE_HUE: number;
+ SVG_FEBLEND_MODE_LIGHTEN: number;
+ SVG_FEBLEND_MODE_LUMINOSITY: number;
+ SVG_FEBLEND_MODE_MULTIPLY: number;
+ SVG_FEBLEND_MODE_NORMAL: number;
+ SVG_FEBLEND_MODE_OVERLAY: number;
+ SVG_FEBLEND_MODE_SATURATION: number;
+ SVG_FEBLEND_MODE_SCREEN: number;
+ SVG_FEBLEND_MODE_SOFT_LIGHT: number;
+ SVG_FEBLEND_MODE_UNKNOWN: number;
+}
+
+interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ in1: SVGAnimatedString;
+ type: SVGAnimatedEnumeration;
+ values: SVGAnimatedNumberList;
+ SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;
+ SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;
+ SVG_FECOLORMATRIX_TYPE_MATRIX: number;
+ SVG_FECOLORMATRIX_TYPE_SATURATE: number;
+ SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEColorMatrixElement: {
+ prototype: SVGFEColorMatrixElement;
+ new(): SVGFEColorMatrixElement;
+ SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;
+ SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;
+ SVG_FECOLORMATRIX_TYPE_MATRIX: number;
+ SVG_FECOLORMATRIX_TYPE_SATURATE: number;
+ SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;
+}
+
+interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ in1: SVGAnimatedString;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEComponentTransferElement: {
+ prototype: SVGFEComponentTransferElement;
+ new(): SVGFEComponentTransferElement;
+}
+
+interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ in1: SVGAnimatedString;
+ in2: SVGAnimatedString;
+ k1: SVGAnimatedNumber;
+ k2: SVGAnimatedNumber;
+ k3: SVGAnimatedNumber;
+ k4: SVGAnimatedNumber;
+ operator: SVGAnimatedEnumeration;
+ SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;
+ SVG_FECOMPOSITE_OPERATOR_ATOP: number;
+ SVG_FECOMPOSITE_OPERATOR_IN: number;
+ SVG_FECOMPOSITE_OPERATOR_OUT: number;
+ SVG_FECOMPOSITE_OPERATOR_OVER: number;
+ SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;
+ SVG_FECOMPOSITE_OPERATOR_XOR: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFECompositeElement: {
+ prototype: SVGFECompositeElement;
+ new(): SVGFECompositeElement;
+ SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;
+ SVG_FECOMPOSITE_OPERATOR_ATOP: number;
+ SVG_FECOMPOSITE_OPERATOR_IN: number;
+ SVG_FECOMPOSITE_OPERATOR_OUT: number;
+ SVG_FECOMPOSITE_OPERATOR_OVER: number;
+ SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;
+ SVG_FECOMPOSITE_OPERATOR_XOR: number;
+}
+
+interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ bias: SVGAnimatedNumber;
+ divisor: SVGAnimatedNumber;
+ edgeMode: SVGAnimatedEnumeration;
+ in1: SVGAnimatedString;
+ kernelMatrix: SVGAnimatedNumberList;
+ kernelUnitLengthX: SVGAnimatedNumber;
+ kernelUnitLengthY: SVGAnimatedNumber;
+ orderX: SVGAnimatedInteger;
+ orderY: SVGAnimatedInteger;
+ preserveAlpha: SVGAnimatedBoolean;
+ targetX: SVGAnimatedInteger;
+ targetY: SVGAnimatedInteger;
+ SVG_EDGEMODE_DUPLICATE: number;
+ SVG_EDGEMODE_NONE: number;
+ SVG_EDGEMODE_UNKNOWN: number;
+ SVG_EDGEMODE_WRAP: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEConvolveMatrixElement: {
+ prototype: SVGFEConvolveMatrixElement;
+ new(): SVGFEConvolveMatrixElement;
+ SVG_EDGEMODE_DUPLICATE: number;
+ SVG_EDGEMODE_NONE: number;
+ SVG_EDGEMODE_UNKNOWN: number;
+ SVG_EDGEMODE_WRAP: number;
+}
+
+interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ diffuseConstant: SVGAnimatedNumber;
+ in1: SVGAnimatedString;
+ kernelUnitLengthX: SVGAnimatedNumber;
+ kernelUnitLengthY: SVGAnimatedNumber;
+ surfaceScale: SVGAnimatedNumber;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEDiffuseLightingElement: {
+ prototype: SVGFEDiffuseLightingElement;
+ new(): SVGFEDiffuseLightingElement;
+}
+
+interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ in1: SVGAnimatedString;
+ in2: SVGAnimatedString;
+ scale: SVGAnimatedNumber;
+ xChannelSelector: SVGAnimatedEnumeration;
+ yChannelSelector: SVGAnimatedEnumeration;
+ SVG_CHANNEL_A: number;
+ SVG_CHANNEL_B: number;
+ SVG_CHANNEL_G: number;
+ SVG_CHANNEL_R: number;
+ SVG_CHANNEL_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEDisplacementMapElement: {
+ prototype: SVGFEDisplacementMapElement;
+ new(): SVGFEDisplacementMapElement;
+ SVG_CHANNEL_A: number;
+ SVG_CHANNEL_B: number;
+ SVG_CHANNEL_G: number;
+ SVG_CHANNEL_R: number;
+ SVG_CHANNEL_UNKNOWN: number;
+}
+
+interface SVGFEDistantLightElement extends SVGElement {
+ azimuth: SVGAnimatedNumber;
+ elevation: SVGAnimatedNumber;
+}
+
+declare var SVGFEDistantLightElement: {
+ prototype: SVGFEDistantLightElement;
+ new(): SVGFEDistantLightElement;
+}
+
+interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEFloodElement: {
+ prototype: SVGFEFloodElement;
+ new(): SVGFEFloodElement;
+}
+
+interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement {
+}
+
+declare var SVGFEFuncAElement: {
+ prototype: SVGFEFuncAElement;
+ new(): SVGFEFuncAElement;
+}
+
+interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement {
+}
+
+declare var SVGFEFuncBElement: {
+ prototype: SVGFEFuncBElement;
+ new(): SVGFEFuncBElement;
+}
+
+interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement {
+}
+
+declare var SVGFEFuncGElement: {
+ prototype: SVGFEFuncGElement;
+ new(): SVGFEFuncGElement;
+}
+
+interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement {
+}
+
+declare var SVGFEFuncRElement: {
+ prototype: SVGFEFuncRElement;
+ new(): SVGFEFuncRElement;
+}
+
+interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ in1: SVGAnimatedString;
+ stdDeviationX: SVGAnimatedNumber;
+ stdDeviationY: SVGAnimatedNumber;
+ setStdDeviation(stdDeviationX: number, stdDeviationY: number): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEGaussianBlurElement: {
+ prototype: SVGFEGaussianBlurElement;
+ new(): SVGFEGaussianBlurElement;
+}
+
+interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired {
+ preserveAspectRatio: SVGAnimatedPreserveAspectRatio;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEImageElement: {
+ prototype: SVGFEImageElement;
+ new(): SVGFEImageElement;
+}
+
+interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEMergeElement: {
+ prototype: SVGFEMergeElement;
+ new(): SVGFEMergeElement;
+}
+
+interface SVGFEMergeNodeElement extends SVGElement {
+ in1: SVGAnimatedString;
+}
+
+declare var SVGFEMergeNodeElement: {
+ prototype: SVGFEMergeNodeElement;
+ new(): SVGFEMergeNodeElement;
+}
+
+interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ in1: SVGAnimatedString;
+ operator: SVGAnimatedEnumeration;
+ radiusX: SVGAnimatedNumber;
+ radiusY: SVGAnimatedNumber;
+ SVG_MORPHOLOGY_OPERATOR_DILATE: number;
+ SVG_MORPHOLOGY_OPERATOR_ERODE: number;
+ SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEMorphologyElement: {
+ prototype: SVGFEMorphologyElement;
+ new(): SVGFEMorphologyElement;
+ SVG_MORPHOLOGY_OPERATOR_DILATE: number;
+ SVG_MORPHOLOGY_OPERATOR_ERODE: number;
+ SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;
+}
+
+interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ dx: SVGAnimatedNumber;
+ dy: SVGAnimatedNumber;
+ in1: SVGAnimatedString;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFEOffsetElement: {
+ prototype: SVGFEOffsetElement;
+ new(): SVGFEOffsetElement;
+}
+
+interface SVGFEPointLightElement extends SVGElement {
+ x: SVGAnimatedNumber;
+ y: SVGAnimatedNumber;
+ z: SVGAnimatedNumber;
+}
+
+declare var SVGFEPointLightElement: {
+ prototype: SVGFEPointLightElement;
+ new(): SVGFEPointLightElement;
+}
+
+interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ in1: SVGAnimatedString;
+ kernelUnitLengthX: SVGAnimatedNumber;
+ kernelUnitLengthY: SVGAnimatedNumber;
+ specularConstant: SVGAnimatedNumber;
+ specularExponent: SVGAnimatedNumber;
+ surfaceScale: SVGAnimatedNumber;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFESpecularLightingElement: {
+ prototype: SVGFESpecularLightingElement;
+ new(): SVGFESpecularLightingElement;
+}
+
+interface SVGFESpotLightElement extends SVGElement {
+ limitingConeAngle: SVGAnimatedNumber;
+ pointsAtX: SVGAnimatedNumber;
+ pointsAtY: SVGAnimatedNumber;
+ pointsAtZ: SVGAnimatedNumber;
+ specularExponent: SVGAnimatedNumber;
+ x: SVGAnimatedNumber;
+ y: SVGAnimatedNumber;
+ z: SVGAnimatedNumber;
+}
+
+declare var SVGFESpotLightElement: {
+ prototype: SVGFESpotLightElement;
+ new(): SVGFESpotLightElement;
+}
+
+interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ in1: SVGAnimatedString;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFETileElement: {
+ prototype: SVGFETileElement;
+ new(): SVGFETileElement;
+}
+
+interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {
+ baseFrequencyX: SVGAnimatedNumber;
+ baseFrequencyY: SVGAnimatedNumber;
+ numOctaves: SVGAnimatedInteger;
+ seed: SVGAnimatedNumber;
+ stitchTiles: SVGAnimatedEnumeration;
+ type: SVGAnimatedEnumeration;
+ SVG_STITCHTYPE_NOSTITCH: number;
+ SVG_STITCHTYPE_STITCH: number;
+ SVG_STITCHTYPE_UNKNOWN: number;
+ SVG_TURBULENCE_TYPE_FRACTALNOISE: number;
+ SVG_TURBULENCE_TYPE_TURBULENCE: number;
+ SVG_TURBULENCE_TYPE_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFETurbulenceElement: {
+ prototype: SVGFETurbulenceElement;
+ new(): SVGFETurbulenceElement;
+ SVG_STITCHTYPE_NOSTITCH: number;
+ SVG_STITCHTYPE_STITCH: number;
+ SVG_STITCHTYPE_UNKNOWN: number;
+ SVG_TURBULENCE_TYPE_FRACTALNOISE: number;
+ SVG_TURBULENCE_TYPE_TURBULENCE: number;
+ SVG_TURBULENCE_TYPE_UNKNOWN: number;
+}
+
+interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired {
+ filterResX: SVGAnimatedInteger;
+ filterResY: SVGAnimatedInteger;
+ filterUnits: SVGAnimatedEnumeration;
+ height: SVGAnimatedLength;
+ primitiveUnits: SVGAnimatedEnumeration;
+ width: SVGAnimatedLength;
+ x: SVGAnimatedLength;
+ y: SVGAnimatedLength;
+ setFilterRes(filterResX: number, filterResY: number): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGFilterElement: {
+ prototype: SVGFilterElement;
+ new(): SVGFilterElement;
+}
+
+interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ height: SVGAnimatedLength;
+ width: SVGAnimatedLength;
+ x: SVGAnimatedLength;
+ y: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGForeignObjectElement: {
+ prototype: SVGForeignObjectElement;
+ new(): SVGForeignObjectElement;
+}
+
+interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGGElement: {
+ prototype: SVGGElement;
+ new(): SVGGElement;
+}
+
+interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes {
+ gradientTransform: SVGAnimatedTransformList;
+ gradientUnits: SVGAnimatedEnumeration;
+ spreadMethod: SVGAnimatedEnumeration;
+ SVG_SPREADMETHOD_PAD: number;
+ SVG_SPREADMETHOD_REFLECT: number;
+ SVG_SPREADMETHOD_REPEAT: number;
+ SVG_SPREADMETHOD_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGGradientElement: {
+ prototype: SVGGradientElement;
+ new(): SVGGradientElement;
+ SVG_SPREADMETHOD_PAD: number;
+ SVG_SPREADMETHOD_REFLECT: number;
+ SVG_SPREADMETHOD_REPEAT: number;
+ SVG_SPREADMETHOD_UNKNOWN: number;
+}
+
+interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference {
+ height: SVGAnimatedLength;
+ preserveAspectRatio: SVGAnimatedPreserveAspectRatio;
+ width: SVGAnimatedLength;
+ x: SVGAnimatedLength;
+ y: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGImageElement: {
+ prototype: SVGImageElement;
+ new(): SVGImageElement;
+}
+
+interface SVGLength {
+ unitType: number;
+ value: number;
+ valueAsString: string;
+ valueInSpecifiedUnits: number;
+ convertToSpecifiedUnits(unitType: number): void;
+ newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;
+ SVG_LENGTHTYPE_CM: number;
+ SVG_LENGTHTYPE_EMS: number;
+ SVG_LENGTHTYPE_EXS: number;
+ SVG_LENGTHTYPE_IN: number;
+ SVG_LENGTHTYPE_MM: number;
+ SVG_LENGTHTYPE_NUMBER: number;
+ SVG_LENGTHTYPE_PC: number;
+ SVG_LENGTHTYPE_PERCENTAGE: number;
+ SVG_LENGTHTYPE_PT: number;
+ SVG_LENGTHTYPE_PX: number;
+ SVG_LENGTHTYPE_UNKNOWN: number;
+}
+
+declare var SVGLength: {
+ prototype: SVGLength;
+ new(): SVGLength;
+ SVG_LENGTHTYPE_CM: number;
+ SVG_LENGTHTYPE_EMS: number;
+ SVG_LENGTHTYPE_EXS: number;
+ SVG_LENGTHTYPE_IN: number;
+ SVG_LENGTHTYPE_MM: number;
+ SVG_LENGTHTYPE_NUMBER: number;
+ SVG_LENGTHTYPE_PC: number;
+ SVG_LENGTHTYPE_PERCENTAGE: number;
+ SVG_LENGTHTYPE_PT: number;
+ SVG_LENGTHTYPE_PX: number;
+ SVG_LENGTHTYPE_UNKNOWN: number;
+}
+
+interface SVGLengthList {
+ numberOfItems: number;
+ appendItem(newItem: SVGLength): SVGLength;
+ clear(): void;
+ getItem(index: number): SVGLength;
+ initialize(newItem: SVGLength): SVGLength;
+ insertItemBefore(newItem: SVGLength, index: number): SVGLength;
+ removeItem(index: number): SVGLength;
+ replaceItem(newItem: SVGLength, index: number): SVGLength;
+}
+
+declare var SVGLengthList: {
+ prototype: SVGLengthList;
+ new(): SVGLengthList;
+}
+
+interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ x1: SVGAnimatedLength;
+ x2: SVGAnimatedLength;
+ y1: SVGAnimatedLength;
+ y2: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGLineElement: {
+ prototype: SVGLineElement;
+ new(): SVGLineElement;
+}
+
+interface SVGLinearGradientElement extends SVGGradientElement {
+ x1: SVGAnimatedLength;
+ x2: SVGAnimatedLength;
+ y1: SVGAnimatedLength;
+ y2: SVGAnimatedLength;
+}
+
+declare var SVGLinearGradientElement: {
+ prototype: SVGLinearGradientElement;
+ new(): SVGLinearGradientElement;
+}
+
+interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox {
+ markerHeight: SVGAnimatedLength;
+ markerUnits: SVGAnimatedEnumeration;
+ markerWidth: SVGAnimatedLength;
+ orientAngle: SVGAnimatedAngle;
+ orientType: SVGAnimatedEnumeration;
+ refX: SVGAnimatedLength;
+ refY: SVGAnimatedLength;
+ setOrientToAngle(angle: SVGAngle): void;
+ setOrientToAuto(): void;
+ SVG_MARKERUNITS_STROKEWIDTH: number;
+ SVG_MARKERUNITS_UNKNOWN: number;
+ SVG_MARKERUNITS_USERSPACEONUSE: number;
+ SVG_MARKER_ORIENT_ANGLE: number;
+ SVG_MARKER_ORIENT_AUTO: number;
+ SVG_MARKER_ORIENT_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGMarkerElement: {
+ prototype: SVGMarkerElement;
+ new(): SVGMarkerElement;
+ SVG_MARKERUNITS_STROKEWIDTH: number;
+ SVG_MARKERUNITS_UNKNOWN: number;
+ SVG_MARKERUNITS_USERSPACEONUSE: number;
+ SVG_MARKER_ORIENT_ANGLE: number;
+ SVG_MARKER_ORIENT_AUTO: number;
+ SVG_MARKER_ORIENT_UNKNOWN: number;
+}
+
+interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes {
+ height: SVGAnimatedLength;
+ maskContentUnits: SVGAnimatedEnumeration;
+ maskUnits: SVGAnimatedEnumeration;
+ width: SVGAnimatedLength;
+ x: SVGAnimatedLength;
+ y: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGMaskElement: {
+ prototype: SVGMaskElement;
+ new(): SVGMaskElement;
+}
+
+interface SVGMatrix {
+ a: number;
+ b: number;
+ c: number;
+ d: number;
+ e: number;
+ f: number;
+ flipX(): SVGMatrix;
+ flipY(): SVGMatrix;
+ inverse(): SVGMatrix;
+ multiply(secondMatrix: SVGMatrix): SVGMatrix;
+ rotate(angle: number): SVGMatrix;
+ rotateFromVector(x: number, y: number): SVGMatrix;
+ scale(scaleFactor: number): SVGMatrix;
+ scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix;
+ skewX(angle: number): SVGMatrix;
+ skewY(angle: number): SVGMatrix;
+ translate(x: number, y: number): SVGMatrix;
+}
+
+declare var SVGMatrix: {
+ prototype: SVGMatrix;
+ new(): SVGMatrix;
+}
+
+interface SVGMetadataElement extends SVGElement {
+}
+
+declare var SVGMetadataElement: {
+ prototype: SVGMetadataElement;
+ new(): SVGMetadataElement;
+}
+
+interface SVGNumber {
+ value: number;
+}
+
+declare var SVGNumber: {
+ prototype: SVGNumber;
+ new(): SVGNumber;
+}
+
+interface SVGNumberList {
+ numberOfItems: number;
+ appendItem(newItem: SVGNumber): SVGNumber;
+ clear(): void;
+ getItem(index: number): SVGNumber;
+ initialize(newItem: SVGNumber): SVGNumber;
+ insertItemBefore(newItem: SVGNumber, index: number): SVGNumber;
+ removeItem(index: number): SVGNumber;
+ replaceItem(newItem: SVGNumber, index: number): SVGNumber;
+}
+
+declare var SVGNumberList: {
+ prototype: SVGNumberList;
+ new(): SVGNumberList;
+}
+
+interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData {
+ createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs;
+ createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel;
+ createSVGPathSegClosePath(): SVGPathSegClosePath;
+ createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs;
+ createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel;
+ createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs;
+ createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel;
+ createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs;
+ createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel;
+ createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs;
+ createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel;
+ createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs;
+ createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs;
+ createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel;
+ createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel;
+ createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs;
+ createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel;
+ createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs;
+ createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel;
+ getPathSegAtLength(distance: number): number;
+ getPointAtLength(distance: number): SVGPoint;
+ getTotalLength(): number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGPathElement: {
+ prototype: SVGPathElement;
+ new(): SVGPathElement;
+}
+
+interface SVGPathSeg {
+ pathSegType: number;
+ pathSegTypeAsLetter: string;
+ PATHSEG_ARC_ABS: number;
+ PATHSEG_ARC_REL: number;
+ PATHSEG_CLOSEPATH: number;
+ PATHSEG_CURVETO_CUBIC_ABS: number;
+ PATHSEG_CURVETO_CUBIC_REL: number;
+ PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;
+ PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;
+ PATHSEG_CURVETO_QUADRATIC_ABS: number;
+ PATHSEG_CURVETO_QUADRATIC_REL: number;
+ PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;
+ PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;
+ PATHSEG_LINETO_ABS: number;
+ PATHSEG_LINETO_HORIZONTAL_ABS: number;
+ PATHSEG_LINETO_HORIZONTAL_REL: number;
+ PATHSEG_LINETO_REL: number;
+ PATHSEG_LINETO_VERTICAL_ABS: number;
+ PATHSEG_LINETO_VERTICAL_REL: number;
+ PATHSEG_MOVETO_ABS: number;
+ PATHSEG_MOVETO_REL: number;
+ PATHSEG_UNKNOWN: number;
+}
+
+declare var SVGPathSeg: {
+ prototype: SVGPathSeg;
+ new(): SVGPathSeg;
+ PATHSEG_ARC_ABS: number;
+ PATHSEG_ARC_REL: number;
+ PATHSEG_CLOSEPATH: number;
+ PATHSEG_CURVETO_CUBIC_ABS: number;
+ PATHSEG_CURVETO_CUBIC_REL: number;
+ PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;
+ PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;
+ PATHSEG_CURVETO_QUADRATIC_ABS: number;
+ PATHSEG_CURVETO_QUADRATIC_REL: number;
+ PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;
+ PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;
+ PATHSEG_LINETO_ABS: number;
+ PATHSEG_LINETO_HORIZONTAL_ABS: number;
+ PATHSEG_LINETO_HORIZONTAL_REL: number;
+ PATHSEG_LINETO_REL: number;
+ PATHSEG_LINETO_VERTICAL_ABS: number;
+ PATHSEG_LINETO_VERTICAL_REL: number;
+ PATHSEG_MOVETO_ABS: number;
+ PATHSEG_MOVETO_REL: number;
+ PATHSEG_UNKNOWN: number;
+}
+
+interface SVGPathSegArcAbs extends SVGPathSeg {
+ angle: number;
+ largeArcFlag: boolean;
+ r1: number;
+ r2: number;
+ sweepFlag: boolean;
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegArcAbs: {
+ prototype: SVGPathSegArcAbs;
+ new(): SVGPathSegArcAbs;
+}
+
+interface SVGPathSegArcRel extends SVGPathSeg {
+ angle: number;
+ largeArcFlag: boolean;
+ r1: number;
+ r2: number;
+ sweepFlag: boolean;
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegArcRel: {
+ prototype: SVGPathSegArcRel;
+ new(): SVGPathSegArcRel;
+}
+
+interface SVGPathSegClosePath extends SVGPathSeg {
+}
+
+declare var SVGPathSegClosePath: {
+ prototype: SVGPathSegClosePath;
+ new(): SVGPathSegClosePath;
+}
+
+interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg {
+ x: number;
+ x1: number;
+ x2: number;
+ y: number;
+ y1: number;
+ y2: number;
+}
+
+declare var SVGPathSegCurvetoCubicAbs: {
+ prototype: SVGPathSegCurvetoCubicAbs;
+ new(): SVGPathSegCurvetoCubicAbs;
+}
+
+interface SVGPathSegCurvetoCubicRel extends SVGPathSeg {
+ x: number;
+ x1: number;
+ x2: number;
+ y: number;
+ y1: number;
+ y2: number;
+}
+
+declare var SVGPathSegCurvetoCubicRel: {
+ prototype: SVGPathSegCurvetoCubicRel;
+ new(): SVGPathSegCurvetoCubicRel;
+}
+
+interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg {
+ x: number;
+ x2: number;
+ y: number;
+ y2: number;
+}
+
+declare var SVGPathSegCurvetoCubicSmoothAbs: {
+ prototype: SVGPathSegCurvetoCubicSmoothAbs;
+ new(): SVGPathSegCurvetoCubicSmoothAbs;
+}
+
+interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg {
+ x: number;
+ x2: number;
+ y: number;
+ y2: number;
+}
+
+declare var SVGPathSegCurvetoCubicSmoothRel: {
+ prototype: SVGPathSegCurvetoCubicSmoothRel;
+ new(): SVGPathSegCurvetoCubicSmoothRel;
+}
+
+interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg {
+ x: number;
+ x1: number;
+ y: number;
+ y1: number;
+}
+
+declare var SVGPathSegCurvetoQuadraticAbs: {
+ prototype: SVGPathSegCurvetoQuadraticAbs;
+ new(): SVGPathSegCurvetoQuadraticAbs;
+}
+
+interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg {
+ x: number;
+ x1: number;
+ y: number;
+ y1: number;
+}
+
+declare var SVGPathSegCurvetoQuadraticRel: {
+ prototype: SVGPathSegCurvetoQuadraticRel;
+ new(): SVGPathSegCurvetoQuadraticRel;
+}
+
+interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg {
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegCurvetoQuadraticSmoothAbs: {
+ prototype: SVGPathSegCurvetoQuadraticSmoothAbs;
+ new(): SVGPathSegCurvetoQuadraticSmoothAbs;
+}
+
+interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg {
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegCurvetoQuadraticSmoothRel: {
+ prototype: SVGPathSegCurvetoQuadraticSmoothRel;
+ new(): SVGPathSegCurvetoQuadraticSmoothRel;
+}
+
+interface SVGPathSegLinetoAbs extends SVGPathSeg {
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegLinetoAbs: {
+ prototype: SVGPathSegLinetoAbs;
+ new(): SVGPathSegLinetoAbs;
+}
+
+interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg {
+ x: number;
+}
+
+declare var SVGPathSegLinetoHorizontalAbs: {
+ prototype: SVGPathSegLinetoHorizontalAbs;
+ new(): SVGPathSegLinetoHorizontalAbs;
+}
+
+interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg {
+ x: number;
+}
+
+declare var SVGPathSegLinetoHorizontalRel: {
+ prototype: SVGPathSegLinetoHorizontalRel;
+ new(): SVGPathSegLinetoHorizontalRel;
+}
+
+interface SVGPathSegLinetoRel extends SVGPathSeg {
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegLinetoRel: {
+ prototype: SVGPathSegLinetoRel;
+ new(): SVGPathSegLinetoRel;
+}
+
+interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg {
+ y: number;
+}
+
+declare var SVGPathSegLinetoVerticalAbs: {
+ prototype: SVGPathSegLinetoVerticalAbs;
+ new(): SVGPathSegLinetoVerticalAbs;
+}
+
+interface SVGPathSegLinetoVerticalRel extends SVGPathSeg {
+ y: number;
+}
+
+declare var SVGPathSegLinetoVerticalRel: {
+ prototype: SVGPathSegLinetoVerticalRel;
+ new(): SVGPathSegLinetoVerticalRel;
+}
+
+interface SVGPathSegList {
+ numberOfItems: number;
+ appendItem(newItem: SVGPathSeg): SVGPathSeg;
+ clear(): void;
+ getItem(index: number): SVGPathSeg;
+ initialize(newItem: SVGPathSeg): SVGPathSeg;
+ insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg;
+ removeItem(index: number): SVGPathSeg;
+ replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg;
+}
+
+declare var SVGPathSegList: {
+ prototype: SVGPathSegList;
+ new(): SVGPathSegList;
+}
+
+interface SVGPathSegMovetoAbs extends SVGPathSeg {
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegMovetoAbs: {
+ prototype: SVGPathSegMovetoAbs;
+ new(): SVGPathSegMovetoAbs;
+}
+
+interface SVGPathSegMovetoRel extends SVGPathSeg {
+ x: number;
+ y: number;
+}
+
+declare var SVGPathSegMovetoRel: {
+ prototype: SVGPathSegMovetoRel;
+ new(): SVGPathSegMovetoRel;
+}
+
+interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes {
+ height: SVGAnimatedLength;
+ patternContentUnits: SVGAnimatedEnumeration;
+ patternTransform: SVGAnimatedTransformList;
+ patternUnits: SVGAnimatedEnumeration;
+ width: SVGAnimatedLength;
+ x: SVGAnimatedLength;
+ y: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGPatternElement: {
+ prototype: SVGPatternElement;
+ new(): SVGPatternElement;
+}
+
+interface SVGPoint {
+ x: number;
+ y: number;
+ matrixTransform(matrix: SVGMatrix): SVGPoint;
+}
+
+declare var SVGPoint: {
+ prototype: SVGPoint;
+ new(): SVGPoint;
+}
+
+interface SVGPointList {
+ numberOfItems: number;
+ appendItem(newItem: SVGPoint): SVGPoint;
+ clear(): void;
+ getItem(index: number): SVGPoint;
+ initialize(newItem: SVGPoint): SVGPoint;
+ insertItemBefore(newItem: SVGPoint, index: number): SVGPoint;
+ removeItem(index: number): SVGPoint;
+ replaceItem(newItem: SVGPoint, index: number): SVGPoint;
+}
+
+declare var SVGPointList: {
+ prototype: SVGPointList;
+ new(): SVGPointList;
+}
+
+interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGPolygonElement: {
+ prototype: SVGPolygonElement;
+ new(): SVGPolygonElement;
+}
+
+interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGPolylineElement: {
+ prototype: SVGPolylineElement;
+ new(): SVGPolylineElement;
+}
+
+interface SVGPreserveAspectRatio {
+ align: number;
+ meetOrSlice: number;
+ SVG_MEETORSLICE_MEET: number;
+ SVG_MEETORSLICE_SLICE: number;
+ SVG_MEETORSLICE_UNKNOWN: number;
+ SVG_PRESERVEASPECTRATIO_NONE: number;
+ SVG_PRESERVEASPECTRATIO_UNKNOWN: number;
+ SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;
+ SVG_PRESERVEASPECTRATIO_XMAXYMID: number;
+ SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;
+ SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;
+ SVG_PRESERVEASPECTRATIO_XMIDYMID: number;
+ SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;
+ SVG_PRESERVEASPECTRATIO_XMINYMAX: number;
+ SVG_PRESERVEASPECTRATIO_XMINYMID: number;
+ SVG_PRESERVEASPECTRATIO_XMINYMIN: number;
+}
+
+declare var SVGPreserveAspectRatio: {
+ prototype: SVGPreserveAspectRatio;
+ new(): SVGPreserveAspectRatio;
+ SVG_MEETORSLICE_MEET: number;
+ SVG_MEETORSLICE_SLICE: number;
+ SVG_MEETORSLICE_UNKNOWN: number;
+ SVG_PRESERVEASPECTRATIO_NONE: number;
+ SVG_PRESERVEASPECTRATIO_UNKNOWN: number;
+ SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;
+ SVG_PRESERVEASPECTRATIO_XMAXYMID: number;
+ SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;
+ SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;
+ SVG_PRESERVEASPECTRATIO_XMIDYMID: number;
+ SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;
+ SVG_PRESERVEASPECTRATIO_XMINYMAX: number;
+ SVG_PRESERVEASPECTRATIO_XMINYMID: number;
+ SVG_PRESERVEASPECTRATIO_XMINYMIN: number;
+}
+
+interface SVGRadialGradientElement extends SVGGradientElement {
+ cx: SVGAnimatedLength;
+ cy: SVGAnimatedLength;
+ fx: SVGAnimatedLength;
+ fy: SVGAnimatedLength;
+ r: SVGAnimatedLength;
+}
+
+declare var SVGRadialGradientElement: {
+ prototype: SVGRadialGradientElement;
+ new(): SVGRadialGradientElement;
+}
+
+interface SVGRect {
+ height: number;
+ width: number;
+ x: number;
+ y: number;
+}
+
+declare var SVGRect: {
+ prototype: SVGRect;
+ new(): SVGRect;
+}
+
+interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ height: SVGAnimatedLength;
+ rx: SVGAnimatedLength;
+ ry: SVGAnimatedLength;
+ width: SVGAnimatedLength;
+ x: SVGAnimatedLength;
+ y: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGRectElement: {
+ prototype: SVGRectElement;
+ new(): SVGRectElement;
+}
+
+interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan {
+ contentScriptType: string;
+ contentStyleType: string;
+ currentScale: number;
+ currentTranslate: SVGPoint;
+ height: SVGAnimatedLength;
+ onabort: (ev: Event) => any;
+ onerror: (ev: Event) => any;
+ onresize: (ev: UIEvent) => any;
+ onscroll: (ev: UIEvent) => any;
+ onunload: (ev: Event) => any;
+ onzoom: (ev: SVGZoomEvent) => any;
+ pixelUnitToMillimeterX: number;
+ pixelUnitToMillimeterY: number;
+ screenPixelToMillimeterX: number;
+ screenPixelToMillimeterY: number;
+ viewport: SVGRect;
+ width: SVGAnimatedLength;
+ x: SVGAnimatedLength;
+ y: SVGAnimatedLength;
+ checkEnclosure(element: SVGElement, rect: SVGRect): boolean;
+ checkIntersection(element: SVGElement, rect: SVGRect): boolean;
+ createSVGAngle(): SVGAngle;
+ createSVGLength(): SVGLength;
+ createSVGMatrix(): SVGMatrix;
+ createSVGNumber(): SVGNumber;
+ createSVGPoint(): SVGPoint;
+ createSVGRect(): SVGRect;
+ createSVGTransform(): SVGTransform;
+ createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;
+ deselectAll(): void;
+ forceRedraw(): void;
+ getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;
+ getCurrentTime(): number;
+ getElementById(elementId: string): Element;
+ getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList;
+ getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList;
+ pauseAnimations(): void;
+ setCurrentTime(seconds: number): void;
+ suspendRedraw(maxWaitMilliseconds: number): number;
+ unpauseAnimations(): void;
+ unsuspendRedraw(suspendHandleID: number): void;
+ unsuspendRedrawAll(): void;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "SVGAbort", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "SVGError", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "SVGUnload", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "SVGZoom", listener: (ev: SVGZoomEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGSVGElement: {
+ prototype: SVGSVGElement;
+ new(): SVGSVGElement;
+}
+
+interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference {
+ type: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGScriptElement: {
+ prototype: SVGScriptElement;
+ new(): SVGScriptElement;
+}
+
+interface SVGStopElement extends SVGElement, SVGStylable {
+ offset: SVGAnimatedNumber;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGStopElement: {
+ prototype: SVGStopElement;
+ new(): SVGStopElement;
+}
+
+interface SVGStringList {
+ numberOfItems: number;
+ appendItem(newItem: string): string;
+ clear(): void;
+ getItem(index: number): string;
+ initialize(newItem: string): string;
+ insertItemBefore(newItem: string, index: number): string;
+ removeItem(index: number): string;
+ replaceItem(newItem: string, index: number): string;
+}
+
+declare var SVGStringList: {
+ prototype: SVGStringList;
+ new(): SVGStringList;
+}
+
+interface SVGStyleElement extends SVGElement, SVGLangSpace {
+ media: string;
+ title: string;
+ type: string;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGStyleElement: {
+ prototype: SVGStyleElement;
+ new(): SVGStyleElement;
+}
+
+interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGSwitchElement: {
+ prototype: SVGSwitchElement;
+ new(): SVGSwitchElement;
+}
+
+interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGSymbolElement: {
+ prototype: SVGSymbolElement;
+ new(): SVGSymbolElement;
+}
+
+interface SVGTSpanElement extends SVGTextPositioningElement {
+}
+
+declare var SVGTSpanElement: {
+ prototype: SVGTSpanElement;
+ new(): SVGTSpanElement;
+}
+
+interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired {
+ lengthAdjust: SVGAnimatedEnumeration;
+ textLength: SVGAnimatedLength;
+ getCharNumAtPosition(point: SVGPoint): number;
+ getComputedTextLength(): number;
+ getEndPositionOfChar(charnum: number): SVGPoint;
+ getExtentOfChar(charnum: number): SVGRect;
+ getNumberOfChars(): number;
+ getRotationOfChar(charnum: number): number;
+ getStartPositionOfChar(charnum: number): SVGPoint;
+ getSubStringLength(charnum: number, nchars: number): number;
+ selectSubString(charnum: number, nchars: number): void;
+ LENGTHADJUST_SPACING: number;
+ LENGTHADJUST_SPACINGANDGLYPHS: number;
+ LENGTHADJUST_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGTextContentElement: {
+ prototype: SVGTextContentElement;
+ new(): SVGTextContentElement;
+ LENGTHADJUST_SPACING: number;
+ LENGTHADJUST_SPACINGANDGLYPHS: number;
+ LENGTHADJUST_UNKNOWN: number;
+}
+
+interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGTextElement: {
+ prototype: SVGTextElement;
+ new(): SVGTextElement;
+}
+
+interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference {
+ method: SVGAnimatedEnumeration;
+ spacing: SVGAnimatedEnumeration;
+ startOffset: SVGAnimatedLength;
+ TEXTPATH_METHODTYPE_ALIGN: number;
+ TEXTPATH_METHODTYPE_STRETCH: number;
+ TEXTPATH_METHODTYPE_UNKNOWN: number;
+ TEXTPATH_SPACINGTYPE_AUTO: number;
+ TEXTPATH_SPACINGTYPE_EXACT: number;
+ TEXTPATH_SPACINGTYPE_UNKNOWN: number;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGTextPathElement: {
+ prototype: SVGTextPathElement;
+ new(): SVGTextPathElement;
+ TEXTPATH_METHODTYPE_ALIGN: number;
+ TEXTPATH_METHODTYPE_STRETCH: number;
+ TEXTPATH_METHODTYPE_UNKNOWN: number;
+ TEXTPATH_SPACINGTYPE_AUTO: number;
+ TEXTPATH_SPACINGTYPE_EXACT: number;
+ TEXTPATH_SPACINGTYPE_UNKNOWN: number;
+}
+
+interface SVGTextPositioningElement extends SVGTextContentElement {
+ dx: SVGAnimatedLengthList;
+ dy: SVGAnimatedLengthList;
+ rotate: SVGAnimatedNumberList;
+ x: SVGAnimatedLengthList;
+ y: SVGAnimatedLengthList;
+}
+
+declare var SVGTextPositioningElement: {
+ prototype: SVGTextPositioningElement;
+ new(): SVGTextPositioningElement;
+}
+
+interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGTitleElement: {
+ prototype: SVGTitleElement;
+ new(): SVGTitleElement;
+}
+
+interface SVGTransform {
+ angle: number;
+ matrix: SVGMatrix;
+ type: number;
+ setMatrix(matrix: SVGMatrix): void;
+ setRotate(angle: number, cx: number, cy: number): void;
+ setScale(sx: number, sy: number): void;
+ setSkewX(angle: number): void;
+ setSkewY(angle: number): void;
+ setTranslate(tx: number, ty: number): void;
+ SVG_TRANSFORM_MATRIX: number;
+ SVG_TRANSFORM_ROTATE: number;
+ SVG_TRANSFORM_SCALE: number;
+ SVG_TRANSFORM_SKEWX: number;
+ SVG_TRANSFORM_SKEWY: number;
+ SVG_TRANSFORM_TRANSLATE: number;
+ SVG_TRANSFORM_UNKNOWN: number;
+}
+
+declare var SVGTransform: {
+ prototype: SVGTransform;
+ new(): SVGTransform;
+ SVG_TRANSFORM_MATRIX: number;
+ SVG_TRANSFORM_ROTATE: number;
+ SVG_TRANSFORM_SCALE: number;
+ SVG_TRANSFORM_SKEWX: number;
+ SVG_TRANSFORM_SKEWY: number;
+ SVG_TRANSFORM_TRANSLATE: number;
+ SVG_TRANSFORM_UNKNOWN: number;
+}
+
+interface SVGTransformList {
+ numberOfItems: number;
+ appendItem(newItem: SVGTransform): SVGTransform;
+ clear(): void;
+ consolidate(): SVGTransform;
+ createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;
+ getItem(index: number): SVGTransform;
+ initialize(newItem: SVGTransform): SVGTransform;
+ insertItemBefore(newItem: SVGTransform, index: number): SVGTransform;
+ removeItem(index: number): SVGTransform;
+ replaceItem(newItem: SVGTransform, index: number): SVGTransform;
+}
+
+declare var SVGTransformList: {
+ prototype: SVGTransformList;
+ new(): SVGTransformList;
+}
+
+interface SVGUnitTypes {
+ SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number;
+ SVG_UNIT_TYPE_UNKNOWN: number;
+ SVG_UNIT_TYPE_USERSPACEONUSE: number;
+}
+declare var SVGUnitTypes: SVGUnitTypes;
+
+interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference {
+ animatedInstanceRoot: SVGElementInstance;
+ height: SVGAnimatedLength;
+ instanceRoot: SVGElementInstance;
+ width: SVGAnimatedLength;
+ x: SVGAnimatedLength;
+ y: SVGAnimatedLength;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGUseElement: {
+ prototype: SVGUseElement;
+ new(): SVGUseElement;
+}
+
+interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan {
+ viewTarget: SVGStringList;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var SVGViewElement: {
+ prototype: SVGViewElement;
+ new(): SVGViewElement;
+}
+
+interface SVGZoomAndPan {
+ SVG_ZOOMANDPAN_DISABLE: number;
+ SVG_ZOOMANDPAN_MAGNIFY: number;
+ SVG_ZOOMANDPAN_UNKNOWN: number;
+}
+declare var SVGZoomAndPan: SVGZoomAndPan;
+
+interface SVGZoomEvent extends UIEvent {
+ newScale: number;
+ newTranslate: SVGPoint;
+ previousScale: number;
+ previousTranslate: SVGPoint;
+ zoomRectScreen: SVGRect;
+}
+
+declare var SVGZoomEvent: {
+ prototype: SVGZoomEvent;
+ new(): SVGZoomEvent;
+}
+
+interface Screen extends EventTarget {
+ availHeight: number;
+ availWidth: number;
+ bufferDepth: number;
+ colorDepth: number;
+ deviceXDPI: number;
+ deviceYDPI: number;
+ fontSmoothingEnabled: boolean;
+ height: number;
+ logicalXDPI: number;
+ logicalYDPI: number;
+ msOrientation: string;
+ onmsorientationchange: (ev: Event) => any;
+ pixelDepth: number;
+ systemXDPI: number;
+ systemYDPI: number;
+ width: number;
+ msLockOrientation(orientations: string | string[]): boolean;
+ msUnlockOrientation(): void;
+ addEventListener(type: "MSOrientationChange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var Screen: {
+ prototype: Screen;
+ new(): Screen;
+}
+
+interface ScriptNotifyEvent extends Event {
+ callingUri: string;
+ value: string;
+}
+
+declare var ScriptNotifyEvent: {
+ prototype: ScriptNotifyEvent;
+ new(): ScriptNotifyEvent;
+}
+
+interface ScriptProcessorNode extends AudioNode {
+ bufferSize: number;
+ onaudioprocess: (ev: AudioProcessingEvent) => any;
+ addEventListener(type: "audioprocess", listener: (ev: AudioProcessingEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var ScriptProcessorNode: {
+ prototype: ScriptProcessorNode;
+ new(): ScriptProcessorNode;
+}
+
+interface Selection {
+ anchorNode: Node;
+ anchorOffset: number;
+ focusNode: Node;
+ focusOffset: number;
+ isCollapsed: boolean;
+ rangeCount: number;
+ type: string;
+ addRange(range: Range): void;
+ collapse(parentNode: Node, offset: number): void;
+ collapseToEnd(): void;
+ collapseToStart(): void;
+ containsNode(node: Node, partlyContained: boolean): boolean;
+ deleteFromDocument(): void;
+ empty(): void;
+ extend(newNode: Node, offset: number): void;
+ getRangeAt(index: number): Range;
+ removeAllRanges(): void;
+ removeRange(range: Range): void;
+ selectAllChildren(parentNode: Node): void;
+ setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void;
+ toString(): string;
+}
+
+declare var Selection: {
+ prototype: Selection;
+ new(): Selection;
+}
+
+interface SourceBuffer extends EventTarget {
+ appendWindowEnd: number;
+ appendWindowStart: number;
+ audioTracks: AudioTrackList;
+ buffered: TimeRanges;
+ mode: string;
+ timestampOffset: number;
+ updating: boolean;
+ videoTracks: VideoTrackList;
+ abort(): void;
+ appendBuffer(data: ArrayBuffer | ArrayBufferView): void;
+ appendStream(stream: MSStream, maxSize?: number): void;
+ remove(start: number, end: number): void;
+}
+
+declare var SourceBuffer: {
+ prototype: SourceBuffer;
+ new(): SourceBuffer;
+}
+
+interface SourceBufferList extends EventTarget {
+ length: number;
+ item(index: number): SourceBuffer;
+ [index: number]: SourceBuffer;
+}
+
+declare var SourceBufferList: {
+ prototype: SourceBufferList;
+ new(): SourceBufferList;
+}
+
+interface StereoPannerNode extends AudioNode {
+ pan: AudioParam;
+}
+
+declare var StereoPannerNode: {
+ prototype: StereoPannerNode;
+ new(): StereoPannerNode;
+}
+
+interface Storage {
+ length: number;
+ clear(): void;
+ getItem(key: string): any;
+ key(index: number): string;
+ removeItem(key: string): void;
+ setItem(key: string, data: string): void;
+ [key: string]: any;
+ [index: number]: string;
+}
+
+declare var Storage: {
+ prototype: Storage;
+ new(): Storage;
+}
+
+interface StorageEvent extends Event {
+ key: string;
+ newValue: any;
+ oldValue: any;
+ storageArea: Storage;
+ url: string;
+ initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void;
+}
+
+declare var StorageEvent: {
+ prototype: StorageEvent;
+ new(): StorageEvent;
+}
+
+interface StyleMedia {
+ type: string;
+ matchMedium(mediaquery: string): boolean;
+}
+
+declare var StyleMedia: {
+ prototype: StyleMedia;
+ new(): StyleMedia;
+}
+
+interface StyleSheet {
+ disabled: boolean;
+ href: string;
+ media: MediaList;
+ ownerNode: Node;
+ parentStyleSheet: StyleSheet;
+ title: string;
+ type: string;
+}
+
+declare var StyleSheet: {
+ prototype: StyleSheet;
+ new(): StyleSheet;
+}
+
+interface StyleSheetList {
+ length: number;
+ item(index?: number): StyleSheet;
+ [index: number]: StyleSheet;
+}
+
+declare var StyleSheetList: {
+ prototype: StyleSheetList;
+ new(): StyleSheetList;
+}
+
+interface StyleSheetPageList {
+ length: number;
+ item(index: number): CSSPageRule;
+ [index: number]: CSSPageRule;
+}
+
+declare var StyleSheetPageList: {
+ prototype: StyleSheetPageList;
+ new(): StyleSheetPageList;
+}
+
+interface SubtleCrypto {
+ decrypt(algorithm: string | Algorithm, key: CryptoKey, data: ArrayBufferView): any;
+ deriveBits(algorithm: string | Algorithm, baseKey: CryptoKey, length: number): any;
+ deriveKey(algorithm: string | Algorithm, baseKey: CryptoKey, derivedKeyType: string | Algorithm, extractable: boolean, keyUsages: string[]): any;
+ digest(algorithm: string | Algorithm, data: ArrayBufferView): any;
+ encrypt(algorithm: string | Algorithm, key: CryptoKey, data: ArrayBufferView): any;
+ exportKey(format: string, key: CryptoKey): any;
+ generateKey(algorithm: string | Algorithm, extractable: boolean, keyUsages: string[]): any;
+ importKey(format: string, keyData: ArrayBufferView, algorithm: string | Algorithm, extractable: boolean, keyUsages: string[]): any;
+ sign(algorithm: string | Algorithm, key: CryptoKey, data: ArrayBufferView): any;
+ unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string | Algorithm, unwrappedKeyAlgorithm: string | Algorithm, extractable: boolean, keyUsages: string[]): any;
+ verify(algorithm: string | Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any;
+ wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | Algorithm): any;
+}
+
+declare var SubtleCrypto: {
+ prototype: SubtleCrypto;
+ new(): SubtleCrypto;
+}
+
+interface Text extends CharacterData {
+ wholeText: string;
+ replaceWholeText(content: string): Text;
+ splitText(offset: number): Text;
+}
+
+declare var Text: {
+ prototype: Text;
+ new(): Text;
+}
+
+interface TextEvent extends UIEvent {
+ data: string;
+ inputMethod: number;
+ locale: string;
+ initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void;
+ DOM_INPUT_METHOD_DROP: number;
+ DOM_INPUT_METHOD_HANDWRITING: number;
+ DOM_INPUT_METHOD_IME: number;
+ DOM_INPUT_METHOD_KEYBOARD: number;
+ DOM_INPUT_METHOD_MULTIMODAL: number;
+ DOM_INPUT_METHOD_OPTION: number;
+ DOM_INPUT_METHOD_PASTE: number;
+ DOM_INPUT_METHOD_SCRIPT: number;
+ DOM_INPUT_METHOD_UNKNOWN: number;
+ DOM_INPUT_METHOD_VOICE: number;
+}
+
+declare var TextEvent: {
+ prototype: TextEvent;
+ new(): TextEvent;
+ DOM_INPUT_METHOD_DROP: number;
+ DOM_INPUT_METHOD_HANDWRITING: number;
+ DOM_INPUT_METHOD_IME: number;
+ DOM_INPUT_METHOD_KEYBOARD: number;
+ DOM_INPUT_METHOD_MULTIMODAL: number;
+ DOM_INPUT_METHOD_OPTION: number;
+ DOM_INPUT_METHOD_PASTE: number;
+ DOM_INPUT_METHOD_SCRIPT: number;
+ DOM_INPUT_METHOD_UNKNOWN: number;
+ DOM_INPUT_METHOD_VOICE: number;
+}
+
+interface TextMetrics {
+ width: number;
+}
+
+declare var TextMetrics: {
+ prototype: TextMetrics;
+ new(): TextMetrics;
+}
+
+interface TextRange {
+ boundingHeight: number;
+ boundingLeft: number;
+ boundingTop: number;
+ boundingWidth: number;
+ htmlText: string;
+ offsetLeft: number;
+ offsetTop: number;
+ text: string;
+ collapse(start?: boolean): void;
+ compareEndPoints(how: string, sourceRange: TextRange): number;
+ duplicate(): TextRange;
+ execCommand(cmdID: string, showUI?: boolean, value?: any): boolean;
+ execCommandShowHelp(cmdID: string): boolean;
+ expand(Unit: string): boolean;
+ findText(string: string, count?: number, flags?: number): boolean;
+ getBookmark(): string;
+ getBoundingClientRect(): ClientRect;
+ getClientRects(): ClientRectList;
+ inRange(range: TextRange): boolean;
+ isEqual(range: TextRange): boolean;
+ move(unit: string, count?: number): number;
+ moveEnd(unit: string, count?: number): number;
+ moveStart(unit: string, count?: number): number;
+ moveToBookmark(bookmark: string): boolean;
+ moveToElementText(element: Element): void;
+ moveToPoint(x: number, y: number): void;
+ parentElement(): Element;
+ pasteHTML(html: string): void;
+ queryCommandEnabled(cmdID: string): boolean;
+ queryCommandIndeterm(cmdID: string): boolean;
+ queryCommandState(cmdID: string): boolean;
+ queryCommandSupported(cmdID: string): boolean;
+ queryCommandText(cmdID: string): string;
+ queryCommandValue(cmdID: string): any;
+ scrollIntoView(fStart?: boolean): void;
+ select(): void;
+ setEndPoint(how: string, SourceRange: TextRange): void;
+}
+
+declare var TextRange: {
+ prototype: TextRange;
+ new(): TextRange;
+}
+
+interface TextRangeCollection {
+ length: number;
+ item(index: number): TextRange;
+ [index: number]: TextRange;
+}
+
+declare var TextRangeCollection: {
+ prototype: TextRangeCollection;
+ new(): TextRangeCollection;
+}
+
+interface TextTrack extends EventTarget {
+ activeCues: TextTrackCueList;
+ cues: TextTrackCueList;
+ inBandMetadataTrackDispatchType: string;
+ kind: string;
+ label: string;
+ language: string;
+ mode: any;
+ oncuechange: (ev: Event) => any;
+ onerror: (ev: Event) => any;
+ onload: (ev: Event) => any;
+ readyState: number;
+ addCue(cue: TextTrackCue): void;
+ removeCue(cue: TextTrackCue): void;
+ DISABLED: number;
+ ERROR: number;
+ HIDDEN: number;
+ LOADED: number;
+ LOADING: number;
+ NONE: number;
+ SHOWING: number;
+ addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var TextTrack: {
+ prototype: TextTrack;
+ new(): TextTrack;
+ DISABLED: number;
+ ERROR: number;
+ HIDDEN: number;
+ LOADED: number;
+ LOADING: number;
+ NONE: number;
+ SHOWING: number;
+}
+
+interface TextTrackCue extends EventTarget {
+ endTime: number;
+ id: string;
+ onenter: (ev: Event) => any;
+ onexit: (ev: Event) => any;
+ pauseOnExit: boolean;
+ startTime: number;
+ text: string;
+ track: TextTrack;
+ getCueAsHTML(): DocumentFragment;
+ addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var TextTrackCue: {
+ prototype: TextTrackCue;
+ new(startTime: number, endTime: number, text: string): TextTrackCue;
+}
+
+interface TextTrackCueList {
+ length: number;
+ getCueById(id: string): TextTrackCue;
+ item(index: number): TextTrackCue;
+ [index: number]: TextTrackCue;
+}
+
+declare var TextTrackCueList: {
+ prototype: TextTrackCueList;
+ new(): TextTrackCueList;
+}
+
+interface TextTrackList extends EventTarget {
+ length: number;
+ onaddtrack: (ev: TrackEvent) => any;
+ item(index: number): TextTrack;
+ addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+ [index: number]: TextTrack;
+}
+
+declare var TextTrackList: {
+ prototype: TextTrackList;
+ new(): TextTrackList;
+}
+
+interface TimeRanges {
+ length: number;
+ end(index: number): number;
+ start(index: number): number;
+}
+
+declare var TimeRanges: {
+ prototype: TimeRanges;
+ new(): TimeRanges;
+}
+
+interface Touch {
+ clientX: number;
+ clientY: number;
+ identifier: number;
+ pageX: number;
+ pageY: number;
+ screenX: number;
+ screenY: number;
+ target: EventTarget;
+}
+
+declare var Touch: {
+ prototype: Touch;
+ new(): Touch;
+}
+
+interface TouchEvent extends UIEvent {
+ altKey: boolean;
+ changedTouches: TouchList;
+ ctrlKey: boolean;
+ metaKey: boolean;
+ shiftKey: boolean;
+ targetTouches: TouchList;
+ touches: TouchList;
+}
+
+declare var TouchEvent: {
+ prototype: TouchEvent;
+ new(): TouchEvent;
+}
+
+interface TouchList {
+ length: number;
+ item(index: number): Touch;
+ [index: number]: Touch;
+}
+
+declare var TouchList: {
+ prototype: TouchList;
+ new(): TouchList;
+}
+
+interface TrackEvent extends Event {
+ track: any;
+}
+
+declare var TrackEvent: {
+ prototype: TrackEvent;
+ new(): TrackEvent;
+}
+
+interface TransitionEvent extends Event {
+ elapsedTime: number;
+ propertyName: string;
+ initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void;
+}
+
+declare var TransitionEvent: {
+ prototype: TransitionEvent;
+ new(): TransitionEvent;
+}
+
+interface TreeWalker {
+ currentNode: Node;
+ expandEntityReferences: boolean;
+ filter: NodeFilter;
+ root: Node;
+ whatToShow: number;
+ firstChild(): Node;
+ lastChild(): Node;
+ nextNode(): Node;
+ nextSibling(): Node;
+ parentNode(): Node;
+ previousNode(): Node;
+ previousSibling(): Node;
+}
+
+declare var TreeWalker: {
+ prototype: TreeWalker;
+ new(): TreeWalker;
+}
+
+interface UIEvent extends Event {
+ detail: number;
+ view: Window;
+ initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void;
+}
+
+declare var UIEvent: {
+ prototype: UIEvent;
+ new(type: string, eventInitDict?: UIEventInit): UIEvent;
+}
+
+interface URL {
+ createObjectURL(object: any, options?: ObjectURLOptions): string;
+ revokeObjectURL(url: string): void;
+}
+declare var URL: URL;
+
+interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer {
+ mediaType: string;
+}
+
+declare var UnviewableContentIdentifiedEvent: {
+ prototype: UnviewableContentIdentifiedEvent;
+ new(): UnviewableContentIdentifiedEvent;
+}
+
+interface ValidityState {
+ badInput: boolean;
+ customError: boolean;
+ patternMismatch: boolean;
+ rangeOverflow: boolean;
+ rangeUnderflow: boolean;
+ stepMismatch: boolean;
+ tooLong: boolean;
+ typeMismatch: boolean;
+ valid: boolean;
+ valueMissing: boolean;
+}
+
+declare var ValidityState: {
+ prototype: ValidityState;
+ new(): ValidityState;
+}
+
+interface VideoPlaybackQuality {
+ corruptedVideoFrames: number;
+ creationTime: number;
+ droppedVideoFrames: number;
+ totalFrameDelay: number;
+ totalVideoFrames: number;
+}
+
+declare var VideoPlaybackQuality: {
+ prototype: VideoPlaybackQuality;
+ new(): VideoPlaybackQuality;
+}
+
+interface VideoTrack {
+ id: string;
+ kind: string;
+ label: string;
+ language: string;
+ selected: boolean;
+ sourceBuffer: SourceBuffer;
+}
+
+declare var VideoTrack: {
+ prototype: VideoTrack;
+ new(): VideoTrack;
+}
+
+interface VideoTrackList extends EventTarget {
+ length: number;
+ onaddtrack: (ev: TrackEvent) => any;
+ onchange: (ev: Event) => any;
+ onremovetrack: (ev: TrackEvent) => any;
+ selectedIndex: number;
+ getTrackById(id: string): VideoTrack;
+ item(index: number): VideoTrack;
+ addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+ [index: number]: VideoTrack;
+}
+
+declare var VideoTrackList: {
+ prototype: VideoTrackList;
+ new(): VideoTrackList;
+}
+
+interface WEBGL_compressed_texture_s3tc {
+ COMPRESSED_RGBA_S3TC_DXT1_EXT: number;
+ COMPRESSED_RGBA_S3TC_DXT3_EXT: number;
+ COMPRESSED_RGBA_S3TC_DXT5_EXT: number;
+ COMPRESSED_RGB_S3TC_DXT1_EXT: number;
+}
+
+declare var WEBGL_compressed_texture_s3tc: {
+ prototype: WEBGL_compressed_texture_s3tc;
+ new(): WEBGL_compressed_texture_s3tc;
+ COMPRESSED_RGBA_S3TC_DXT1_EXT: number;
+ COMPRESSED_RGBA_S3TC_DXT3_EXT: number;
+ COMPRESSED_RGBA_S3TC_DXT5_EXT: number;
+ COMPRESSED_RGB_S3TC_DXT1_EXT: number;
+}
+
+interface WEBGL_debug_renderer_info {
+ UNMASKED_RENDERER_WEBGL: number;
+ UNMASKED_VENDOR_WEBGL: number;
+}
+
+declare var WEBGL_debug_renderer_info: {
+ prototype: WEBGL_debug_renderer_info;
+ new(): WEBGL_debug_renderer_info;
+ UNMASKED_RENDERER_WEBGL: number;
+ UNMASKED_VENDOR_WEBGL: number;
+}
+
+interface WEBGL_depth_texture {
+ UNSIGNED_INT_24_8_WEBGL: number;
+}
+
+declare var WEBGL_depth_texture: {
+ prototype: WEBGL_depth_texture;
+ new(): WEBGL_depth_texture;
+ UNSIGNED_INT_24_8_WEBGL: number;
+}
+
+interface WaveShaperNode extends AudioNode {
+ curve: Float32Array;
+ oversample: string;
+}
+
+declare var WaveShaperNode: {
+ prototype: WaveShaperNode;
+ new(): WaveShaperNode;
+}
+
+interface WebGLActiveInfo {
+ name: string;
+ size: number;
+ type: number;
+}
+
+declare var WebGLActiveInfo: {
+ prototype: WebGLActiveInfo;
+ new(): WebGLActiveInfo;
+}
+
+interface WebGLBuffer extends WebGLObject {
+}
+
+declare var WebGLBuffer: {
+ prototype: WebGLBuffer;
+ new(): WebGLBuffer;
+}
+
+interface WebGLContextEvent extends Event {
+ statusMessage: string;
+}
+
+declare var WebGLContextEvent: {
+ prototype: WebGLContextEvent;
+ new(): WebGLContextEvent;
+}
+
+interface WebGLFramebuffer extends WebGLObject {
+}
+
+declare var WebGLFramebuffer: {
+ prototype: WebGLFramebuffer;
+ new(): WebGLFramebuffer;
+}
+
+interface WebGLObject {
+}
+
+declare var WebGLObject: {
+ prototype: WebGLObject;
+ new(): WebGLObject;
+}
+
+interface WebGLProgram extends WebGLObject {
+}
+
+declare var WebGLProgram: {
+ prototype: WebGLProgram;
+ new(): WebGLProgram;
+}
+
+interface WebGLRenderbuffer extends WebGLObject {
+}
+
+declare var WebGLRenderbuffer: {
+ prototype: WebGLRenderbuffer;
+ new(): WebGLRenderbuffer;
+}
+
+interface WebGLRenderingContext {
+ canvas: HTMLCanvasElement;
+ drawingBufferHeight: number;
+ drawingBufferWidth: number;
+ activeTexture(texture: number): void;
+ attachShader(program: WebGLProgram, shader: WebGLShader): void;
+ bindAttribLocation(program: WebGLProgram, index: number, name: string): void;
+ bindBuffer(target: number, buffer: WebGLBuffer): void;
+ bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void;
+ bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void;
+ bindTexture(target: number, texture: WebGLTexture): void;
+ blendColor(red: number, green: number, blue: number, alpha: number): void;
+ blendEquation(mode: number): void;
+ blendEquationSeparate(modeRGB: number, modeAlpha: number): void;
+ blendFunc(sfactor: number, dfactor: number): void;
+ blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void;
+ bufferData(target: number, size: number | ArrayBufferView | ArrayBuffer, usage: number): void;
+ bufferSubData(target: number, offset: number, data: ArrayBufferView | ArrayBuffer): void;
+ checkFramebufferStatus(target: number): number;
+ clear(mask: number): void;
+ clearColor(red: number, green: number, blue: number, alpha: number): void;
+ clearDepth(depth: number): void;
+ clearStencil(s: number): void;
+ colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void;
+ compileShader(shader: WebGLShader): void;
+ compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void;
+ compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void;
+ copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void;
+ copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void;
+ createBuffer(): WebGLBuffer;
+ createFramebuffer(): WebGLFramebuffer;
+ createProgram(): WebGLProgram;
+ createRenderbuffer(): WebGLRenderbuffer;
+ createShader(type: number): WebGLShader;
+ createTexture(): WebGLTexture;
+ cullFace(mode: number): void;
+ deleteBuffer(buffer: WebGLBuffer): void;
+ deleteFramebuffer(framebuffer: WebGLFramebuffer): void;
+ deleteProgram(program: WebGLProgram): void;
+ deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void;
+ deleteShader(shader: WebGLShader): void;
+ deleteTexture(texture: WebGLTexture): void;
+ depthFunc(func: number): void;
+ depthMask(flag: boolean): void;
+ depthRange(zNear: number, zFar: number): void;
+ detachShader(program: WebGLProgram, shader: WebGLShader): void;
+ disable(cap: number): void;
+ disableVertexAttribArray(index: number): void;
+ drawArrays(mode: number, first: number, count: number): void;
+ drawElements(mode: number, count: number, type: number, offset: number): void;
+ enable(cap: number): void;
+ enableVertexAttribArray(index: number): void;
+ finish(): void;
+ flush(): void;
+ framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void;
+ framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void;
+ frontFace(mode: number): void;
+ generateMipmap(target: number): void;
+ getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo;
+ getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo;
+ getAttachedShaders(program: WebGLProgram): WebGLShader[];
+ getAttribLocation(program: WebGLProgram, name: string): number;
+ getBufferParameter(target: number, pname: number): any;
+ getContextAttributes(): WebGLContextAttributes;
+ getError(): number;
+ getExtension(name: string): any;
+ getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any;
+ getParameter(pname: number): any;
+ getProgramInfoLog(program: WebGLProgram): string;
+ getProgramParameter(program: WebGLProgram, pname: number): any;
+ getRenderbufferParameter(target: number, pname: number): any;
+ getShaderInfoLog(shader: WebGLShader): string;
+ getShaderParameter(shader: WebGLShader, pname: number): any;
+ getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat;
+ getShaderSource(shader: WebGLShader): string;
+ getSupportedExtensions(): string[];
+ getTexParameter(target: number, pname: number): any;
+ getUniform(program: WebGLProgram, location: WebGLUniformLocation): any;
+ getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation;
+ getVertexAttrib(index: number, pname: number): any;
+ getVertexAttribOffset(index: number, pname: number): number;
+ hint(target: number, mode: number): void;
+ isBuffer(buffer: WebGLBuffer): boolean;
+ isContextLost(): boolean;
+ isEnabled(cap: number): boolean;
+ isFramebuffer(framebuffer: WebGLFramebuffer): boolean;
+ isProgram(program: WebGLProgram): boolean;
+ isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean;
+ isShader(shader: WebGLShader): boolean;
+ isTexture(texture: WebGLTexture): boolean;
+ lineWidth(width: number): void;
+ linkProgram(program: WebGLProgram): void;
+ pixelStorei(pname: number, param: number): void;
+ polygonOffset(factor: number, units: number): void;
+ readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void;
+ renderbufferStorage(target: number, internalformat: number, width: number, height: number): void;
+ sampleCoverage(value: number, invert: boolean): void;
+ scissor(x: number, y: number, width: number, height: number): void;
+ shaderSource(shader: WebGLShader, source: string): void;
+ stencilFunc(func: number, ref: number, mask: number): void;
+ stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void;
+ stencilMask(mask: number): void;
+ stencilMaskSeparate(face: number, mask: number): void;
+ stencilOp(fail: number, zfail: number, zpass: number): void;
+ stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void;
+ texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void;
+ texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void;
+ texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void;
+ texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void;
+ texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void;
+ texParameterf(target: number, pname: number, param: number): void;
+ texParameteri(target: number, pname: number, param: number): void;
+ texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void;
+ texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void;
+ texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void;
+ texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void;
+ texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void;
+ uniform1f(location: WebGLUniformLocation, x: number): void;
+ uniform1fv(location: WebGLUniformLocation, v: Float32Array): void;
+ uniform1i(location: WebGLUniformLocation, x: number): void;
+ uniform1iv(location: WebGLUniformLocation, v: Int32Array): void;
+ uniform2f(location: WebGLUniformLocation, x: number, y: number): void;
+ uniform2fv(location: WebGLUniformLocation, v: Float32Array): void;
+ uniform2i(location: WebGLUniformLocation, x: number, y: number): void;
+ uniform2iv(location: WebGLUniformLocation, v: Int32Array): void;
+ uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void;
+ uniform3fv(location: WebGLUniformLocation, v: Float32Array): void;
+ uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void;
+ uniform3iv(location: WebGLUniformLocation, v: Int32Array): void;
+ uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void;
+ uniform4fv(location: WebGLUniformLocation, v: Float32Array): void;
+ uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void;
+ uniform4iv(location: WebGLUniformLocation, v: Int32Array): void;
+ uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void;
+ uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void;
+ uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void;
+ useProgram(program: WebGLProgram): void;
+ validateProgram(program: WebGLProgram): void;
+ vertexAttrib1f(indx: number, x: number): void;
+ vertexAttrib1fv(indx: number, values: Float32Array): void;
+ vertexAttrib2f(indx: number, x: number, y: number): void;
+ vertexAttrib2fv(indx: number, values: Float32Array): void;
+ vertexAttrib3f(indx: number, x: number, y: number, z: number): void;
+ vertexAttrib3fv(indx: number, values: Float32Array): void;
+ vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void;
+ vertexAttrib4fv(indx: number, values: Float32Array): void;
+ vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void;
+ viewport(x: number, y: number, width: number, height: number): void;
+ ACTIVE_ATTRIBUTES: number;
+ ACTIVE_TEXTURE: number;
+ ACTIVE_UNIFORMS: number;
+ ALIASED_LINE_WIDTH_RANGE: number;
+ ALIASED_POINT_SIZE_RANGE: number;
+ ALPHA: number;
+ ALPHA_BITS: number;
+ ALWAYS: number;
+ ARRAY_BUFFER: number;
+ ARRAY_BUFFER_BINDING: number;
+ ATTACHED_SHADERS: number;
+ BACK: number;
+ BLEND: number;
+ BLEND_COLOR: number;
+ BLEND_DST_ALPHA: number;
+ BLEND_DST_RGB: number;
+ BLEND_EQUATION: number;
+ BLEND_EQUATION_ALPHA: number;
+ BLEND_EQUATION_RGB: number;
+ BLEND_SRC_ALPHA: number;
+ BLEND_SRC_RGB: number;
+ BLUE_BITS: number;
+ BOOL: number;
+ BOOL_VEC2: number;
+ BOOL_VEC3: number;
+ BOOL_VEC4: number;
+ BROWSER_DEFAULT_WEBGL: number;
+ BUFFER_SIZE: number;
+ BUFFER_USAGE: number;
+ BYTE: number;
+ CCW: number;
+ CLAMP_TO_EDGE: number;
+ COLOR_ATTACHMENT0: number;
+ COLOR_BUFFER_BIT: number;
+ COLOR_CLEAR_VALUE: number;
+ COLOR_WRITEMASK: number;
+ COMPILE_STATUS: number;
+ COMPRESSED_TEXTURE_FORMATS: number;
+ CONSTANT_ALPHA: number;
+ CONSTANT_COLOR: number;
+ CONTEXT_LOST_WEBGL: number;
+ CULL_FACE: number;
+ CULL_FACE_MODE: number;
+ CURRENT_PROGRAM: number;
+ CURRENT_VERTEX_ATTRIB: number;
+ CW: number;
+ DECR: number;
+ DECR_WRAP: number;
+ DELETE_STATUS: number;
+ DEPTH_ATTACHMENT: number;
+ DEPTH_BITS: number;
+ DEPTH_BUFFER_BIT: number;
+ DEPTH_CLEAR_VALUE: number;
+ DEPTH_COMPONENT: number;
+ DEPTH_COMPONENT16: number;
+ DEPTH_FUNC: number;
+ DEPTH_RANGE: number;
+ DEPTH_STENCIL: number;
+ DEPTH_STENCIL_ATTACHMENT: number;
+ DEPTH_TEST: number;
+ DEPTH_WRITEMASK: number;
+ DITHER: number;
+ DONT_CARE: number;
+ DST_ALPHA: number;
+ DST_COLOR: number;
+ DYNAMIC_DRAW: number;
+ ELEMENT_ARRAY_BUFFER: number;
+ ELEMENT_ARRAY_BUFFER_BINDING: number;
+ EQUAL: number;
+ FASTEST: number;
+ FLOAT: number;
+ FLOAT_MAT2: number;
+ FLOAT_MAT3: number;
+ FLOAT_MAT4: number;
+ FLOAT_VEC2: number;
+ FLOAT_VEC3: number;
+ FLOAT_VEC4: number;
+ FRAGMENT_SHADER: number;
+ FRAMEBUFFER: number;
+ FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number;
+ FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number;
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number;
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number;
+ FRAMEBUFFER_BINDING: number;
+ FRAMEBUFFER_COMPLETE: number;
+ FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number;
+ FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number;
+ FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number;
+ FRAMEBUFFER_UNSUPPORTED: number;
+ FRONT: number;
+ FRONT_AND_BACK: number;
+ FRONT_FACE: number;
+ FUNC_ADD: number;
+ FUNC_REVERSE_SUBTRACT: number;
+ FUNC_SUBTRACT: number;
+ GENERATE_MIPMAP_HINT: number;
+ GEQUAL: number;
+ GREATER: number;
+ GREEN_BITS: number;
+ HIGH_FLOAT: number;
+ HIGH_INT: number;
+ IMPLEMENTATION_COLOR_READ_FORMAT: number;
+ IMPLEMENTATION_COLOR_READ_TYPE: number;
+ INCR: number;
+ INCR_WRAP: number;
+ INT: number;
+ INT_VEC2: number;
+ INT_VEC3: number;
+ INT_VEC4: number;
+ INVALID_ENUM: number;
+ INVALID_FRAMEBUFFER_OPERATION: number;
+ INVALID_OPERATION: number;
+ INVALID_VALUE: number;
+ INVERT: number;
+ KEEP: number;
+ LEQUAL: number;
+ LESS: number;
+ LINEAR: number;
+ LINEAR_MIPMAP_LINEAR: number;
+ LINEAR_MIPMAP_NEAREST: number;
+ LINES: number;
+ LINE_LOOP: number;
+ LINE_STRIP: number;
+ LINE_WIDTH: number;
+ LINK_STATUS: number;
+ LOW_FLOAT: number;
+ LOW_INT: number;
+ LUMINANCE: number;
+ LUMINANCE_ALPHA: number;
+ MAX_COMBINED_TEXTURE_IMAGE_UNITS: number;
+ MAX_CUBE_MAP_TEXTURE_SIZE: number;
+ MAX_FRAGMENT_UNIFORM_VECTORS: number;
+ MAX_RENDERBUFFER_SIZE: number;
+ MAX_TEXTURE_IMAGE_UNITS: number;
+ MAX_TEXTURE_SIZE: number;
+ MAX_VARYING_VECTORS: number;
+ MAX_VERTEX_ATTRIBS: number;
+ MAX_VERTEX_TEXTURE_IMAGE_UNITS: number;
+ MAX_VERTEX_UNIFORM_VECTORS: number;
+ MAX_VIEWPORT_DIMS: number;
+ MEDIUM_FLOAT: number;
+ MEDIUM_INT: number;
+ MIRRORED_REPEAT: number;
+ NEAREST: number;
+ NEAREST_MIPMAP_LINEAR: number;
+ NEAREST_MIPMAP_NEAREST: number;
+ NEVER: number;
+ NICEST: number;
+ NONE: number;
+ NOTEQUAL: number;
+ NO_ERROR: number;
+ ONE: number;
+ ONE_MINUS_CONSTANT_ALPHA: number;
+ ONE_MINUS_CONSTANT_COLOR: number;
+ ONE_MINUS_DST_ALPHA: number;
+ ONE_MINUS_DST_COLOR: number;
+ ONE_MINUS_SRC_ALPHA: number;
+ ONE_MINUS_SRC_COLOR: number;
+ OUT_OF_MEMORY: number;
+ PACK_ALIGNMENT: number;
+ POINTS: number;
+ POLYGON_OFFSET_FACTOR: number;
+ POLYGON_OFFSET_FILL: number;
+ POLYGON_OFFSET_UNITS: number;
+ RED_BITS: number;
+ RENDERBUFFER: number;
+ RENDERBUFFER_ALPHA_SIZE: number;
+ RENDERBUFFER_BINDING: number;
+ RENDERBUFFER_BLUE_SIZE: number;
+ RENDERBUFFER_DEPTH_SIZE: number;
+ RENDERBUFFER_GREEN_SIZE: number;
+ RENDERBUFFER_HEIGHT: number;
+ RENDERBUFFER_INTERNAL_FORMAT: number;
+ RENDERBUFFER_RED_SIZE: number;
+ RENDERBUFFER_STENCIL_SIZE: number;
+ RENDERBUFFER_WIDTH: number;
+ RENDERER: number;
+ REPEAT: number;
+ REPLACE: number;
+ RGB: number;
+ RGB565: number;
+ RGB5_A1: number;
+ RGBA: number;
+ RGBA4: number;
+ SAMPLER_2D: number;
+ SAMPLER_CUBE: number;
+ SAMPLES: number;
+ SAMPLE_ALPHA_TO_COVERAGE: number;
+ SAMPLE_BUFFERS: number;
+ SAMPLE_COVERAGE: number;
+ SAMPLE_COVERAGE_INVERT: number;
+ SAMPLE_COVERAGE_VALUE: number;
+ SCISSOR_BOX: number;
+ SCISSOR_TEST: number;
+ SHADER_TYPE: number;
+ SHADING_LANGUAGE_VERSION: number;
+ SHORT: number;
+ SRC_ALPHA: number;
+ SRC_ALPHA_SATURATE: number;
+ SRC_COLOR: number;
+ STATIC_DRAW: number;
+ STENCIL_ATTACHMENT: number;
+ STENCIL_BACK_FAIL: number;
+ STENCIL_BACK_FUNC: number;
+ STENCIL_BACK_PASS_DEPTH_FAIL: number;
+ STENCIL_BACK_PASS_DEPTH_PASS: number;
+ STENCIL_BACK_REF: number;
+ STENCIL_BACK_VALUE_MASK: number;
+ STENCIL_BACK_WRITEMASK: number;
+ STENCIL_BITS: number;
+ STENCIL_BUFFER_BIT: number;
+ STENCIL_CLEAR_VALUE: number;
+ STENCIL_FAIL: number;
+ STENCIL_FUNC: number;
+ STENCIL_INDEX: number;
+ STENCIL_INDEX8: number;
+ STENCIL_PASS_DEPTH_FAIL: number;
+ STENCIL_PASS_DEPTH_PASS: number;
+ STENCIL_REF: number;
+ STENCIL_TEST: number;
+ STENCIL_VALUE_MASK: number;
+ STENCIL_WRITEMASK: number;
+ STREAM_DRAW: number;
+ SUBPIXEL_BITS: number;
+ TEXTURE: number;
+ TEXTURE0: number;
+ TEXTURE1: number;
+ TEXTURE10: number;
+ TEXTURE11: number;
+ TEXTURE12: number;
+ TEXTURE13: number;
+ TEXTURE14: number;
+ TEXTURE15: number;
+ TEXTURE16: number;
+ TEXTURE17: number;
+ TEXTURE18: number;
+ TEXTURE19: number;
+ TEXTURE2: number;
+ TEXTURE20: number;
+ TEXTURE21: number;
+ TEXTURE22: number;
+ TEXTURE23: number;
+ TEXTURE24: number;
+ TEXTURE25: number;
+ TEXTURE26: number;
+ TEXTURE27: number;
+ TEXTURE28: number;
+ TEXTURE29: number;
+ TEXTURE3: number;
+ TEXTURE30: number;
+ TEXTURE31: number;
+ TEXTURE4: number;
+ TEXTURE5: number;
+ TEXTURE6: number;
+ TEXTURE7: number;
+ TEXTURE8: number;
+ TEXTURE9: number;
+ TEXTURE_2D: number;
+ TEXTURE_BINDING_2D: number;
+ TEXTURE_BINDING_CUBE_MAP: number;
+ TEXTURE_CUBE_MAP: number;
+ TEXTURE_CUBE_MAP_NEGATIVE_X: number;
+ TEXTURE_CUBE_MAP_NEGATIVE_Y: number;
+ TEXTURE_CUBE_MAP_NEGATIVE_Z: number;
+ TEXTURE_CUBE_MAP_POSITIVE_X: number;
+ TEXTURE_CUBE_MAP_POSITIVE_Y: number;
+ TEXTURE_CUBE_MAP_POSITIVE_Z: number;
+ TEXTURE_MAG_FILTER: number;
+ TEXTURE_MIN_FILTER: number;
+ TEXTURE_WRAP_S: number;
+ TEXTURE_WRAP_T: number;
+ TRIANGLES: number;
+ TRIANGLE_FAN: number;
+ TRIANGLE_STRIP: number;
+ UNPACK_ALIGNMENT: number;
+ UNPACK_COLORSPACE_CONVERSION_WEBGL: number;
+ UNPACK_FLIP_Y_WEBGL: number;
+ UNPACK_PREMULTIPLY_ALPHA_WEBGL: number;
+ UNSIGNED_BYTE: number;
+ UNSIGNED_INT: number;
+ UNSIGNED_SHORT: number;
+ UNSIGNED_SHORT_4_4_4_4: number;
+ UNSIGNED_SHORT_5_5_5_1: number;
+ UNSIGNED_SHORT_5_6_5: number;
+ VALIDATE_STATUS: number;
+ VENDOR: number;
+ VERSION: number;
+ VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number;
+ VERTEX_ATTRIB_ARRAY_ENABLED: number;
+ VERTEX_ATTRIB_ARRAY_NORMALIZED: number;
+ VERTEX_ATTRIB_ARRAY_POINTER: number;
+ VERTEX_ATTRIB_ARRAY_SIZE: number;
+ VERTEX_ATTRIB_ARRAY_STRIDE: number;
+ VERTEX_ATTRIB_ARRAY_TYPE: number;
+ VERTEX_SHADER: number;
+ VIEWPORT: number;
+ ZERO: number;
+}
+
+declare var WebGLRenderingContext: {
+ prototype: WebGLRenderingContext;
+ new(): WebGLRenderingContext;
+ ACTIVE_ATTRIBUTES: number;
+ ACTIVE_TEXTURE: number;
+ ACTIVE_UNIFORMS: number;
+ ALIASED_LINE_WIDTH_RANGE: number;
+ ALIASED_POINT_SIZE_RANGE: number;
+ ALPHA: number;
+ ALPHA_BITS: number;
+ ALWAYS: number;
+ ARRAY_BUFFER: number;
+ ARRAY_BUFFER_BINDING: number;
+ ATTACHED_SHADERS: number;
+ BACK: number;
+ BLEND: number;
+ BLEND_COLOR: number;
+ BLEND_DST_ALPHA: number;
+ BLEND_DST_RGB: number;
+ BLEND_EQUATION: number;
+ BLEND_EQUATION_ALPHA: number;
+ BLEND_EQUATION_RGB: number;
+ BLEND_SRC_ALPHA: number;
+ BLEND_SRC_RGB: number;
+ BLUE_BITS: number;
+ BOOL: number;
+ BOOL_VEC2: number;
+ BOOL_VEC3: number;
+ BOOL_VEC4: number;
+ BROWSER_DEFAULT_WEBGL: number;
+ BUFFER_SIZE: number;
+ BUFFER_USAGE: number;
+ BYTE: number;
+ CCW: number;
+ CLAMP_TO_EDGE: number;
+ COLOR_ATTACHMENT0: number;
+ COLOR_BUFFER_BIT: number;
+ COLOR_CLEAR_VALUE: number;
+ COLOR_WRITEMASK: number;
+ COMPILE_STATUS: number;
+ COMPRESSED_TEXTURE_FORMATS: number;
+ CONSTANT_ALPHA: number;
+ CONSTANT_COLOR: number;
+ CONTEXT_LOST_WEBGL: number;
+ CULL_FACE: number;
+ CULL_FACE_MODE: number;
+ CURRENT_PROGRAM: number;
+ CURRENT_VERTEX_ATTRIB: number;
+ CW: number;
+ DECR: number;
+ DECR_WRAP: number;
+ DELETE_STATUS: number;
+ DEPTH_ATTACHMENT: number;
+ DEPTH_BITS: number;
+ DEPTH_BUFFER_BIT: number;
+ DEPTH_CLEAR_VALUE: number;
+ DEPTH_COMPONENT: number;
+ DEPTH_COMPONENT16: number;
+ DEPTH_FUNC: number;
+ DEPTH_RANGE: number;
+ DEPTH_STENCIL: number;
+ DEPTH_STENCIL_ATTACHMENT: number;
+ DEPTH_TEST: number;
+ DEPTH_WRITEMASK: number;
+ DITHER: number;
+ DONT_CARE: number;
+ DST_ALPHA: number;
+ DST_COLOR: number;
+ DYNAMIC_DRAW: number;
+ ELEMENT_ARRAY_BUFFER: number;
+ ELEMENT_ARRAY_BUFFER_BINDING: number;
+ EQUAL: number;
+ FASTEST: number;
+ FLOAT: number;
+ FLOAT_MAT2: number;
+ FLOAT_MAT3: number;
+ FLOAT_MAT4: number;
+ FLOAT_VEC2: number;
+ FLOAT_VEC3: number;
+ FLOAT_VEC4: number;
+ FRAGMENT_SHADER: number;
+ FRAMEBUFFER: number;
+ FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number;
+ FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number;
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number;
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number;
+ FRAMEBUFFER_BINDING: number;
+ FRAMEBUFFER_COMPLETE: number;
+ FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number;
+ FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number;
+ FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number;
+ FRAMEBUFFER_UNSUPPORTED: number;
+ FRONT: number;
+ FRONT_AND_BACK: number;
+ FRONT_FACE: number;
+ FUNC_ADD: number;
+ FUNC_REVERSE_SUBTRACT: number;
+ FUNC_SUBTRACT: number;
+ GENERATE_MIPMAP_HINT: number;
+ GEQUAL: number;
+ GREATER: number;
+ GREEN_BITS: number;
+ HIGH_FLOAT: number;
+ HIGH_INT: number;
+ IMPLEMENTATION_COLOR_READ_FORMAT: number;
+ IMPLEMENTATION_COLOR_READ_TYPE: number;
+ INCR: number;
+ INCR_WRAP: number;
+ INT: number;
+ INT_VEC2: number;
+ INT_VEC3: number;
+ INT_VEC4: number;
+ INVALID_ENUM: number;
+ INVALID_FRAMEBUFFER_OPERATION: number;
+ INVALID_OPERATION: number;
+ INVALID_VALUE: number;
+ INVERT: number;
+ KEEP: number;
+ LEQUAL: number;
+ LESS: number;
+ LINEAR: number;
+ LINEAR_MIPMAP_LINEAR: number;
+ LINEAR_MIPMAP_NEAREST: number;
+ LINES: number;
+ LINE_LOOP: number;
+ LINE_STRIP: number;
+ LINE_WIDTH: number;
+ LINK_STATUS: number;
+ LOW_FLOAT: number;
+ LOW_INT: number;
+ LUMINANCE: number;
+ LUMINANCE_ALPHA: number;
+ MAX_COMBINED_TEXTURE_IMAGE_UNITS: number;
+ MAX_CUBE_MAP_TEXTURE_SIZE: number;
+ MAX_FRAGMENT_UNIFORM_VECTORS: number;
+ MAX_RENDERBUFFER_SIZE: number;
+ MAX_TEXTURE_IMAGE_UNITS: number;
+ MAX_TEXTURE_SIZE: number;
+ MAX_VARYING_VECTORS: number;
+ MAX_VERTEX_ATTRIBS: number;
+ MAX_VERTEX_TEXTURE_IMAGE_UNITS: number;
+ MAX_VERTEX_UNIFORM_VECTORS: number;
+ MAX_VIEWPORT_DIMS: number;
+ MEDIUM_FLOAT: number;
+ MEDIUM_INT: number;
+ MIRRORED_REPEAT: number;
+ NEAREST: number;
+ NEAREST_MIPMAP_LINEAR: number;
+ NEAREST_MIPMAP_NEAREST: number;
+ NEVER: number;
+ NICEST: number;
+ NONE: number;
+ NOTEQUAL: number;
+ NO_ERROR: number;
+ ONE: number;
+ ONE_MINUS_CONSTANT_ALPHA: number;
+ ONE_MINUS_CONSTANT_COLOR: number;
+ ONE_MINUS_DST_ALPHA: number;
+ ONE_MINUS_DST_COLOR: number;
+ ONE_MINUS_SRC_ALPHA: number;
+ ONE_MINUS_SRC_COLOR: number;
+ OUT_OF_MEMORY: number;
+ PACK_ALIGNMENT: number;
+ POINTS: number;
+ POLYGON_OFFSET_FACTOR: number;
+ POLYGON_OFFSET_FILL: number;
+ POLYGON_OFFSET_UNITS: number;
+ RED_BITS: number;
+ RENDERBUFFER: number;
+ RENDERBUFFER_ALPHA_SIZE: number;
+ RENDERBUFFER_BINDING: number;
+ RENDERBUFFER_BLUE_SIZE: number;
+ RENDERBUFFER_DEPTH_SIZE: number;
+ RENDERBUFFER_GREEN_SIZE: number;
+ RENDERBUFFER_HEIGHT: number;
+ RENDERBUFFER_INTERNAL_FORMAT: number;
+ RENDERBUFFER_RED_SIZE: number;
+ RENDERBUFFER_STENCIL_SIZE: number;
+ RENDERBUFFER_WIDTH: number;
+ RENDERER: number;
+ REPEAT: number;
+ REPLACE: number;
+ RGB: number;
+ RGB565: number;
+ RGB5_A1: number;
+ RGBA: number;
+ RGBA4: number;
+ SAMPLER_2D: number;
+ SAMPLER_CUBE: number;
+ SAMPLES: number;
+ SAMPLE_ALPHA_TO_COVERAGE: number;
+ SAMPLE_BUFFERS: number;
+ SAMPLE_COVERAGE: number;
+ SAMPLE_COVERAGE_INVERT: number;
+ SAMPLE_COVERAGE_VALUE: number;
+ SCISSOR_BOX: number;
+ SCISSOR_TEST: number;
+ SHADER_TYPE: number;
+ SHADING_LANGUAGE_VERSION: number;
+ SHORT: number;
+ SRC_ALPHA: number;
+ SRC_ALPHA_SATURATE: number;
+ SRC_COLOR: number;
+ STATIC_DRAW: number;
+ STENCIL_ATTACHMENT: number;
+ STENCIL_BACK_FAIL: number;
+ STENCIL_BACK_FUNC: number;
+ STENCIL_BACK_PASS_DEPTH_FAIL: number;
+ STENCIL_BACK_PASS_DEPTH_PASS: number;
+ STENCIL_BACK_REF: number;
+ STENCIL_BACK_VALUE_MASK: number;
+ STENCIL_BACK_WRITEMASK: number;
+ STENCIL_BITS: number;
+ STENCIL_BUFFER_BIT: number;
+ STENCIL_CLEAR_VALUE: number;
+ STENCIL_FAIL: number;
+ STENCIL_FUNC: number;
+ STENCIL_INDEX: number;
+ STENCIL_INDEX8: number;
+ STENCIL_PASS_DEPTH_FAIL: number;
+ STENCIL_PASS_DEPTH_PASS: number;
+ STENCIL_REF: number;
+ STENCIL_TEST: number;
+ STENCIL_VALUE_MASK: number;
+ STENCIL_WRITEMASK: number;
+ STREAM_DRAW: number;
+ SUBPIXEL_BITS: number;
+ TEXTURE: number;
+ TEXTURE0: number;
+ TEXTURE1: number;
+ TEXTURE10: number;
+ TEXTURE11: number;
+ TEXTURE12: number;
+ TEXTURE13: number;
+ TEXTURE14: number;
+ TEXTURE15: number;
+ TEXTURE16: number;
+ TEXTURE17: number;
+ TEXTURE18: number;
+ TEXTURE19: number;
+ TEXTURE2: number;
+ TEXTURE20: number;
+ TEXTURE21: number;
+ TEXTURE22: number;
+ TEXTURE23: number;
+ TEXTURE24: number;
+ TEXTURE25: number;
+ TEXTURE26: number;
+ TEXTURE27: number;
+ TEXTURE28: number;
+ TEXTURE29: number;
+ TEXTURE3: number;
+ TEXTURE30: number;
+ TEXTURE31: number;
+ TEXTURE4: number;
+ TEXTURE5: number;
+ TEXTURE6: number;
+ TEXTURE7: number;
+ TEXTURE8: number;
+ TEXTURE9: number;
+ TEXTURE_2D: number;
+ TEXTURE_BINDING_2D: number;
+ TEXTURE_BINDING_CUBE_MAP: number;
+ TEXTURE_CUBE_MAP: number;
+ TEXTURE_CUBE_MAP_NEGATIVE_X: number;
+ TEXTURE_CUBE_MAP_NEGATIVE_Y: number;
+ TEXTURE_CUBE_MAP_NEGATIVE_Z: number;
+ TEXTURE_CUBE_MAP_POSITIVE_X: number;
+ TEXTURE_CUBE_MAP_POSITIVE_Y: number;
+ TEXTURE_CUBE_MAP_POSITIVE_Z: number;
+ TEXTURE_MAG_FILTER: number;
+ TEXTURE_MIN_FILTER: number;
+ TEXTURE_WRAP_S: number;
+ TEXTURE_WRAP_T: number;
+ TRIANGLES: number;
+ TRIANGLE_FAN: number;
+ TRIANGLE_STRIP: number;
+ UNPACK_ALIGNMENT: number;
+ UNPACK_COLORSPACE_CONVERSION_WEBGL: number;
+ UNPACK_FLIP_Y_WEBGL: number;
+ UNPACK_PREMULTIPLY_ALPHA_WEBGL: number;
+ UNSIGNED_BYTE: number;
+ UNSIGNED_INT: number;
+ UNSIGNED_SHORT: number;
+ UNSIGNED_SHORT_4_4_4_4: number;
+ UNSIGNED_SHORT_5_5_5_1: number;
+ UNSIGNED_SHORT_5_6_5: number;
+ VALIDATE_STATUS: number;
+ VENDOR: number;
+ VERSION: number;
+ VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number;
+ VERTEX_ATTRIB_ARRAY_ENABLED: number;
+ VERTEX_ATTRIB_ARRAY_NORMALIZED: number;
+ VERTEX_ATTRIB_ARRAY_POINTER: number;
+ VERTEX_ATTRIB_ARRAY_SIZE: number;
+ VERTEX_ATTRIB_ARRAY_STRIDE: number;
+ VERTEX_ATTRIB_ARRAY_TYPE: number;
+ VERTEX_SHADER: number;
+ VIEWPORT: number;
+ ZERO: number;
+}
+
+interface WebGLShader extends WebGLObject {
+}
+
+declare var WebGLShader: {
+ prototype: WebGLShader;
+ new(): WebGLShader;
+}
+
+interface WebGLShaderPrecisionFormat {
+ precision: number;
+ rangeMax: number;
+ rangeMin: number;
+}
+
+declare var WebGLShaderPrecisionFormat: {
+ prototype: WebGLShaderPrecisionFormat;
+ new(): WebGLShaderPrecisionFormat;
+}
+
+interface WebGLTexture extends WebGLObject {
+}
+
+declare var WebGLTexture: {
+ prototype: WebGLTexture;
+ new(): WebGLTexture;
+}
+
+interface WebGLUniformLocation {
+}
+
+declare var WebGLUniformLocation: {
+ prototype: WebGLUniformLocation;
+ new(): WebGLUniformLocation;
+}
+
+interface WebKitCSSMatrix {
+ a: number;
+ b: number;
+ c: number;
+ d: number;
+ e: number;
+ f: number;
+ m11: number;
+ m12: number;
+ m13: number;
+ m14: number;
+ m21: number;
+ m22: number;
+ m23: number;
+ m24: number;
+ m31: number;
+ m32: number;
+ m33: number;
+ m34: number;
+ m41: number;
+ m42: number;
+ m43: number;
+ m44: number;
+ inverse(): WebKitCSSMatrix;
+ multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix;
+ rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix;
+ rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix;
+ scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix;
+ setMatrixValue(value: string): void;
+ skewX(angle: number): WebKitCSSMatrix;
+ skewY(angle: number): WebKitCSSMatrix;
+ toString(): string;
+ translate(x: number, y: number, z?: number): WebKitCSSMatrix;
+}
+
+declare var WebKitCSSMatrix: {
+ prototype: WebKitCSSMatrix;
+ new(text?: string): WebKitCSSMatrix;
+}
+
+interface WebKitPoint {
+ x: number;
+ y: number;
+}
+
+declare var WebKitPoint: {
+ prototype: WebKitPoint;
+ new(x?: number, y?: number): WebKitPoint;
+}
+
+interface WebSocket extends EventTarget {
+ binaryType: string;
+ bufferedAmount: number;
+ extensions: string;
+ onclose: (ev: CloseEvent) => any;
+ onerror: (ev: Event) => any;
+ onmessage: (ev: MessageEvent) => any;
+ onopen: (ev: Event) => any;
+ protocol: string;
+ readyState: number;
+ url: string;
+ close(code?: number, reason?: string): void;
+ send(data: any): void;
+ CLOSED: number;
+ CLOSING: number;
+ CONNECTING: number;
+ OPEN: number;
+ addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var WebSocket: {
+ prototype: WebSocket;
+ new(url: string, protocols?: string | string[]): WebSocket;
+ CLOSED: number;
+ CLOSING: number;
+ CONNECTING: number;
+ OPEN: number;
+}
+
+interface WheelEvent extends MouseEvent {
+ deltaMode: number;
+ deltaX: number;
+ deltaY: number;
+ deltaZ: number;
+ getCurrentPoint(element: Element): void;
+ initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void;
+ DOM_DELTA_LINE: number;
+ DOM_DELTA_PAGE: number;
+ DOM_DELTA_PIXEL: number;
+}
+
+declare var WheelEvent: {
+ prototype: WheelEvent;
+ new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent;
+ DOM_DELTA_LINE: number;
+ DOM_DELTA_PAGE: number;
+ DOM_DELTA_PIXEL: number;
+}
+
+interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 {
+ animationStartTime: number;
+ applicationCache: ApplicationCache;
+ clientInformation: Navigator;
+ closed: boolean;
+ crypto: Crypto;
+ defaultStatus: string;
+ devicePixelRatio: number;
+ doNotTrack: string;
+ document: Document;
+ event: Event;
+ external: External;
+ frameElement: Element;
+ frames: Window;
+ history: History;
+ innerHeight: number;
+ innerWidth: number;
+ length: number;
+ location: Location;
+ locationbar: BarProp;
+ menubar: BarProp;
+ msAnimationStartTime: number;
+ name: string;
+ navigator: Navigator;
+ offscreenBuffering: string | boolean;
+ onabort: (ev: Event) => any;
+ onafterprint: (ev: Event) => any;
+ onbeforeprint: (ev: Event) => any;
+ onbeforeunload: (ev: BeforeUnloadEvent) => any;
+ onblur: (ev: FocusEvent) => any;
+ oncanplay: (ev: Event) => any;
+ oncanplaythrough: (ev: Event) => any;
+ onchange: (ev: Event) => any;
+ onclick: (ev: MouseEvent) => any;
+ oncompassneedscalibration: (ev: Event) => any;
+ oncontextmenu: (ev: PointerEvent) => any;
+ ondblclick: (ev: MouseEvent) => any;
+ ondevicemotion: (ev: DeviceMotionEvent) => any;
+ ondeviceorientation: (ev: DeviceOrientationEvent) => any;
+ ondrag: (ev: DragEvent) => any;
+ ondragend: (ev: DragEvent) => any;
+ ondragenter: (ev: DragEvent) => any;
+ ondragleave: (ev: DragEvent) => any;
+ ondragover: (ev: DragEvent) => any;
+ ondragstart: (ev: DragEvent) => any;
+ ondrop: (ev: DragEvent) => any;
+ ondurationchange: (ev: Event) => any;
+ onemptied: (ev: Event) => any;
+ onended: (ev: Event) => any;
+ onerror: ErrorEventHandler;
+ onfocus: (ev: FocusEvent) => any;
+ onhashchange: (ev: HashChangeEvent) => any;
+ oninput: (ev: Event) => any;
+ onkeydown: (ev: KeyboardEvent) => any;
+ onkeypress: (ev: KeyboardEvent) => any;
+ onkeyup: (ev: KeyboardEvent) => any;
+ onload: (ev: Event) => any;
+ onloadeddata: (ev: Event) => any;
+ onloadedmetadata: (ev: Event) => any;
+ onloadstart: (ev: Event) => any;
+ onmessage: (ev: MessageEvent) => any;
+ onmousedown: (ev: MouseEvent) => any;
+ onmouseenter: (ev: MouseEvent) => any;
+ onmouseleave: (ev: MouseEvent) => any;
+ onmousemove: (ev: MouseEvent) => any;
+ onmouseout: (ev: MouseEvent) => any;
+ onmouseover: (ev: MouseEvent) => any;
+ onmouseup: (ev: MouseEvent) => any;
+ onmousewheel: (ev: MouseWheelEvent) => any;
+ onmsgesturechange: (ev: MSGestureEvent) => any;
+ onmsgesturedoubletap: (ev: MSGestureEvent) => any;
+ onmsgestureend: (ev: MSGestureEvent) => any;
+ onmsgesturehold: (ev: MSGestureEvent) => any;
+ onmsgesturestart: (ev: MSGestureEvent) => any;
+ onmsgesturetap: (ev: MSGestureEvent) => any;
+ onmsinertiastart: (ev: MSGestureEvent) => any;
+ onmspointercancel: (ev: MSPointerEvent) => any;
+ onmspointerdown: (ev: MSPointerEvent) => any;
+ onmspointerenter: (ev: MSPointerEvent) => any;
+ onmspointerleave: (ev: MSPointerEvent) => any;
+ onmspointermove: (ev: MSPointerEvent) => any;
+ onmspointerout: (ev: MSPointerEvent) => any;
+ onmspointerover: (ev: MSPointerEvent) => any;
+ onmspointerup: (ev: MSPointerEvent) => any;
+ onoffline: (ev: Event) => any;
+ ononline: (ev: Event) => any;
+ onorientationchange: (ev: Event) => any;
+ onpagehide: (ev: PageTransitionEvent) => any;
+ onpageshow: (ev: PageTransitionEvent) => any;
+ onpause: (ev: Event) => any;
+ onplay: (ev: Event) => any;
+ onplaying: (ev: Event) => any;
+ onpopstate: (ev: PopStateEvent) => any;
+ onprogress: (ev: ProgressEvent) => any;
+ onratechange: (ev: Event) => any;
+ onreadystatechange: (ev: ProgressEvent) => any;
+ onreset: (ev: Event) => any;
+ onresize: (ev: UIEvent) => any;
+ onscroll: (ev: UIEvent) => any;
+ onseeked: (ev: Event) => any;
+ onseeking: (ev: Event) => any;
+ onselect: (ev: UIEvent) => any;
+ onstalled: (ev: Event) => any;
+ onstorage: (ev: StorageEvent) => any;
+ onsubmit: (ev: Event) => any;
+ onsuspend: (ev: Event) => any;
+ ontimeupdate: (ev: Event) => any;
+ ontouchcancel: any;
+ ontouchend: any;
+ ontouchmove: any;
+ ontouchstart: any;
+ onunload: (ev: Event) => any;
+ onvolumechange: (ev: Event) => any;
+ onwaiting: (ev: Event) => any;
+ opener: Window;
+ orientation: string | number;
+ outerHeight: number;
+ outerWidth: number;
+ pageXOffset: number;
+ pageYOffset: number;
+ parent: Window;
+ performance: Performance;
+ personalbar: BarProp;
+ screen: Screen;
+ screenLeft: number;
+ screenTop: number;
+ screenX: number;
+ screenY: number;
+ scrollX: number;
+ scrollY: number;
+ scrollbars: BarProp;
+ self: Window;
+ status: string;
+ statusbar: BarProp;
+ styleMedia: StyleMedia;
+ toolbar: BarProp;
+ top: Window;
+ window: Window;
+ URL: URL;
+ alert(message?: any): void;
+ blur(): void;
+ cancelAnimationFrame(handle: number): void;
+ captureEvents(): void;
+ close(): void;
+ confirm(message?: string): boolean;
+ focus(): void;
+ getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;
+ getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList;
+ getSelection(): Selection;
+ matchMedia(mediaQuery: string): MediaQueryList;
+ moveBy(x?: number, y?: number): void;
+ moveTo(x?: number, y?: number): void;
+ msCancelRequestAnimationFrame(handle: number): void;
+ msMatchMedia(mediaQuery: string): MediaQueryList;
+ msRequestAnimationFrame(callback: FrameRequestCallback): number;
+ msWriteProfilerMark(profilerMarkName: string): void;
+ open(url?: string, target?: string, features?: string, replace?: boolean): any;
+ postMessage(message: any, targetOrigin: string, ports?: any): void;
+ print(): void;
+ prompt(message?: string, _default?: string): string;
+ releaseEvents(): void;
+ requestAnimationFrame(callback: FrameRequestCallback): number;
+ resizeBy(x?: number, y?: number): void;
+ resizeTo(x?: number, y?: number): void;
+ scroll(x?: number, y?: number): void;
+ scrollBy(x?: number, y?: number): void;
+ scrollTo(x?: number, y?: number): void;
+ webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;
+ webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;
+ addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+ [index: number]: Window;
+}
+
+declare var Window: {
+ prototype: Window;
+ new(): Window;
+}
+
+interface Worker extends EventTarget, AbstractWorker {
+ onmessage: (ev: MessageEvent) => any;
+ postMessage(message: any, ports?: any): void;
+ terminate(): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var Worker: {
+ prototype: Worker;
+ new(stringUrl: string): Worker;
+}
+
+interface XMLDocument extends Document {
+}
+
+declare var XMLDocument: {
+ prototype: XMLDocument;
+ new(): XMLDocument;
+}
+
+interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {
+ msCaching: string;
+ onreadystatechange: (ev: ProgressEvent) => any;
+ readyState: number;
+ response: any;
+ responseBody: any;
+ responseText: string;
+ responseType: string;
+ responseXML: any;
+ status: number;
+ statusText: string;
+ timeout: number;
+ upload: XMLHttpRequestUpload;
+ withCredentials: boolean;
+ abort(): void;
+ getAllResponseHeaders(): string;
+ getResponseHeader(header: string): string;
+ msCachingEnabled(): boolean;
+ open(method: string, url: string, async?: boolean, user?: string, password?: string): void;
+ overrideMimeType(mime: string): void;
+ send(data?: Document): void;
+ send(data?: string): void;
+ send(data?: any): void;
+ setRequestHeader(header: string, value: string): void;
+ DONE: number;
+ HEADERS_RECEIVED: number;
+ LOADING: number;
+ OPENED: number;
+ UNSENT: number;
+ addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var XMLHttpRequest: {
+ prototype: XMLHttpRequest;
+ new(): XMLHttpRequest;
+ DONE: number;
+ HEADERS_RECEIVED: number;
+ LOADING: number;
+ OPENED: number;
+ UNSENT: number;
+ create(): XMLHttpRequest;
+}
+
+interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget {
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+declare var XMLHttpRequestUpload: {
+ prototype: XMLHttpRequestUpload;
+ new(): XMLHttpRequestUpload;
+}
+
+interface XMLSerializer {
+ serializeToString(target: Node): string;
+}
+
+declare var XMLSerializer: {
+ prototype: XMLSerializer;
+ new(): XMLSerializer;
+}
+
+interface XPathEvaluator {
+ createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;
+ createNSResolver(nodeResolver?: Node): XPathNSResolver;
+ evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult;
+}
+
+declare var XPathEvaluator: {
+ prototype: XPathEvaluator;
+ new(): XPathEvaluator;
+}
+
+interface XPathExpression {
+ evaluate(contextNode: Node, type: number, result: XPathResult): XPathExpression;
+}
+
+declare var XPathExpression: {
+ prototype: XPathExpression;
+ new(): XPathExpression;
+}
+
+interface XPathNSResolver {
+ lookupNamespaceURI(prefix: string): string;
+}
+
+declare var XPathNSResolver: {
+ prototype: XPathNSResolver;
+ new(): XPathNSResolver;
+}
+
+interface XPathResult {
+ booleanValue: boolean;
+ invalidIteratorState: boolean;
+ numberValue: number;
+ resultType: number;
+ singleNodeValue: Node;
+ snapshotLength: number;
+ stringValue: string;
+ iterateNext(): Node;
+ snapshotItem(index: number): Node;
+ ANY_TYPE: number;
+ ANY_UNORDERED_NODE_TYPE: number;
+ BOOLEAN_TYPE: number;
+ FIRST_ORDERED_NODE_TYPE: number;
+ NUMBER_TYPE: number;
+ ORDERED_NODE_ITERATOR_TYPE: number;
+ ORDERED_NODE_SNAPSHOT_TYPE: number;
+ STRING_TYPE: number;
+ UNORDERED_NODE_ITERATOR_TYPE: number;
+ UNORDERED_NODE_SNAPSHOT_TYPE: number;
+}
+
+declare var XPathResult: {
+ prototype: XPathResult;
+ new(): XPathResult;
+ ANY_TYPE: number;
+ ANY_UNORDERED_NODE_TYPE: number;
+ BOOLEAN_TYPE: number;
+ FIRST_ORDERED_NODE_TYPE: number;
+ NUMBER_TYPE: number;
+ ORDERED_NODE_ITERATOR_TYPE: number;
+ ORDERED_NODE_SNAPSHOT_TYPE: number;
+ STRING_TYPE: number;
+ UNORDERED_NODE_ITERATOR_TYPE: number;
+ UNORDERED_NODE_SNAPSHOT_TYPE: number;
+}
+
+interface XSLTProcessor {
+ clearParameters(): void;
+ getParameter(namespaceURI: string, localName: string): any;
+ importStylesheet(style: Node): void;
+ removeParameter(namespaceURI: string, localName: string): void;
+ reset(): void;
+ setParameter(namespaceURI: string, localName: string, value: any): void;
+ transformToDocument(source: Node): Document;
+ transformToFragment(source: Node, document: Document): DocumentFragment;
+}
+
+declare var XSLTProcessor: {
+ prototype: XSLTProcessor;
+ new(): XSLTProcessor;
+}
+
+interface AbstractWorker {
+ onerror: (ev: Event) => any;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+interface ChildNode {
+ remove(): void;
+}
+
+interface DOML2DeprecatedColorProperty {
+ color: string;
+}
+
+interface DOML2DeprecatedSizeProperty {
+ size: number;
+}
+
+interface DocumentEvent {
+ createEvent(eventInterface:"AnimationEvent"): AnimationEvent;
+ createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent;
+ createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent;
+ createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent;
+ createEvent(eventInterface:"ClipboardEvent"): ClipboardEvent;
+ createEvent(eventInterface:"CloseEvent"): CloseEvent;
+ createEvent(eventInterface:"CommandEvent"): CommandEvent;
+ createEvent(eventInterface:"CompositionEvent"): CompositionEvent;
+ createEvent(eventInterface:"CustomEvent"): CustomEvent;
+ createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent;
+ createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent;
+ createEvent(eventInterface:"DragEvent"): DragEvent;
+ createEvent(eventInterface:"ErrorEvent"): ErrorEvent;
+ createEvent(eventInterface:"Event"): Event;
+ createEvent(eventInterface:"Events"): Event;
+ createEvent(eventInterface:"FocusEvent"): FocusEvent;
+ createEvent(eventInterface:"GamepadEvent"): GamepadEvent;
+ createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent;
+ createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent;
+ createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent;
+ createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent;
+ createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent;
+ createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent;
+ createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent;
+ createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent;
+ createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent;
+ createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent;
+ createEvent(eventInterface:"MessageEvent"): MessageEvent;
+ createEvent(eventInterface:"MouseEvent"): MouseEvent;
+ createEvent(eventInterface:"MouseEvents"): MouseEvent;
+ createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent;
+ createEvent(eventInterface:"MutationEvent"): MutationEvent;
+ createEvent(eventInterface:"MutationEvents"): MutationEvent;
+ createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent;
+ createEvent(eventInterface:"NavigationEvent"): NavigationEvent;
+ createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer;
+ createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent;
+ createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent;
+ createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent;
+ createEvent(eventInterface:"PointerEvent"): PointerEvent;
+ createEvent(eventInterface:"PopStateEvent"): PopStateEvent;
+ createEvent(eventInterface:"ProgressEvent"): ProgressEvent;
+ createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent;
+ createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent;
+ createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent;
+ createEvent(eventInterface:"StorageEvent"): StorageEvent;
+ createEvent(eventInterface:"TextEvent"): TextEvent;
+ createEvent(eventInterface:"TouchEvent"): TouchEvent;
+ createEvent(eventInterface:"TrackEvent"): TrackEvent;
+ createEvent(eventInterface:"TransitionEvent"): TransitionEvent;
+ createEvent(eventInterface:"UIEvent"): UIEvent;
+ createEvent(eventInterface:"UIEvents"): UIEvent;
+ createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent;
+ createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent;
+ createEvent(eventInterface:"WheelEvent"): WheelEvent;
+ createEvent(eventInterface: string): Event;
+}
+
+interface ElementTraversal {
+ childElementCount: number;
+ firstElementChild: Element;
+ lastElementChild: Element;
+ nextElementSibling: Element;
+ previousElementSibling: Element;
+}
+
+interface GetSVGDocument {
+ getSVGDocument(): Document;
+}
+
+interface GlobalEventHandlers {
+ onpointercancel: (ev: PointerEvent) => any;
+ onpointerdown: (ev: PointerEvent) => any;
+ onpointerenter: (ev: PointerEvent) => any;
+ onpointerleave: (ev: PointerEvent) => any;
+ onpointermove: (ev: PointerEvent) => any;
+ onpointerout: (ev: PointerEvent) => any;
+ onpointerover: (ev: PointerEvent) => any;
+ onpointerup: (ev: PointerEvent) => any;
+ onwheel: (ev: WheelEvent) => any;
+ addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+interface HTMLTableAlignment {
+ /**
+ * Sets or retrieves a value that you can use to implement your own ch functionality for the object.
+ */
+ ch: string;
+ /**
+ * Sets or retrieves a value that you can use to implement your own chOff functionality for the object.
+ */
+ chOff: string;
+ /**
+ * Sets or retrieves how text and other content are vertically aligned within the object that contains them.
+ */
+ vAlign: string;
+}
+
+interface IDBEnvironment {
+ indexedDB: IDBFactory;
+ msIndexedDB: IDBFactory;
+}
+
+interface LinkStyle {
+ sheet: StyleSheet;
+}
+
+interface MSBaseReader {
+ onabort: (ev: Event) => any;
+ onerror: (ev: Event) => any;
+ onload: (ev: Event) => any;
+ onloadend: (ev: ProgressEvent) => any;
+ onloadstart: (ev: Event) => any;
+ onprogress: (ev: ProgressEvent) => any;
+ readyState: number;
+ result: any;
+ abort(): void;
+ DONE: number;
+ EMPTY: number;
+ LOADING: number;
+ addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+interface MSFileSaver {
+ msSaveBlob(blob: any, defaultName?: string): boolean;
+ msSaveOrOpenBlob(blob: any, defaultName?: string): boolean;
+}
+
+interface MSNavigatorDoNotTrack {
+ confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean;
+ confirmWebWideTrackingException(args: ExceptionInformation): boolean;
+ removeSiteSpecificTrackingException(args: ExceptionInformation): void;
+ removeWebWideTrackingException(args: ExceptionInformation): void;
+ storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void;
+ storeWebWideTrackingException(args: StoreExceptionsInformation): void;
+}
+
+interface NavigatorContentUtils {
+}
+
+interface NavigatorGeolocation {
+ geolocation: Geolocation;
+}
+
+interface NavigatorID {
+ appName: string;
+ appVersion: string;
+ platform: string;
+ product: string;
+ productSub: string;
+ userAgent: string;
+ vendor: string;
+ vendorSub: string;
+}
+
+interface NavigatorOnLine {
+ onLine: boolean;
+}
+
+interface NavigatorStorageUtils {
+}
+
+interface NodeSelector {
+ querySelector(selectors: string): Element;
+ querySelectorAll(selectors: string): NodeListOf<Element>;
+}
+
+interface RandomSource {
+ getRandomValues(array: ArrayBufferView): ArrayBufferView;
+}
+
+interface SVGAnimatedPathData {
+ pathSegList: SVGPathSegList;
+}
+
+interface SVGAnimatedPoints {
+ animatedPoints: SVGPointList;
+ points: SVGPointList;
+}
+
+interface SVGExternalResourcesRequired {
+ externalResourcesRequired: SVGAnimatedBoolean;
+}
+
+interface SVGFilterPrimitiveStandardAttributes extends SVGStylable {
+ height: SVGAnimatedLength;
+ result: SVGAnimatedString;
+ width: SVGAnimatedLength;
+ x: SVGAnimatedLength;
+ y: SVGAnimatedLength;
+}
+
+interface SVGFitToViewBox {
+ preserveAspectRatio: SVGAnimatedPreserveAspectRatio;
+ viewBox: SVGAnimatedRect;
+}
+
+interface SVGLangSpace {
+ xmllang: string;
+ xmlspace: string;
+}
+
+interface SVGLocatable {
+ farthestViewportElement: SVGElement;
+ nearestViewportElement: SVGElement;
+ getBBox(): SVGRect;
+ getCTM(): SVGMatrix;
+ getScreenCTM(): SVGMatrix;
+ getTransformToElement(element: SVGElement): SVGMatrix;
+}
+
+interface SVGStylable {
+ className: any;
+ style: CSSStyleDeclaration;
+}
+
+interface SVGTests {
+ requiredExtensions: SVGStringList;
+ requiredFeatures: SVGStringList;
+ systemLanguage: SVGStringList;
+ hasExtension(extension: string): boolean;
+}
+
+interface SVGTransformable extends SVGLocatable {
+ transform: SVGAnimatedTransformList;
+}
+
+interface SVGURIReference {
+ href: SVGAnimatedString;
+}
+
+interface WindowBase64 {
+ atob(encodedString: string): string;
+ btoa(rawString: string): string;
+}
+
+interface WindowConsole {
+ console: Console;
+}
+
+interface WindowLocalStorage {
+ localStorage: Storage;
+}
+
+interface WindowSessionStorage {
+ sessionStorage: Storage;
+}
+
+interface WindowTimers extends Object, WindowTimersExtension {
+ clearInterval(handle: number): void;
+ clearTimeout(handle: number): void;
+ setInterval(handler: any, timeout?: any, ...args: any[]): number;
+ setTimeout(handler: any, timeout?: any, ...args: any[]): number;
+}
+
+interface WindowTimersExtension {
+ clearImmediate(handle: number): void;
+ msClearImmediate(handle: number): void;
+ msSetImmediate(expression: any, ...args: any[]): number;
+ setImmediate(expression: any, ...args: any[]): number;
+}
+
+interface XMLHttpRequestEventTarget {
+ onabort: (ev: Event) => any;
+ onerror: (ev: Event) => any;
+ onload: (ev: Event) => any;
+ onloadend: (ev: ProgressEvent) => any;
+ onloadstart: (ev: Event) => any;
+ onprogress: (ev: ProgressEvent) => any;
+ ontimeout: (ev: ProgressEvent) => any;
+ addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+ addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+}
+
+interface IDBObjectStoreParameters {
+ keyPath?: string | string[];
+ autoIncrement?: boolean;
+}
+
+interface IDBIndexParameters {
+ unique?: boolean;
+ multiEntry?: boolean;
+}
+
+interface NodeListOf<TNode extends Node> extends NodeList {
+ length: number;
+ item(index: number): TNode;
+ [index: number]: TNode;
+}
+
+interface BlobPropertyBag {
+ type?: string;
+ endings?: string;
+}
+
+interface FilePropertyBag {
+ type?: string;
+ lastModified?: number;
+}
+
+interface EventListenerObject {
+ handleEvent(evt: Event): void;
+}
+
+interface MessageEventInit extends EventInit {
+ data?: any;
+ origin?: string;
+ lastEventId?: string;
+ channel?: string;
+ source?: any;
+ ports?: MessagePort[];
+}
+
+interface ProgressEventInit extends EventInit {
+ lengthComputable?: boolean;
+ loaded?: number;
+ total?: number;
+}
+
+interface HTMLTemplateElement extends HTMLElement {
+ content: DocumentFragment;
+}
+
+declare var HTMLTemplateElement: {
+ prototype: HTMLTemplateElement;
+ new(): HTMLTemplateElement;
+}
+
+declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
+
+interface ErrorEventHandler {
+ (message: string, filename?: string, lineno?: number, colno?: number, error?:Error): void;
+}
+interface PositionCallback {
+ (position: Position): void;
+}
+interface PositionErrorCallback {
+ (error: PositionError): void;
+}
+interface MediaQueryListListener {
+ (mql: MediaQueryList): void;
+}
+interface MSLaunchUriCallback {
+ (): void;
+}
+interface FrameRequestCallback {
+ (time: number): void;
+}
+interface MSUnsafeFunctionCallback {
+ (): any;
+}
+interface MSExecAtPriorityFunctionCallback {
+ (...args: any[]): any;
+}
+interface MutationCallback {
+ (mutations: MutationRecord[], observer: MutationObserver): void;
+}
+interface DecodeSuccessCallback {
+ (decodedData: AudioBuffer): void;
+}
+interface DecodeErrorCallback {
+ (): void;
+}
+interface FunctionStringCallback {
+ (data: string): void;
+}
+declare var Audio: {new(src?: string): HTMLAudioElement; };
+declare var Image: {new(width?: number, height?: number): HTMLImageElement; };
+declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; };
+declare var animationStartTime: number;
+declare var applicationCache: ApplicationCache;
+declare var clientInformation: Navigator;
+declare var closed: boolean;
+declare var crypto: Crypto;
+declare var defaultStatus: string;
+declare var devicePixelRatio: number;
+declare var doNotTrack: string;
+declare var document: Document;
+declare var event: Event;
+declare var external: External;
+declare var frameElement: Element;
+declare var frames: Window;
+declare var history: History;
+declare var innerHeight: number;
+declare var innerWidth: number;
+declare var length: number;
+declare var location: Location;
+declare var locationbar: BarProp;
+declare var menubar: BarProp;
+declare var msAnimationStartTime: number;
+declare var name: string;
+declare var navigator: Navigator;
+declare var offscreenBuffering: string | boolean;
+declare var onabort: (ev: Event) => any;
+declare var onafterprint: (ev: Event) => any;
+declare var onbeforeprint: (ev: Event) => any;
+declare var onbeforeunload: (ev: BeforeUnloadEvent) => any;
+declare var onblur: (ev: FocusEvent) => any;
+declare var oncanplay: (ev: Event) => any;
+declare var oncanplaythrough: (ev: Event) => any;
+declare var onchange: (ev: Event) => any;
+declare var onclick: (ev: MouseEvent) => any;
+declare var oncompassneedscalibration: (ev: Event) => any;
+declare var oncontextmenu: (ev: PointerEvent) => any;
+declare var ondblclick: (ev: MouseEvent) => any;
+declare var ondevicemotion: (ev: DeviceMotionEvent) => any;
+declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any;
+declare var ondrag: (ev: DragEvent) => any;
+declare var ondragend: (ev: DragEvent) => any;
+declare var ondragenter: (ev: DragEvent) => any;
+declare var ondragleave: (ev: DragEvent) => any;
+declare var ondragover: (ev: DragEvent) => any;
+declare var ondragstart: (ev: DragEvent) => any;
+declare var ondrop: (ev: DragEvent) => any;
+declare var ondurationchange: (ev: Event) => any;
+declare var onemptied: (ev: Event) => any;
+declare var onended: (ev: Event) => any;
+declare var onerror: ErrorEventHandler;
+declare var onfocus: (ev: FocusEvent) => any;
+declare var onhashchange: (ev: HashChangeEvent) => any;
+declare var oninput: (ev: Event) => any;
+declare var onkeydown: (ev: KeyboardEvent) => any;
+declare var onkeypress: (ev: KeyboardEvent) => any;
+declare var onkeyup: (ev: KeyboardEvent) => any;
+declare var onload: (ev: Event) => any;
+declare var onloadeddata: (ev: Event) => any;
+declare var onloadedmetadata: (ev: Event) => any;
+declare var onloadstart: (ev: Event) => any;
+declare var onmessage: (ev: MessageEvent) => any;
+declare var onmousedown: (ev: MouseEvent) => any;
+declare var onmouseenter: (ev: MouseEvent) => any;
+declare var onmouseleave: (ev: MouseEvent) => any;
+declare var onmousemove: (ev: MouseEvent) => any;
+declare var onmouseout: (ev: MouseEvent) => any;
+declare var onmouseover: (ev: MouseEvent) => any;
+declare var onmouseup: (ev: MouseEvent) => any;
+declare var onmousewheel: (ev: MouseWheelEvent) => any;
+declare var onmsgesturechange: (ev: MSGestureEvent) => any;
+declare var onmsgesturedoubletap: (ev: MSGestureEvent) => any;
+declare var onmsgestureend: (ev: MSGestureEvent) => any;
+declare var onmsgesturehold: (ev: MSGestureEvent) => any;
+declare var onmsgesturestart: (ev: MSGestureEvent) => any;
+declare var onmsgesturetap: (ev: MSGestureEvent) => any;
+declare var onmsinertiastart: (ev: MSGestureEvent) => any;
+declare var onmspointercancel: (ev: MSPointerEvent) => any;
+declare var onmspointerdown: (ev: MSPointerEvent) => any;
+declare var onmspointerenter: (ev: MSPointerEvent) => any;
+declare var onmspointerleave: (ev: MSPointerEvent) => any;
+declare var onmspointermove: (ev: MSPointerEvent) => any;
+declare var onmspointerout: (ev: MSPointerEvent) => any;
+declare var onmspointerover: (ev: MSPointerEvent) => any;
+declare var onmspointerup: (ev: MSPointerEvent) => any;
+declare var onoffline: (ev: Event) => any;
+declare var ononline: (ev: Event) => any;
+declare var onorientationchange: (ev: Event) => any;
+declare var onpagehide: (ev: PageTransitionEvent) => any;
+declare var onpageshow: (ev: PageTransitionEvent) => any;
+declare var onpause: (ev: Event) => any;
+declare var onplay: (ev: Event) => any;
+declare var onplaying: (ev: Event) => any;
+declare var onpopstate: (ev: PopStateEvent) => any;
+declare var onprogress: (ev: ProgressEvent) => any;
+declare var onratechange: (ev: Event) => any;
+declare var onreadystatechange: (ev: ProgressEvent) => any;
+declare var onreset: (ev: Event) => any;
+declare var onresize: (ev: UIEvent) => any;
+declare var onscroll: (ev: UIEvent) => any;
+declare var onseeked: (ev: Event) => any;
+declare var onseeking: (ev: Event) => any;
+declare var onselect: (ev: UIEvent) => any;
+declare var onstalled: (ev: Event) => any;
+declare var onstorage: (ev: StorageEvent) => any;
+declare var onsubmit: (ev: Event) => any;
+declare var onsuspend: (ev: Event) => any;
+declare var ontimeupdate: (ev: Event) => any;
+declare var ontouchcancel: any;
+declare var ontouchend: any;
+declare var ontouchmove: any;
+declare var ontouchstart: any;
+declare var onunload: (ev: Event) => any;
+declare var onvolumechange: (ev: Event) => any;
+declare var onwaiting: (ev: Event) => any;
+declare var opener: Window;
+declare var orientation: string | number;
+declare var outerHeight: number;
+declare var outerWidth: number;
+declare var pageXOffset: number;
+declare var pageYOffset: number;
+declare var parent: Window;
+declare var performance: Performance;
+declare var personalbar: BarProp;
+declare var screen: Screen;
+declare var screenLeft: number;
+declare var screenTop: number;
+declare var screenX: number;
+declare var screenY: number;
+declare var scrollX: number;
+declare var scrollY: number;
+declare var scrollbars: BarProp;
+declare var self: Window;
+declare var status: string;
+declare var statusbar: BarProp;
+declare var styleMedia: StyleMedia;
+declare var toolbar: BarProp;
+declare var top: Window;
+declare var window: Window;
+declare var URL: URL;
+declare function alert(message?: any): void;
+declare function blur(): void;
+declare function cancelAnimationFrame(handle: number): void;
+declare function captureEvents(): void;
+declare function close(): void;
+declare function confirm(message?: string): boolean;
+declare function focus(): void;
+declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;
+declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList;
+declare function getSelection(): Selection;
+declare function matchMedia(mediaQuery: string): MediaQueryList;
+declare function moveBy(x?: number, y?: number): void;
+declare function moveTo(x?: number, y?: number): void;
+declare function msCancelRequestAnimationFrame(handle: number): void;
+declare function msMatchMedia(mediaQuery: string): MediaQueryList;
+declare function msRequestAnimationFrame(callback: FrameRequestCallback): number;
+declare function msWriteProfilerMark(profilerMarkName: string): void;
+declare function open(url?: string, target?: string, features?: string, replace?: boolean): any;
+declare function postMessage(message: any, targetOrigin: string, ports?: any): void;
+declare function print(): void;
+declare function prompt(message?: string, _default?: string): string;
+declare function releaseEvents(): void;
+declare function requestAnimationFrame(callback: FrameRequestCallback): number;
+declare function resizeBy(x?: number, y?: number): void;
+declare function resizeTo(x?: number, y?: number): void;
+declare function scroll(x?: number, y?: number): void;
+declare function scrollBy(x?: number, y?: number): void;
+declare function scrollTo(x?: number, y?: number): void;
+declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;
+declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;
+declare function toString(): string;
+declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+declare function dispatchEvent(evt: Event): boolean;
+declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
+declare function clearInterval(handle: number): void;
+declare function clearTimeout(handle: number): void;
+declare function setInterval(handler: any, timeout?: any, ...args: any[]): number;
+declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number;
+declare function clearImmediate(handle: number): void;
+declare function msClearImmediate(handle: number): void;
+declare function msSetImmediate(expression: any, ...args: any[]): number;
+declare function setImmediate(expression: any, ...args: any[]): number;
+declare var sessionStorage: Storage;
+declare var localStorage: Storage;
+declare var console: Console;
+declare var onpointercancel: (ev: PointerEvent) => any;
+declare var onpointerdown: (ev: PointerEvent) => any;
+declare var onpointerenter: (ev: PointerEvent) => any;
+declare var onpointerleave: (ev: PointerEvent) => any;
+declare var onpointermove: (ev: PointerEvent) => any;
+declare var onpointerout: (ev: PointerEvent) => any;
+declare var onpointerover: (ev: PointerEvent) => any;
+declare var onpointerup: (ev: PointerEvent) => any;
+declare var onwheel: (ev: WheelEvent) => any;
+declare var indexedDB: IDBFactory;
+declare var msIndexedDB: IDBFactory;
+declare function atob(encodedString: string): string;
+declare function btoa(rawString: string): string;
+declare function addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void;
+declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void;
+declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;interface DOMTokenList {
+ [Symbol.iterator](): IterableIterator<string>;
+}
+
+interface NodeList {
+ [Symbol.iterator](): IterableIterator<Node>
+}
+
+interface NodeListOf<TNode extends Node> {
+ [Symbol.iterator](): IterableIterator<TNode>
+}
+
+/////////////////////////////
+/// WorkerGlobalScope APIs
+/////////////////////////////
+// These are only available in a Web Worker
+declare function importScripts(...urls: string[]): void;
+
+
+/////////////////////////////
+/// Windows Script Host APIS
+/////////////////////////////
+
+
+interface ActiveXObject {
+ new (s: string): any;
+}
+declare var ActiveXObject: ActiveXObject;
+
+interface ITextWriter {
+ Write(s: string): void;
+ WriteLine(s: string): void;
+ Close(): void;
+}
+
+interface TextStreamBase {
+ /**
+ * The column number of the current character position in an input stream.
+ */
+ Column: number;
+
+ /**
+ * The current line number in an input stream.
+ */
+ Line: number;
+
+ /**
+ * Closes a text stream.
+ * It is not necessary to close standard streams; they close automatically when the process ends. If
+ * you close a standard stream, be aware that any other pointers to that standard stream become invalid.
+ */
+ Close(): void;
+}
+
+interface TextStreamWriter extends TextStreamBase {
+ /**
+ * Sends a string to an output stream.
+ */
+ Write(s: string): void;
+
+ /**
+ * Sends a specified number of blank lines (newline characters) to an output stream.
+ */
+ WriteBlankLines(intLines: number): void;
+
+ /**
+ * Sends a string followed by a newline character to an output stream.
+ */
+ WriteLine(s: string): void;
+}
+
+interface TextStreamReader extends TextStreamBase {
+ /**
+ * Returns a specified number of characters from an input stream, starting at the current pointer position.
+ * Does not return until the ENTER key is pressed.
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
+ */
+ Read(characters: number): string;
+
+ /**
+ * Returns all characters from an input stream.
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
+ */
+ ReadAll(): string;
+
+ /**
+ * Returns an entire line from an input stream.
+ * Although this method extracts the newline character, it does not add it to the returned string.
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
+ */
+ ReadLine(): string;
+
+ /**
+ * Skips a specified number of characters when reading from an input text stream.
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
+ * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.)
+ */
+ Skip(characters: number): void;
+
+ /**
+ * Skips the next line when reading from an input text stream.
+ * Can only be used on a stream in reading mode, not writing or appending mode.
+ */
+ SkipLine(): void;
+
+ /**
+ * Indicates whether the stream pointer position is at the end of a line.
+ */
+ AtEndOfLine: boolean;
+
+ /**
+ * Indicates whether the stream pointer position is at the end of a stream.
+ */
+ AtEndOfStream: boolean;
+}
+
+declare var WScript: {
+ /**
+ * Outputs text to either a message box (under WScript.exe) or the command console window followed by
+ * a newline (under CScript.exe).
+ */
+ Echo(s: any): void;
+
+ /**
+ * Exposes the write-only error output stream for the current script.
+ * Can be accessed only while using CScript.exe.
+ */
+ StdErr: TextStreamWriter;
+
+ /**
+ * Exposes the write-only output stream for the current script.
+ * Can be accessed only while using CScript.exe.
+ */
+ StdOut: TextStreamWriter;
+ Arguments: { length: number; Item(n: number): string; };
+
+ /**
+ * The full path of the currently running script.
+ */
+ ScriptFullName: string;
+
+ /**
+ * Forces the script to stop immediately, with an optional exit code.
+ */
+ Quit(exitCode?: number): number;
+
+ /**
+ * The Windows Script Host build version number.
+ */
+ BuildVersion: number;
+
+ /**
+ * Fully qualified path of the host executable.
+ */
+ FullName: string;
+
+ /**
+ * Gets/sets the script mode - interactive(true) or batch(false).
+ */
+ Interactive: boolean;
+
+ /**
+ * The name of the host executable (WScript.exe or CScript.exe).
+ */
+ Name: string;
+
+ /**
+ * Path of the directory containing the host executable.
+ */
+ Path: string;
+
+ /**
+ * The filename of the currently running script.
+ */
+ ScriptName: string;
+
+ /**
+ * Exposes the read-only input stream for the current script.
+ * Can be accessed only while using CScript.exe.
+ */
+ StdIn: TextStreamReader;
+
+ /**
+ * Windows Script Host version
+ */
+ Version: string;
+
+ /**
+ * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event.
+ */
+ ConnectObject(objEventSource: any, strPrefix: string): void;
+
+ /**
+ * Creates a COM object.
+ * @param strProgiID
+ * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.
+ */
+ CreateObject(strProgID: string, strPrefix?: string): any;
+
+ /**
+ * Disconnects a COM object from its event sources.
+ */
+ DisconnectObject(obj: any): void;
+
+ /**
+ * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file.
+ * @param strPathname Fully qualified path to the file containing the object persisted to disk.
+ * For objects in memory, pass a zero-length string.
+ * @param strProgID
+ * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.
+ */
+ GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any;
+
+ /**
+ * Suspends script execution for a specified length of time, then continues execution.
+ * @param intTime Interval (in milliseconds) to suspend script execution.
+ */
+ Sleep(intTime: number): void;
+};
+
+/**
+ * Allows enumerating over a COM collection, which may not have indexed item access.
+ */
+interface Enumerator<T> {
+ /**
+ * Returns true if the current item is the last one in the collection, or the collection is empty,
+ * or the current item is undefined.
+ */
+ atEnd(): boolean;
+
+ /**
+ * Returns the current item in the collection
+ */
+ item(): T;
+
+ /**
+ * Resets the current item in the collection to the first item. If there are no items in the collection,
+ * the current item is set to undefined.
+ */
+ moveFirst(): void;
+
+ /**
+ * Moves the current item to the next item in the collection. If the enumerator is at the end of
+ * the collection or the collection is empty, the current item is set to undefined.
+ */
+ moveNext(): void;
+}
+
+interface EnumeratorConstructor {
+ new <T>(collection: any): Enumerator<T>;
+ new (collection: any): Enumerator<any>;
+}
+
+declare var Enumerator: EnumeratorConstructor;
+
+/**
+ * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions.
+ */
+interface VBArray<T> {
+ /**
+ * Returns the number of dimensions (1-based).
+ */
+ dimensions(): number;
+
+ /**
+ * Takes an index for each dimension in the array, and returns the item at the corresponding location.
+ */
+ getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T;
+
+ /**
+ * Returns the smallest available index for a given dimension.
+ * @param dimension 1-based dimension (defaults to 1)
+ */
+ lbound(dimension?: number): number;
+
+ /**
+ * Returns the largest available index for a given dimension.
+ * @param dimension 1-based dimension (defaults to 1)
+ */
+ ubound(dimension?: number): number;
+
+ /**
+ * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions,
+ * each successive dimension is appended to the end of the array.
+ * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6]
+ */
+ toArray(): T[];
+}
+
+interface VBArrayConstructor {
+ new <T>(safeArray: any): VBArray<T>;
+ new (safeArray: any): VBArray<any>;
+}
+
+declare var VBArray: VBArrayConstructor;
diff --git a/lib/decl/lodash.d.ts b/lib/decl/lodash.d.ts new file mode 100644 index 000000000..f9249d16b --- /dev/null +++ b/lib/decl/lodash.d.ts @@ -0,0 +1,16525 @@ +// Type definitions for Lo-Dash +// Project: http://lodash.com/ +// Definitions by: Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu> +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/** +### 4.0.0 Changelog (https://github.com/lodash/lodash/wiki/Changelog) + +#### TODO: +removed: +- [x] Removed _.support +- [x] Removed _.findWhere in favor of _.find with iteratee shorthand +- [x] Removed _.where in favor of _.filter with iteratee shorthand +- [x] Removed _.pluck in favor of _.map with iteratee shorthand + +renamed: +- [x] Renamed _.first to _.head +- [x] Renamed _.indexBy to _.keyBy +- [x] Renamed _.invoke to _.invokeMap +- [x] Renamed _.overArgs to _.overArgs +- [x] Renamed _.padLeft & _.padRight to _.padStart & _.padEnd +- [x] Renamed _.pairs to _.toPairs +- [x] Renamed _.rest to _.tail +- [x] Renamed _.restParam to _.rest +- [x] Renamed _.sortByOrder to _.orderBy +- [x] Renamed _.trimLeft & _.trimRight to _.trimStart & _.trimEnd +- [x] Renamed _.trunc to _.truncate + +split: +- [x] Split _.indexOf & _.lastIndexOf into _.sortedIndexOf & _.sortedLastIndexOf +- [x] Split _.max & _.min into _.maxBy & _.minBy +- [x] Split _.omit & _.pick into _.omitBy & _.pickBy +- [x] Split _.sample into _.sampleSize +- [x] Split _.sortedIndex into _.sortedIndexBy +- [x] Split _.sortedLastIndex into _.sortedLastIndexBy +- [x] Split _.uniq into _.sortedUniq, _.sortedUniqBy, & _.uniqBy + +changes: +- [x] Absorbed _.sortByAll into _.sortBy +- [x] Changed the category of _.at to “Object” +- [x] Changed the category of _.bindAll to “Utility” +- [x] Made _.capitalize uppercase the first character & lowercase the rest +- [x] Made _.functions return only own method names + + +added 23 array methods: +- [x] _.concat +- [x] _.differenceBy +- [x] _.differenceWith +- [x] _.flatMap +- [x] _.fromPairs +- [x] _.intersectionBy +- [x] _.intersectionWith +- [x] _.join +- [x] _.pullAll +- [x] _.pullAllBy +- [x] _.reverse +- [x] _.sortedIndexBy +- [x] _.sortedIndexOf +- [x] _.sortedLastIndexBy +- [x] _.sortedLastIndexOf +- [x] _.sortedUniq +- [x] _.sortedUniqBy +- [x] _.unionBy +- [x] _.unionWith +- [x] _.uniqBy +- [x] _.uniqWith +- [x] _.xorBy +- [x] _.xorWith + +added 18 lang methods: +- [x] _.cloneDeepWith +- [x] _.cloneWith +- [x] _.eq +- [x] _.isArrayLike +- [x] _.isArrayLikeObject +- [x] _.isEqualWith +- [x] _.isInteger +- [x] _.isLength +- [x] _.isMatchWith +- [x] _.isNil +- [x] _.isObjectLike +- [x] _.isSafeInteger +- [x] _.isSymbol +- [x] _.toInteger +- [x] _.toLength +- [x] _.toNumber +- [x] _.toSafeInteger +- [x] _.toString + +added 13 object methods: +- [x] _.assignIn +- [x] _.assignInWith +- [x] _.assignWith +- [x] _.functionsIn +- [x] _.hasIn +- [x] _.mergeWith +- [x] _.omitBy +- [x] _.pickBy + + +added 8 string methods: +- [x] _.lowerCase +- [x] _.lowerFirst +- [x] _.upperCase +- [x] _.upperFirst +- [x] _.toLower +- [x] _.toUpper + +added 8 utility methods: +- [x] _.toPath + +added 4 math methods: +- [x] _.maxBy +- [x] _.mean +- [x] _.minBy +- [x] _.sumBy + +added 2 function methods: +- [x] _.flip +- [x] _.unary + +added 2 number methods: +- [x] _.clamp +- [x] _.subtract + +added collection method: +- [x] _.sampleSize + +Added 3 aliases + +- [x] _.first as an alias of _.head + +Removed 17 aliases +- [x] Removed aliase _.all +- [x] Removed aliase _.any +- [x] Removed aliase _.backflow +- [x] Removed aliase _.callback +- [x] Removed aliase _.collect +- [x] Removed aliase _.compose +- [x] Removed aliase _.contains +- [x] Removed aliase _.detect +- [x] Removed aliase _.foldl +- [x] Removed aliase _.foldr +- [x] Removed aliase _.include +- [x] Removed aliase _.inject +- [x] Removed aliase _.methods +- [x] Removed aliase _.object +- [x] Removed aliase _.run +- [x] Removed aliase _.select +- [x] Removed aliase _.unique + +Other changes +- [x] Added support for array buffers to _.isEqual +- [x] Added support for converting iterators to _.toArray +- [x] Added support for deep paths to _.zipObject +- [x] Changed UMD to export to window or self when available regardless of other exports +- [x] Ensured debounce cancel clears args & thisArg references +- [x] Ensured _.add, _.subtract, & _.sum don’t skip NaN values +- [x] Ensured _.clone treats generators like functions +- [x] Ensured _.clone produces clones with the source’s [[Prototype]] +- [x] Ensured _.defaults assigns properties that shadow Object.prototype +- [x] Ensured _.defaultsDeep doesn’t merge a string into an array +- [x] Ensured _.defaultsDeep & _.merge don’t modify sources +- [x] Ensured _.defaultsDeep works with circular references +- [x] Ensured _.keys skips “length” on strict mode arguments objects in Safari 9 +- [x] Ensured _.merge doesn’t convert strings to arrays +- [x] Ensured _.merge merges plain-objects onto non plain-objects +- [x] Ensured _#plant resets iterator data of cloned sequences +- [x] Ensured _.random swaps min & max if min is greater than max +- [x] Ensured _.range preserves the sign of start of -0 +- [x] Ensured _.reduce & _.reduceRight use getIteratee in their array branch +- [x] Fixed rounding issue with the precision param of _.floor + +** LATER ** +Misc: +- [ ] Made _.forEach, _.forIn, _.forOwn, & _.times implicitly end a chain sequence +- [ ] Removed thisArg params from most methods +- [ ] Made “By” methods provide a single param to iteratees +- [ ] Made _.words chainable by default +- [ ] Removed isDeep params from _.clone & _.flatten +- [ ] Removed _.bindAll support for binding all methods when no names are provided +- [ ] Removed func-first param signature from _.before & _.after +- [ ] _.extend as an alias of _.assignIn +- [ ] _.extendWith as an alias of _.assignInWith +- [ ] Added clear method to _.memoize.Cache +- [ ] Added flush method to debounced & throttled functions +- [ ] Added support for ES6 maps, sets, & symbols to _.clone, _.isEqual, & _.toArray +- [ ] Enabled _.flow & _.flowRight to accept an array of functions +- [ ] Ensured “Collection” methods treat functions as objects +- [ ] Ensured _.assign, _.defaults, & _.merge coerce object values to objects +- [ ] Ensured _.bindKey bound functions call object[key] when called with the new operator +- [ ] Ensured _.isFunction returns true for generator functions +- [ ] Ensured _.merge assigns typed arrays directly +- [ ] Made _(...) an iterator & iterable +- [ ] Made _.drop, _.take, & right forms coerce n of undefined to 0 + +Methods: +- [ ] _.concat +- [ ] _.differenceBy +- [ ] _.differenceWith +- [ ] _.flatMap +- [ ] _.fromPairs +- [ ] _.intersectionBy +- [ ] _.intersectionWith +- [ ] _.join +- [ ] _.pullAll +- [ ] _.pullAllBy +- [ ] _.reverse +- [ ] _.sortedLastIndexOf +- [ ] _.unionBy +- [ ] _.unionWith +- [ ] _.uniqWith +- [ ] _.xorBy +- [ ] _.xorWith +- [ ] _.toString + +- [ ] _.invoke +- [ ] _.setWith +- [ ] _.toPairs +- [ ] _.toPairsIn +- [ ] _.unset + +- [ ] _.replace +- [ ] _.split + +- [ ] _.cond +- [ ] _.conforms +- [ ] _.nthArg +- [ ] _.over +- [ ] _.overEvery +- [ ] _.overSome +- [ ] _.rangeRight + +- [ ] _.next +*/ + +declare var _: _.LoDashStatic; + +declare module _ { + interface LoDashStatic { + /** + * Creates a lodash object which wraps the given value to enable intuitive method chaining. + * + * In addition to Lo-Dash methods, wrappers also have the following Array methods: + * concat, join, pop, push, reverse, shift, slice, sort, splice, and unshift + * + * Chaining is supported in custom builds as long as the value method is implicitly or + * explicitly included in the build. + * + * The chainable wrapper functions are: + * after, assign, bind, bindAll, bindKey, chain, chunk, compact, compose, concat, countBy, + * createCallback, curry, debounce, defaults, defer, delay, difference, filter, flatten, + * forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy, + * keyBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min, + * object, omit, once, pairs, partial, partialRight, pick, pluck, pull, push, range, reject, + * remove, rest, reverse, sample, shuffle, slice, sort, sortBy, splice, tap, throttle, times, + * toArray, transform, union, uniq, unshift, unzip, values, where, without, wrap, and zip + * + * The non-chainable wrapper functions are: + * clone, cloneDeep, contains, escape, every, find, findIndex, findKey, findLast, + * findLastIndex, findLastKey, has, identity, indexOf, isArguments, isArray, isBoolean, + * isDate, isElement, isEmpty, isEqual, isFinite, isFunction, isNaN, isNull, isNumber, + * isObject, isPlainObject, isRegExp, isString, isUndefined, join, lastIndexOf, mixin, + * noConflict, parseInt, pop, random, reduce, reduceRight, result, shift, size, some, + * sortedIndex, runInContext, template, unescape, uniqueId, and value + * + * The wrapper functions first and last return wrapped values when n is provided, otherwise + * they return unwrapped values. + * + * Explicit chaining can be enabled by using the _.chain method. + **/ + (value: number): LoDashImplicitWrapper<number>; + (value: string): LoDashImplicitStringWrapper; + (value: boolean): LoDashImplicitWrapper<boolean>; + (value: Array<number>): LoDashImplicitNumberArrayWrapper; + <T>(value: Array<T>): LoDashImplicitArrayWrapper<T>; + <T extends {}>(value: T): LoDashImplicitObjectWrapper<T>; + (value: any): LoDashImplicitWrapper<any>; + + /** + * The semantic version number. + **/ + VERSION: string; + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby + * (ERB). Change the following template settings to use alternative delimiters. + **/ + templateSettings: TemplateSettings; + } + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby + * (ERB). Change the following template settings to use alternative delimiters. + **/ + interface TemplateSettings { + /** + * The "escape" delimiter. + **/ + escape?: RegExp; + + /** + * The "evaluate" delimiter. + **/ + evaluate?: RegExp; + + /** + * An object to import into the template as local variables. + **/ + imports?: Dictionary<any>; + + /** + * The "interpolate" delimiter. + **/ + interpolate?: RegExp; + + /** + * Used to reference the data object in the template text. + **/ + variable?: string; + } + + /** + * Creates a cache object to store key/value pairs. + */ + interface MapCache { + /** + * Removes `key` and its value from the cache. + * @param key The key of the value to remove. + * @return Returns `true` if the entry was removed successfully, else `false`. + */ + delete(key: string): boolean; + + /** + * Gets the cached value for `key`. + * @param key The key of the value to get. + * @return Returns the cached value. + */ + get(key: string): any; + + /** + * Checks if a cached value for `key` exists. + * @param key The key of the entry to check. + * @return Returns `true` if an entry for `key` exists, else `false`. + */ + has(key: string): boolean; + + /** + * Sets `value` to `key` of the cache. + * @param key The key of the value to cache. + * @param value The value to cache. + * @return Returns the cache object. + */ + set(key: string, value: any): _.Dictionary<any>; + } + + interface LoDashWrapperBase<T, TWrapper> { } + + interface LoDashImplicitWrapperBase<T, TWrapper> extends LoDashWrapperBase<T, TWrapper> { } + + interface LoDashExplicitWrapperBase<T, TWrapper> extends LoDashWrapperBase<T, TWrapper> { } + + interface LoDashImplicitWrapper<T> extends LoDashImplicitWrapperBase<T, LoDashImplicitWrapper<T>> { } + + interface LoDashExplicitWrapper<T> extends LoDashExplicitWrapperBase<T, LoDashExplicitWrapper<T>> { } + + interface LoDashImplicitStringWrapper extends LoDashImplicitWrapper<string> { } + + interface LoDashExplicitStringWrapper extends LoDashExplicitWrapper<string> { } + + interface LoDashImplicitObjectWrapper<T> extends LoDashImplicitWrapperBase<T, LoDashImplicitObjectWrapper<T>> { } + + interface LoDashExplicitObjectWrapper<T> extends LoDashExplicitWrapperBase<T, LoDashExplicitObjectWrapper<T>> { } + + interface LoDashImplicitArrayWrapper<T> extends LoDashImplicitWrapperBase<T[], LoDashImplicitArrayWrapper<T>> { + join(seperator?: string): string; + pop(): T; + push(...items: T[]): LoDashImplicitArrayWrapper<T>; + shift(): T; + sort(compareFn?: (a: T, b: T) => number): LoDashImplicitArrayWrapper<T>; + splice(start: number): LoDashImplicitArrayWrapper<T>; + splice(start: number, deleteCount: number, ...items: any[]): LoDashImplicitArrayWrapper<T>; + unshift(...items: T[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> extends LoDashExplicitWrapperBase<T[], LoDashExplicitArrayWrapper<T>> { } + + interface LoDashImplicitNumberArrayWrapper extends LoDashImplicitArrayWrapper<number> { } + + interface LoDashExplicitNumberArrayWrapper extends LoDashExplicitArrayWrapper<number> { } + + /********* + * Array * + *********/ + + //_.chunk + interface LoDashStatic { + /** + * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the + * final chunk will be the remaining elements. + * + * @param array The array to process. + * @param size The length of each chunk. + * @return Returns the new array containing chunks. + */ + chunk<T>( + array: List<T>, + size?: number + ): T[][]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.chunk + */ + chunk(size?: number): LoDashImplicitArrayWrapper<T[]>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.chunk + */ + chunk<TResult>(size?: number): LoDashImplicitArrayWrapper<TResult[]>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.chunk + */ + chunk(size?: number): LoDashExplicitArrayWrapper<T[]>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.chunk + */ + chunk<TResult>(size?: number): LoDashExplicitArrayWrapper<TResult[]>; + } + + //_.compact + interface LoDashStatic { + /** + * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are + * falsey. + * + * @param array The array to compact. + * @return (Array) Returns the new array of filtered values. + */ + compact<T>(array?: List<T>): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.compact + */ + compact(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.compact + */ + compact<TResult>(): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.compact + */ + compact(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.compact + */ + compact<TResult>(): LoDashExplicitArrayWrapper<TResult>; + } + + //_.concat DUMMY + interface LoDashStatic { + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + concat<T>(...values: (T[]|List<T>)[]) : T[]; + } + + //_.difference + interface LoDashStatic { + /** + * Creates an array of unique array values not included in the other provided arrays using SameValueZero for + * equality comparisons. + * + * @param array The array to inspect. + * @param values The arrays of values to exclude. + * @return Returns the new array of filtered values. + */ + difference<T>( + array: any[]|List<any>, + ...values: any[] + ): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.difference + */ + difference(...values: (T[]|List<T>)[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.difference + */ + difference<TValue>(...values: (TValue[]|List<TValue>)[]): LoDashImplicitArrayWrapper<TValue>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.difference + */ + difference(...values: (T[]|List<T>)[]): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.difference + */ + difference<TValue>(...values: (TValue[]|List<TValue>)[]): LoDashExplicitArrayWrapper<TValue>; + } + + //_.differenceBy DUMMY + interface LoDashStatic { + /** + * Creates an array of unique `array` values not included in the other + * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.difference([3, 2, 1], [4, 2]); + * // => [3, 1] + */ + differenceBy( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.differenceWith DUMMY + interface LoDashStatic { + /** + * Creates an array of unique `array` values not included in the other + * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.difference([3, 2, 1], [4, 2]); + * // => [3, 1] + */ + differenceWith( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.drop + interface LoDashStatic { + /** + * Creates a slice of array with n elements dropped from the beginning. + * + * @param array The array to query. + * @param n The number of elements to drop. + * @return Returns the slice of array. + */ + drop<T>(array: T[]|List<T>, n?: number): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.drop + */ + drop(n?: number): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.drop + */ + drop<T>(n?: number): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.drop + */ + drop(n?: number): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.drop + */ + drop<T>(n?: number): LoDashExplicitArrayWrapper<T>; + } + + //_.dropRight + interface LoDashStatic { + /** + * Creates a slice of array with n elements dropped from the end. + * + * @param array The array to query. + * @param n The number of elements to drop. + * @return Returns the slice of array. + */ + dropRight<T>( + array: List<T>, + n?: number + ): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.dropRight + */ + dropRight(n?: number): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.dropRight + */ + dropRight<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.dropRight + */ + dropRight(n?: number): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.dropRight + */ + dropRight<TResult>(n?: number): LoDashExplicitArrayWrapper<TResult>; + } + + //_.dropRightWhile + interface LoDashStatic { + /** + * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate + * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * match the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + dropRightWhile<TValue>( + array: List<TValue>, + predicate?: ListIterator<TValue, boolean>, + thisArg?: any + ): TValue[]; + + /** + * @see _.dropRightWhile + */ + dropRightWhile<TValue>( + array: List<TValue>, + predicate?: string, + thisArg?: any + ): TValue[]; + + /** + * @see _.dropRightWhile + */ + dropRightWhile<TWhere, TValue>( + array: List<TValue>, + predicate?: TWhere + ): TValue[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.dropRightWhile + */ + dropRightWhile<TWhere>( + predicate?: TWhere + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.dropRightWhile + */ + dropRightWhile<TValue>( + predicate?: ListIterator<TValue, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<TValue>; + + /** + * @see _.dropRightWhile + */ + dropRightWhile<TValue>( + predicate?: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<TValue>; + + /** + * @see _.dropRightWhile + */ + dropRightWhile<TWhere, TValue>( + predicate?: TWhere + ): LoDashImplicitArrayWrapper<TValue>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.dropRightWhile + */ + dropRightWhile( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.dropRightWhile + */ + dropRightWhile<TWhere>( + predicate?: TWhere + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.dropRightWhile + */ + dropRightWhile<TValue>( + predicate?: ListIterator<TValue, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<TValue>; + + /** + * @see _.dropRightWhile + */ + dropRightWhile<TValue>( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<TValue>; + + /** + * @see _.dropRightWhile + */ + dropRightWhile<TWhere, TValue>( + predicate?: TWhere + ): LoDashExplicitArrayWrapper<TValue>; + } + + //_.dropWhile + interface LoDashStatic { + /** + * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate + * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + dropWhile<TValue>( + array: List<TValue>, + predicate?: ListIterator<TValue, boolean>, + thisArg?: any + ): TValue[]; + + /** + * @see _.dropWhile + */ + dropWhile<TValue>( + array: List<TValue>, + predicate?: string, + thisArg?: any + ): TValue[]; + + /** + * @see _.dropWhile + */ + dropWhile<TWhere, TValue>( + array: List<TValue>, + predicate?: TWhere + ): TValue[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.dropWhile + */ + dropWhile<TWhere>( + predicate?: TWhere + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.dropWhile + */ + dropWhile<TValue>( + predicate?: ListIterator<TValue, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<TValue>; + + /** + * @see _.dropWhile + */ + dropWhile<TValue>( + predicate?: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<TValue>; + + /** + * @see _.dropWhile + */ + dropWhile<TWhere, TValue>( + predicate?: TWhere + ): LoDashImplicitArrayWrapper<TValue>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.dropWhile + */ + dropWhile( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.dropWhile + */ + dropWhile<TWhere>( + predicate?: TWhere + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.dropWhile + */ + dropWhile<TValue>( + predicate?: ListIterator<TValue, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<TValue>; + + /** + * @see _.dropWhile + */ + dropWhile<TValue>( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<TValue>; + + /** + * @see _.dropWhile + */ + dropWhile<TWhere, TValue>( + predicate?: TWhere + ): LoDashExplicitArrayWrapper<TValue>; + } + + //_.fill + interface LoDashStatic { + /** + * Fills elements of array with value from start up to, but not including, end. + * + * Note: This method mutates array. + * + * @param array The array to fill. + * @param value The value to fill array with. + * @param start The start position. + * @param end The end position. + * @return Returns array. + */ + fill<T>( + array: any[], + value: T, + start?: number, + end?: number + ): T[]; + + /** + * @see _.fill + */ + fill<T>( + array: List<any>, + value: T, + start?: number, + end?: number + ): List<T>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.fill + */ + fill<T>( + value: T, + start?: number, + end?: number + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.fill + */ + fill<T>( + value: T, + start?: number, + end?: number + ): LoDashImplicitObjectWrapper<List<T>>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.fill + */ + fill<T>( + value: T, + start?: number, + end?: number + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.fill + */ + fill<T>( + value: T, + start?: number, + end?: number + ): LoDashExplicitObjectWrapper<List<T>>; + } + + //_.findIndex + interface LoDashStatic { + /** + * This method is like _.find except that it returns the index of the first element predicate returns truthy + * for instead of the element itself. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to search. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the index of the found element, else -1. + */ + findIndex<T>( + array: List<T>, + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): number; + + /** + * @see _.findIndex + */ + findIndex<T>( + array: List<T>, + predicate?: string, + thisArg?: any + ): number; + + /** + * @see _.findIndex + */ + findIndex<W, T>( + array: List<T>, + predicate?: W + ): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.findIndex + */ + findIndex( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): number; + + /** + * @see _.findIndex + */ + findIndex( + predicate?: string, + thisArg?: any + ): number; + + /** + * @see _.findIndex + */ + findIndex<W>( + predicate?: W + ): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.findIndex + */ + findIndex<TResult>( + predicate?: ListIterator<TResult, boolean>, + thisArg?: any + ): number; + + /** + * @see _.findIndex + */ + findIndex( + predicate?: string, + thisArg?: any + ): number; + + /** + * @see _.findIndex + */ + findIndex<W>( + predicate?: W + ): number; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.findIndex + */ + findIndex( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitWrapper<number>; + + /** + * @see _.findIndex + */ + findIndex( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper<number>; + + /** + * @see _.findIndex + */ + findIndex<W>( + predicate?: W + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.findIndex + */ + findIndex<TResult>( + predicate?: ListIterator<TResult, boolean>, + thisArg?: any + ): LoDashExplicitWrapper<number>; + + /** + * @see _.findIndex + */ + findIndex( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper<number>; + + /** + * @see _.findIndex + */ + findIndex<W>( + predicate?: W + ): LoDashExplicitWrapper<number>; + } + + //_.findLastIndex + interface LoDashStatic { + /** + * This method is like _.findIndex except that it iterates over elements of collection from right to left. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to search. + * @param predicate The function invoked per iteration. + * @param thisArg The function invoked per iteration. + * @return Returns the index of the found element, else -1. + */ + findLastIndex<T>( + array: List<T>, + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): number; + + /** + * @see _.findLastIndex + */ + findLastIndex<T>( + array: List<T>, + predicate?: string, + thisArg?: any + ): number; + + /** + * @see _.findLastIndex + */ + findLastIndex<W, T>( + array: List<T>, + predicate?: W + ): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): number; + + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: string, + thisArg?: any + ): number; + + /** + * @see _.findLastIndex + */ + findLastIndex<W>( + predicate?: W + ): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.findLastIndex + */ + findLastIndex<TResult>( + predicate?: ListIterator<TResult, boolean>, + thisArg?: any + ): number; + + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: string, + thisArg?: any + ): number; + + /** + * @see _.findLastIndex + */ + findLastIndex<W>( + predicate?: W + ): number; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitWrapper<number>; + + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper<number>; + + /** + * @see _.findLastIndex + */ + findLastIndex<W>( + predicate?: W + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.findLastIndex + */ + findLastIndex<TResult>( + predicate?: ListIterator<TResult, boolean>, + thisArg?: any + ): LoDashExplicitWrapper<number>; + + /** + * @see _.findLastIndex + */ + findLastIndex( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper<number>; + + /** + * @see _.findLastIndex + */ + findLastIndex<W>( + predicate?: W + ): LoDashExplicitWrapper<number>; + } + + //_.first + interface LoDashStatic { + /** + * @see _.head + */ + first<T>(array: List<T>): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.head + */ + first(): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.head + */ + first<TResult>(): TResult; + } + + interface RecursiveArray<T> extends Array<T|RecursiveArray<T>> {} + interface ListOfRecursiveArraysOrValues<T> extends List<T|RecursiveArray<T>> {} + + //_.flatMap DUMMY + interface LoDashStatic { + /** + * Creates an array of flattened values by running each element in `array` + * through `iteratee` and concating its result to the other mapped values. + * The iteratee is invoked with three arguments: (value, index|key, array). + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + flatMap( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.flatten + interface LoDashStatic { + /** + * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it’s only + * flattened a single level. + * + * @param array The array to flatten. + * @param isDeep Specify a deep flatten. + * @return Returns the new flattened array. + */ + flatten<T>(array: ListOfRecursiveArraysOrValues<T>, isDeep: boolean): T[]; + + /** + * @see _.flatten + */ + flatten<T>(array: List<T|T[]>): T[]; + + /** + * @see _.flatten + */ + flatten<T>(array: ListOfRecursiveArraysOrValues<T>): RecursiveArray<T>; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.flatten + */ + flatten(): LoDashImplicitArrayWrapper<string>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.flatten + */ + flatten<TResult>(isDeep?: boolean): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.flatten + */ + flatten<TResult>(isDeep?: boolean): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.flatten + */ + flatten(): LoDashExplicitArrayWrapper<string>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.flatten + */ + flatten<TResult>(isDeep?: boolean): LoDashExplicitArrayWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.flatten + */ + flatten<TResult>(isDeep?: boolean): LoDashExplicitArrayWrapper<TResult>; + } + + //_.flattenDeep + interface LoDashStatic { + /** + * Recursively flattens a nested array. + * + * @param array The array to recursively flatten. + * @return Returns the new flattened array. + */ + flattenDeep<T>(array: ListOfRecursiveArraysOrValues<T>): T[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.flattenDeep + */ + flattenDeep(): LoDashImplicitArrayWrapper<string>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.flattenDeep + */ + flattenDeep<T>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.flattenDeep + */ + flattenDeep<T>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.flattenDeep + */ + flattenDeep(): LoDashExplicitArrayWrapper<string>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.flattenDeep + */ + flattenDeep<T>(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.flattenDeep + */ + flattenDeep<T>(): LoDashExplicitArrayWrapper<T>; + } + + //_.fromPairs DUMMY + interface LoDashStatic { + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['fred', 30], ['barney', 40]]); + * // => { 'fred': 30, 'barney': 40 } + */ + fromPairs( + array: any[]|List<any> + ): any[]; + } + + //_.head + interface LoDashStatic { + /** + * Gets the first element of array. + * + * @alias _.first + * + * @param array The array to query. + * @return Returns the first element of array. + */ + head<T>(array: List<T>): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.first + */ + head(): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.first + */ + head<TResult>(): TResult; + } + + //_.indexOf + interface LoDashStatic { + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the offset + * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` + * performs a faster binary search. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // using `fromIndex` + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + indexOf<T>( + array: List<T>, + value: T, + fromIndex?: boolean|number + ): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.indexOf + */ + indexOf( + value: T, + fromIndex?: boolean|number + ): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.indexOf + */ + indexOf<TValue>( + value: TValue, + fromIndex?: boolean|number + ): number; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.indexOf + */ + indexOf( + value: T, + fromIndex?: boolean|number + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.indexOf + */ + indexOf<TValue>( + value: TValue, + fromIndex?: boolean|number + ): LoDashExplicitWrapper<number>; + } + + //_.intersectionBy DUMMY + interface LoDashStatic { + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of shared values. + * @example + * + * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [2.1] + * + * // using the `_.property` iteratee shorthand + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + intersectionBy( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.intersectionWith DUMMY + interface LoDashStatic { + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + intersectionWith( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.join DUMMY + interface LoDashStatic { + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + join( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.pullAll DUMMY + interface LoDashStatic { + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * + * _.pull(array, [2, 3]); + * console.log(array); + * // => [1, 1] + */ + pullAll( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.pullAllBy DUMMY + interface LoDashStatic { + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to to generate the criterion + * by which uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + pullAllBy( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.reverse DUMMY + interface LoDashStatic { + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @memberOf _ + * @category Array + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + reverse( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.sortedIndexOf + interface LoDashStatic { + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([1, 1, 2, 2], 2); + * // => 2 + */ + sortedIndexOf<T>( + array: List<T>, + value: T + ): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.sortedIndexOf + */ + sortedIndexOf( + value: T + ): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.sortedIndexOf + */ + sortedIndexOf<TValue>( + value: TValue + ): number; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.sortedIndexOf + */ + sortedIndexOf( + value: T + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.sortedIndexOf + */ + sortedIndexOf<TValue>( + value: TValue + ): LoDashExplicitWrapper<number>; + } + + //_.initial + interface LoDashStatic { + /** + * Gets all but the last element of array. + * + * @param array The array to query. + * @return Returns the slice of array. + */ + initial<T>(array: List<T>): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.initial + */ + initial(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.initial + */ + initial<T>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.initial + */ + initial(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.initial + */ + initial<T>(): LoDashExplicitArrayWrapper<T>; + } + + //_.intersection + interface LoDashStatic { + /** + * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for + * equality comparisons. + * + * @param arrays The arrays to inspect. + * @return Returns the new array of shared values. + */ + intersection<T>(...arrays: (T[]|List<T>)[]): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.intersection + */ + intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.intersection + */ + intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.intersection + */ + intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashExplicitArrayWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.intersection + */ + intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashExplicitArrayWrapper<TResult>; + } + + //_.last + interface LoDashStatic { + /** + * Gets the last element of array. + * + * @param array The array to query. + * @return Returns the last element of array. + */ + last<T>(array: List<T>): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.last + */ + last(): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.last + */ + last<T>(): T; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.last + */ + last(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.last + */ + last<T>(): LoDashExplicitObjectWrapper<T>; + } + + //_.lastIndexOf + interface LoDashStatic { + /** + * This method is like _.indexOf except that it iterates over elements of array from right to left. + * + * @param array The array to search. + * @param value The value to search for. + * @param fromIndex The index to search from or true to perform a binary search on a sorted array. + * @return Returns the index of the matched value, else -1. + */ + lastIndexOf<T>( + array: List<T>, + value: T, + fromIndex?: boolean|number + ): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.lastIndexOf + */ + lastIndexOf( + value: T, + fromIndex?: boolean|number + ): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.lastIndexOf + */ + lastIndexOf<TResult>( + value: TResult, + fromIndex?: boolean|number + ): number; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.lastIndexOf + */ + lastIndexOf( + value: T, + fromIndex?: boolean|number + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.lastIndexOf + */ + lastIndexOf<TResult>( + value: TResult, + fromIndex?: boolean|number + ): LoDashExplicitWrapper<number>; + } + + //_.pull + interface LoDashStatic { + /** + * Removes all provided values from array using SameValueZero for equality comparisons. + * + * Note: Unlike _.without, this method mutates array. + * + * @param array The array to modify. + * @param values The values to remove. + * @return Returns array. + */ + pull<T>( + array: T[], + ...values: T[] + ): T[]; + + /** + * @see _.pull + */ + pull<T>( + array: List<T>, + ...values: T[] + ): List<T>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.pull + */ + pull(...values: T[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.pull + */ + pull<TValue>(...values: TValue[]): LoDashImplicitObjectWrapper<List<TValue>>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.pull + */ + pull(...values: T[]): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.pull + */ + pull<TValue>(...values: TValue[]): LoDashExplicitObjectWrapper<List<TValue>>; + } + + //_.pullAt + interface LoDashStatic { + /** + * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. + * Indexes may be specified as an array of indexes or as individual arguments. + * + * Note: Unlike _.at, this method mutates array. + * + * @param array The array to modify. + * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. + * @return Returns the new array of removed elements. + */ + pullAt<T>( + array: List<T>, + ...indexes: (number|number[])[] + ): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.pullAt + */ + pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.pullAt + */ + pullAt<T>(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.pullAt + */ + pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.pullAt + */ + pullAt<T>(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper<T>; + } + + //_.remove + interface LoDashStatic { + /** + * Removes all elements from array that predicate returns truthy for and returns an array of the removed + * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * Note: Unlike _.filter, this method mutates array. + * + * @param array The array to modify. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new array of removed elements. + */ + remove<T>( + array: List<T>, + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): T[]; + + /** + * @see _.remove + */ + remove<T>( + array: List<T>, + predicate?: string, + thisArg?: any + ): T[]; + + /** + * @see _.remove + */ + remove<W, T>( + array: List<T>, + predicate?: W + ): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.remove + */ + remove( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.remove + */ + remove( + predicate?: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.remove + */ + remove<W>( + predicate?: W + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.remove + */ + remove<TResult>( + predicate?: ListIterator<TResult, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<TResult>; + + /** + * @see _.remove + */ + remove<TResult>( + predicate?: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<TResult>; + + /** + * @see _.remove + */ + remove<W, TResult>( + predicate?: W + ): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.remove + */ + remove( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.remove + */ + remove( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.remove + */ + remove<W>( + predicate?: W + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.remove + */ + remove<TResult>( + predicate?: ListIterator<TResult, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<TResult>; + + /** + * @see _.remove + */ + remove<TResult>( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<TResult>; + + /** + * @see _.remove + */ + remove<W, TResult>( + predicate?: W + ): LoDashExplicitArrayWrapper<TResult>; + } + + //_.tail + interface LoDashStatic { + /** + * Gets all but the first element of array. + * + * @alias _.tail + * + * @param array The array to query. + * @return Returns the slice of array. + */ + tail<T>(array: List<T>): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.tail + */ + tail(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.tail + */ + tail<T>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.tail + */ + tail(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.tail + */ + tail<T>(): LoDashExplicitArrayWrapper<T>; + } + + //_.slice + interface LoDashStatic { + /** + * Creates a slice of array from start up to, but not including, end. + * + * @param array The array to slice. + * @param start The start position. + * @param end The end position. + * @return Returns the slice of array. + */ + slice<T>( + array: T[], + start?: number, + end?: number + ): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.slice + */ + slice( + start?: number, + end?: number + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.slice + */ + slice( + start?: number, + end?: number + ): LoDashExplicitArrayWrapper<T>; + } + + //_.sortedIndex + interface LoDashStatic { + /** + * Uses a binary search to determine the lowest index at which `value` should + * be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + * + * _.sortedIndex([4, 5], 4); + * // => 0 + */ + sortedIndex<T, TSort>( + array: List<T>, + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex<T>( + array: List<T>, + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex<T>( + array: List<T>, + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex<W, T>( + array: List<T>, + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex<T>( + array: List<T>, + value: T + ): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.sortedIndex + */ + sortedIndex<TSort>( + value: string + ): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.sortedIndex + */ + sortedIndex<TSort>( + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.sortedIndex + */ + sortedIndex<T, TSort>( + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex<T>( + value: T + ): number; + + /** + * @see _.sortedIndex + */ + sortedIndex<W, T>( + value: T + ): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.sortedIndex + */ + sortedIndex<TSort>( + value: string + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.sortedIndex + */ + sortedIndex<TSort>( + value: T + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedIndex + */ + sortedIndex( + value: T + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedIndex + */ + sortedIndex<W>( + value: T + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.sortedIndex + */ + sortedIndex<T, TSort>( + value: T + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedIndex + */ + sortedIndex<T>( + value: T + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedIndex + */ + sortedIndex<W, T>( + value: T + ): LoDashExplicitWrapper<number>; + + + } + + //_.sortedIndexBy + interface LoDashStatic { + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @example + * + * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; + * + * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); + * // => 1 + * + * // using the `_.property` iteratee shorthand + * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * // => 0 + */ + sortedIndexBy<T, TSort>( + array: List<T>, + value: T, + iteratee: (x: T) => TSort + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<T>( + array: List<T>, + value: T, + iteratee: (x: T) => any + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<T>( + array: List<T>, + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<W, T>( + array: List<T>, + value: T, + iteratee: W + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<T>( + array: List<T>, + value: T, + iteratee: Object + ): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<TSort>( + value: string, + iteratee: (x: string) => TSort + ): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<TSort>( + value: T, + iteratee: (x: T) => TSort + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<W>( + value: T, + iteratee: W + ): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<T, TSort>( + value: T, + iteratee: (x: T) => TSort + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<T>( + value: T, + iteratee: (x: T) => any + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<T>( + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<W, T>( + value: T, + iteratee: W + ): number; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<T>( + value: T, + iteratee: Object + ): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<TSort>( + value: string, + iteratee: (x: string) => TSort + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<TSort>( + value: T, + iteratee: (x: T) => TSort + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy( + value: T, + iteratee: string + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<W>( + value: T, + iteratee: W + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<T, TSort>( + value: T, + iteratee: (x: T) => TSort + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<T>( + value: T, + iteratee: (x: T) => any + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<T>( + value: T, + iteratee: string + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<W, T>( + value: T, + iteratee: W + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedIndexBy + */ + sortedIndexBy<T>( + value: T, + iteratee: Object + ): LoDashExplicitWrapper<number>; + } + + //_.sortedLastIndex + interface LoDashStatic { + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @example + * + * _.sortedLastIndex([4, 5], 4); + * // => 1 + */ + sortedLastIndex<T, TSort>( + array: List<T>, + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<T>( + array: List<T>, + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<T>( + array: List<T>, + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<W, T>( + array: List<T>, + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<T>( + array: List<T>, + value: T + ): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<TSort>( + value: string + ): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<TSort>( + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<W>( + value: T + ): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<T, TSort>( + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<T>( + value: T + ): number; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<W, T>( + value: T + ): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<TSort>( + value: string + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<TSort>( + value: T + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex( + value: T + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<T, TSort>( + value: T + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<T>( + value: T + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedLastIndex + */ + sortedLastIndex<W, T>( + value: T + ): LoDashExplicitWrapper<number>; + } + + //_.sortedLastIndexBy + interface LoDashStatic { + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted into `array`. + * @example + * + * // using the `_.property` iteratee shorthand + * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * // => 1 + */ + sortedLastIndexBy<T, TSort>( + array: List<T>, + value: T, + iteratee: (x: T) => TSort + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<T>( + array: List<T>, + value: T, + iteratee: (x: T) => any + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<T>( + array: List<T>, + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<W, T>( + array: List<T>, + value: T, + iteratee: W + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<T>( + array: List<T>, + value: T, + iteratee: Object + ): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<TSort>( + value: string, + iteratee: (x: string) => TSort + ): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<TSort>( + value: T, + iteratee: (x: T) => TSort + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<W>( + value: T, + iteratee: W + ): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<T, TSort>( + value: T, + iteratee: (x: T) => TSort + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<T>( + value: T, + iteratee: (x: T) => any + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<T>( + value: T, + iteratee: string + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<W, T>( + value: T, + iteratee: W + ): number; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<T>( + value: T, + iteratee: Object + ): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<TSort>( + value: string, + iteratee: (x: string) => TSort + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<TSort>( + value: T, + iteratee: (x: T) => TSort + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy( + value: T, + iteratee: string + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<W>( + value: T, + iteratee: W + ): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<T, TSort>( + value: T, + iteratee: (x: T) => TSort + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<T>( + value: T, + iteratee: (x: T) => any + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<T>( + value: T, + iteratee: string + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<W, T>( + value: T, + iteratee: W + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sortedLastIndexBy + */ + sortedLastIndexBy<T>( + value: T, + iteratee: Object + ): LoDashExplicitWrapper<number>; + } + + //_.sortedLastIndexOf DUMMY + interface LoDashStatic { + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([1, 1, 2, 2], 2); + * // => 3 + */ + sortedLastIndexOf( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.tail + interface LoDashStatic { + /** + * @see _.rest + */ + tail<T>(array: List<T>): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.rest + */ + tail(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.rest + */ + tail<T>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.rest + */ + tail(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.rest + */ + tail<T>(): LoDashExplicitArrayWrapper<T>; + } + + //_.take + interface LoDashStatic { + /** + * Creates a slice of array with n elements taken from the beginning. + * + * @param array The array to query. + * @param n The number of elements to take. + * @return Returns the slice of array. + */ + take<T>( + array: List<T>, + n?: number + ): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.take + */ + take(n?: number): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.take + */ + take<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.take + */ + take(n?: number): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.take + */ + take<TResult>(n?: number): LoDashExplicitArrayWrapper<TResult>; + } + + //_.takeRight + interface LoDashStatic { + /** + * Creates a slice of array with n elements taken from the end. + * + * @param array The array to query. + * @param n The number of elements to take. + * @return Returns the slice of array. + */ + takeRight<T>( + array: List<T>, + n?: number + ): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.takeRight + */ + takeRight(n?: number): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.takeRight + */ + takeRight<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.takeRight + */ + takeRight(n?: number): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.takeRight + */ + takeRight<TResult>(n?: number): LoDashExplicitArrayWrapper<TResult>; + } + + //_.takeRightWhile + interface LoDashStatic { + /** + * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns + * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + takeRightWhile<TValue>( + array: List<TValue>, + predicate?: ListIterator<TValue, boolean>, + thisArg?: any + ): TValue[]; + + /** + * @see _.takeRightWhile + */ + takeRightWhile<TValue>( + array: List<TValue>, + predicate?: string, + thisArg?: any + ): TValue[]; + + /** + * @see _.takeRightWhile + */ + takeRightWhile<TWhere, TValue>( + array: List<TValue>, + predicate?: TWhere + ): TValue[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.takeRightWhile + */ + takeRightWhile<TWhere>( + predicate?: TWhere + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.takeRightWhile + */ + takeRightWhile<TValue>( + predicate?: ListIterator<TValue, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<TValue>; + + /** + * @see _.takeRightWhile + */ + takeRightWhile<TValue>( + predicate?: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<TValue>; + + /** + * @see _.takeRightWhile + */ + takeRightWhile<TWhere, TValue>( + predicate?: TWhere + ): LoDashImplicitArrayWrapper<TValue>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.takeRightWhile + */ + takeRightWhile( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.takeRightWhile + */ + takeRightWhile<TWhere>( + predicate?: TWhere + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.takeRightWhile + */ + takeRightWhile<TValue>( + predicate?: ListIterator<TValue, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<TValue>; + + /** + * @see _.takeRightWhile + */ + takeRightWhile<TValue>( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<TValue>; + + /** + * @see _.takeRightWhile + */ + takeRightWhile<TWhere, TValue>( + predicate?: TWhere + ): LoDashExplicitArrayWrapper<TValue>; + } + + //_.takeWhile + interface LoDashStatic { + /** + * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns + * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param array The array to query. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the slice of array. + */ + takeWhile<TValue>( + array: List<TValue>, + predicate?: ListIterator<TValue, boolean>, + thisArg?: any + ): TValue[]; + + /** + * @see _.takeWhile + */ + takeWhile<TValue>( + array: List<TValue>, + predicate?: string, + thisArg?: any + ): TValue[]; + + /** + * @see _.takeWhile + */ + takeWhile<TWhere, TValue>( + array: List<TValue>, + predicate?: TWhere + ): TValue[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.takeWhile + */ + takeWhile<TWhere>( + predicate?: TWhere + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.takeWhile + */ + takeWhile<TValue>( + predicate?: ListIterator<TValue, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<TValue>; + + /** + * @see _.takeWhile + */ + takeWhile<TValue>( + predicate?: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<TValue>; + + /** + * @see _.takeWhile + */ + takeWhile<TWhere, TValue>( + predicate?: TWhere + ): LoDashImplicitArrayWrapper<TValue>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.takeWhile + */ + takeWhile( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.takeWhile + */ + takeWhile<TWhere>( + predicate?: TWhere + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.takeWhile + */ + takeWhile<TValue>( + predicate?: ListIterator<TValue, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<TValue>; + + /** + * @see _.takeWhile + */ + takeWhile<TValue>( + predicate?: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<TValue>; + + /** + * @see _.takeWhile + */ + takeWhile<TWhere, TValue>( + predicate?: TWhere + ): LoDashExplicitArrayWrapper<TValue>; + } + + //_.union + interface LoDashStatic { + /** + * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for + * equality comparisons. + * + * @param arrays The arrays to inspect. + * @return Returns the new array of combined values. + */ + union<T>(...arrays: List<T>[]): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.union + */ + union(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.union + */ + union<T>(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.union + */ + union<T>(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.union + */ + union(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.union + */ + union<T>(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.union + */ + union<T>(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>; + } + + //_.uniq + interface LoDashStatic { + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + uniq<T>( + array: List<T> + ): T[]; + + /** + * @see _.uniq + */ + uniq<T, TSort>( + array: List<T> + ): T[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.uniq + */ + uniq<TSort>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.uniq + */ + uniq<TSort>(): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.uniq + */ + uniq(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + uniq<T>(): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.uniq + */ + uniq<T, TSort>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.uniq + */ + uniq<TSort>(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.uniq + */ + uniq<TSort>(): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.uniq + */ + uniq(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.uniq + */ + uniq<T>(): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.uniq + */ + uniq<T, TSort>(): LoDashExplicitArrayWrapper<T>; + } + + //_.uniqBy + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // using the `_.property` iteratee shorthand + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + uniqBy<T>( + array: List<T>, + iteratee: ListIterator<T, any> + ): T[]; + + /** + * @see _.uniqBy + */ + uniqBy<T, TSort>( + array: List<T>, + iteratee: ListIterator<T, TSort> + ): T[]; + + /** + * @see _.uniqBy + */ + uniqBy<T>( + array: List<T>, + iteratee: string + ): T[]; + + /** + * @see _.uniqBy + */ + uniqBy<T>( + array: List<T>, + iteratee: Object + ): T[]; + + /** + * @see _.uniqBy + */ + uniqBy<TWhere extends {}, T>( + array: List<T>, + iteratee: TWhere + ): T[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.uniqBy + */ + uniqBy<TSort>( + iteratee: ListIterator<T, TSort> + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.uniqBy + */ + uniqBy<TSort>( + iteratee: ListIterator<T, TSort> + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: string + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.uniqBy + */ + uniqBy<TWhere extends {}>( + iteratee: TWhere + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.uniqBy + */ + uniqBy<T>( + iteratee: ListIterator<T, any> + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.uniqBy + */ + uniqBy<T, TSort>( + iteratee: ListIterator<T, TSort> + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.uniqBy + */ + uniqBy<T>( + iteratee: string + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.uniqBy + */ + uniqBy<T>( + iteratee: Object + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.uniqBy + */ + uniqBy<TWhere extends {}, T>( + iteratee: TWhere + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.uniqBy + */ + uniqBy<TSort>( + iteratee: ListIterator<T, TSort> + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.uniqBy + */ + uniqBy<TSort>( + iteratee: ListIterator<T, TSort> + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.uniqBy + */ + uniqBy( + iteratee: string + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.uniqBy + */ + uniqBy<TWhere extends {}>( + iteratee: TWhere + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.uniqBy + */ + uniqBy<T>( + iteratee: ListIterator<T, any> + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.uniqBy + */ + uniqBy<T, TSort>( + iteratee: ListIterator<T, TSort> + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.uniqBy + */ + uniqBy<T>( + iteratee: string + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.uniqBy + */ + uniqBy<T>( + iteratee: Object + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.uniqBy + */ + uniqBy<TWhere extends {}, T>( + iteratee: TWhere + ): LoDashExplicitArrayWrapper<T>; + } + + //_.sortedUniq + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + sortedUniq<T>( + array: List<T> + ): T[]; + + /** + * @see _.sortedUniq + */ + sortedUniq<T, TSort>( + array: List<T> + ): T[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.sortedUniq + */ + sortedUniq<TSort>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.sortedUniq + */ + sortedUniq<TSort>(): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + sortedUniq<T>(): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortedUniq + */ + sortedUniq<T, TSort>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.sortedUniq + */ + sortedUniq<TSort>(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.sortedUniq + */ + sortedUniq<TSort>(): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortedUniq + */ + sortedUniq(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.sortedUniq + */ + sortedUniq<T>(): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortedUniq + */ + sortedUniq<T, TSort>(): LoDashExplicitArrayWrapper<T>; + } + + //_.sortedUniqBy + interface LoDashStatic { + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.2] + */ + sortedUniqBy<T>( + array: List<T>, + iteratee: ListIterator<T, any> + ): T[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<T, TSort>( + array: List<T>, + iteratee: ListIterator<T, TSort> + ): T[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<T>( + array: List<T>, + iteratee: string + ): T[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<T>( + array: List<T>, + iteratee: Object + ): T[]; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<TWhere extends {}, T>( + array: List<T>, + iteratee: TWhere + ): T[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<TSort>( + iteratee: ListIterator<T, TSort> + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<TSort>( + iteratee: ListIterator<T, TSort> + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: string + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<TWhere extends {}>( + iteratee: TWhere + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<T>( + iteratee: ListIterator<T, any> + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<T, TSort>( + iteratee: ListIterator<T, TSort> + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<T>( + iteratee: string + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<T>( + iteratee: Object + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<TWhere extends {}, T>( + iteratee: TWhere + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<TSort>( + iteratee: ListIterator<T, TSort> + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<TSort>( + iteratee: ListIterator<T, TSort> + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy( + iteratee: string + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<TWhere extends {}>( + iteratee: TWhere + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<T>( + iteratee: ListIterator<T, any> + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<T, TSort>( + iteratee: ListIterator<T, TSort> + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<T>( + iteratee: string + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<T>( + iteratee: Object + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortedUniqBy + */ + sortedUniqBy<TWhere extends {}, T>( + iteratee: TWhere + ): LoDashExplicitArrayWrapper<T>; + } + + //_.unionBy DUMMY + interface LoDashStatic { + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [2.1, 1.2, 4.3] + * + * // using the `_.property` iteratee shorthand + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + unionBy( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.unionWith DUMMY + interface LoDashStatic { + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + unionWith( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.uniqWith DUMMY + interface LoDashStatic { + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + uniqWith( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.unzip + interface LoDashStatic { + /** + * This method is like _.zip except that it accepts an array of grouped elements and creates an array + * regrouping the elements to their pre-zip configuration. + * + * @param array The array of grouped elements to process. + * @return Returns the new array of regrouped elements. + */ + unzip<T>(array: List<List<T>>): T[][]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.unzip + */ + unzip<T>(): LoDashImplicitArrayWrapper<T[]>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.unzip + */ + unzip<T>(): LoDashImplicitArrayWrapper<T[]>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.unzip + */ + unzip<T>(): LoDashExplicitArrayWrapper<T[]>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.unzip + */ + unzip<T>(): LoDashExplicitArrayWrapper<T[]>; + } + + //_.unzipWith + interface LoDashStatic { + /** + * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be + * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, + * group). + * + * @param array The array of grouped elements to process. + * @param iteratee The function to combine regrouped values. + * @param thisArg The this binding of iteratee. + * @return Returns the new array of regrouped elements. + */ + unzipWith<TArray, TResult>( + array: List<List<TArray>>, + iteratee?: MemoIterator<TArray, TResult>, + thisArg?: any + ): TResult[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.unzipWith + */ + unzipWith<TArr, TResult>( + iteratee?: MemoIterator<TArr, TResult>, + thisArg?: any + ): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.unzipWith + */ + unzipWith<TArr, TResult>( + iteratee?: MemoIterator<TArr, TResult>, + thisArg?: any + ): LoDashImplicitArrayWrapper<TResult>; + } + + //_.without + interface LoDashStatic { + /** + * Creates an array excluding all provided values using SameValueZero for equality comparisons. + * + * @param array The array to filter. + * @param values The values to exclude. + * @return Returns the new array of filtered values. + */ + without<T>( + array: List<T>, + ...values: T[] + ): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.without + */ + without(...values: T[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.without + */ + without<T>(...values: T[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.without + */ + without(...values: T[]): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.without + */ + without<T>(...values: T[]): LoDashExplicitArrayWrapper<T>; + } + + //_.xor + interface LoDashStatic { + /** + * Creates an array of unique values that is the symmetric difference of the provided arrays. + * + * @param arrays The arrays to inspect. + * @return Returns the new array of values. + */ + xor<T>(...arrays: List<T>[]): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.xor + */ + xor(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.xor + */ + xor<T>(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.xor + */ + xor(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.xor + */ + xor<T>(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>; + } + + //_.xorBy DUMMY + interface LoDashStatic { + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of values. + * @example + * + * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [1.2, 4.3] + * + * // using the `_.property` iteratee shorthand + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + xorBy( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.xorWith DUMMY + interface LoDashStatic { + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + xorWith( + array: any[]|List<any>, + ...values: any[] + ): any[]; + } + + //_.zip + interface LoDashStatic { + /** + * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, + * the second of which contains the second elements of the given arrays, and so on. + * + * @param arrays The arrays to process. + * @return Returns the new array of grouped elements. + */ + zip<T>(...arrays: List<T>[]): T[][]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.zip + */ + zip<T>(...arrays: List<T>[]): _.LoDashImplicitArrayWrapper<T[]>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.zip + */ + zip<T>(...arrays: List<T>[]): _.LoDashImplicitArrayWrapper<T[]>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.zip + */ + zip<T>(...arrays: List<T>[]): _.LoDashExplicitArrayWrapper<T[]>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.zip + */ + zip<T>(...arrays: List<T>[]): _.LoDashExplicitArrayWrapper<T[]>; + } + + //_.zipObject + interface LoDashStatic { + /** + * The inverse of _.pairs; this method returns an object composed from arrays of property names and values. + * Provide either a single two dimensional array, e.g. [[key1, value1], [key2, value2]] or two arrays, one of + * property names and one of corresponding values. + * + * @param props The property names. + * @param values The property values. + * @return Returns the new object. + */ + zipObject<TValues, TResult extends {}>( + props: List<StringRepresentable>|List<List<any>>, + values?: List<TValues> + ): TResult; + + /** + * @see _.zipObject + */ + zipObject<TResult extends {}>( + props: List<StringRepresentable>|List<List<any>>, + values?: List<any> + ): TResult; + + /** + * @see _.zipObject + */ + zipObject( + props: List<StringRepresentable>|List<List<any>>, + values?: List<any> + ): _.Dictionary<any>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.zipObject + */ + zipObject<TValues, TResult extends {}>( + values?: List<TValues> + ): _.LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.zipObject + */ + zipObject<TResult extends {}>( + values?: List<any> + ): _.LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.zipObject + */ + zipObject( + values?: List<any> + ): _.LoDashImplicitObjectWrapper<_.Dictionary<any>>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.zipObject + */ + zipObject<TValues, TResult extends {}>( + values?: List<TValues> + ): _.LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.zipObject + */ + zipObject<TResult extends {}>( + values?: List<any> + ): _.LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.zipObject + */ + zipObject( + values?: List<any> + ): _.LoDashImplicitObjectWrapper<_.Dictionary<any>>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.zipObject + */ + zipObject<TValues, TResult extends {}>( + values?: List<TValues> + ): _.LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.zipObject + */ + zipObject<TResult extends {}>( + values?: List<any> + ): _.LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.zipObject + */ + zipObject( + values?: List<any> + ): _.LoDashExplicitObjectWrapper<_.Dictionary<any>>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.zipObject + */ + zipObject<TValues, TResult extends {}>( + values?: List<TValues> + ): _.LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.zipObject + */ + zipObject<TResult extends {}>( + values?: List<any> + ): _.LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.zipObject + */ + zipObject( + values?: List<any> + ): _.LoDashExplicitObjectWrapper<_.Dictionary<any>>; + } + + //_.zipWith + interface LoDashStatic { + /** + * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be + * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, + * group). + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee] The function to combine grouped values. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @return Returns the new array of grouped elements. + */ + zipWith<TResult>(...args: any[]): TResult[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.zipWith + */ + zipWith<TResult>(...args: any[]): LoDashImplicitArrayWrapper<TResult>; + } + + /********* + * Chain * + *********/ + + //_.chain + interface LoDashStatic { + /** + * Creates a lodash object that wraps value with explicit method chaining enabled. + * + * @param value The value to wrap. + * @return Returns the new lodash wrapper instance. + */ + chain(value: number): LoDashExplicitWrapper<number>; + chain(value: string): LoDashExplicitWrapper<string>; + chain(value: boolean): LoDashExplicitWrapper<boolean>; + chain<T>(value: T[]): LoDashExplicitArrayWrapper<T>; + chain<T extends {}>(value: T): LoDashExplicitObjectWrapper<T>; + chain(value: any): LoDashExplicitWrapper<any>; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.chain + */ + chain(): LoDashExplicitWrapper<T>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.chain + */ + chain(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.chain + */ + chain(): LoDashExplicitObjectWrapper<T>; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.chain + */ + chain(): TWrapper; + } + + //_.tap + interface LoDashStatic { + /** + * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one + * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations + * on intermediate results within the chain. + * + * @param value The value to provide to interceptor. + * @param interceptor The function to invoke. + * @parem thisArg The this binding of interceptor. + * @return Returns value. + **/ + tap<T>( + value: T, + interceptor: (value: T) => void, + thisArg?: any + ): T; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.tap + */ + tap( + interceptor: (value: T) => void, + thisArg?: any + ): TWrapper; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.tap + */ + tap( + interceptor: (value: T) => void, + thisArg?: any + ): TWrapper; + } + + //_.thru + interface LoDashStatic { + /** + * This method is like _.tap except that it returns the result of interceptor. + * + * @param value The value to provide to interceptor. + * @param interceptor The function to invoke. + * @param thisArg The this binding of interceptor. + * @return Returns the result of interceptor. + */ + thru<T, TResult>( + value: T, + interceptor: (value: T) => TResult, + thisArg?: any + ): TResult; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.thru + */ + thru<TResult extends number>( + interceptor: (value: T) => TResult, + thisArg?: any): LoDashImplicitWrapper<TResult>; + + /** + * @see _.thru + */ + thru<TResult extends string>( + interceptor: (value: T) => TResult, + thisArg?: any): LoDashImplicitWrapper<TResult>; + + /** + * @see _.thru + */ + thru<TResult extends boolean>( + interceptor: (value: T) => TResult, + thisArg?: any): LoDashImplicitWrapper<TResult>; + + /** + * @see _.thru + */ + thru<TResult extends {}>( + interceptor: (value: T) => TResult, + thisArg?: any): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.thru + */ + thru<TResult>( + interceptor: (value: T) => TResult[], + thisArg?: any): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.thru + */ + thru<TResult extends number>( + interceptor: (value: T) => TResult, + thisArg?: any + ): LoDashExplicitWrapper<TResult>; + + /** + * @see _.thru + */ + thru<TResult extends string>( + interceptor: (value: T) => TResult, + thisArg?: any + ): LoDashExplicitWrapper<TResult>; + + /** + * @see _.thru + */ + thru<TResult extends boolean>( + interceptor: (value: T) => TResult, + thisArg?: any + ): LoDashExplicitWrapper<TResult>; + + /** + * @see _.thru + */ + thru<TResult extends {}>( + interceptor: (value: T) => TResult, + thisArg?: any + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.thru + */ + thru<TResult>( + interceptor: (value: T) => TResult[], + thisArg?: any + ): LoDashExplicitArrayWrapper<TResult>; + } + + //_.prototype.commit + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * Executes the chained sequence and returns the wrapped result. + * + * @return Returns the new lodash wrapper instance. + */ + commit(): TWrapper; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.commit + */ + commit(): TWrapper; + } + + //_.prototype.concat + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * Creates a new array joining a wrapped array with any additional arrays and/or values. + * + * @param items + * @return Returns the new concatenated array. + */ + concat<TItem>(...items: Array<TItem|Array<TItem>>): LoDashImplicitArrayWrapper<TItem>; + + /** + * @see _.concat + */ + concat(...items: Array<T|Array<T>>): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.concat + */ + concat<TItem>(...items: Array<TItem|Array<TItem>>): LoDashExplicitArrayWrapper<TItem>; + + /** + * @see _.concat + */ + concat(...items: Array<T|Array<T>>): LoDashExplicitArrayWrapper<T>; + } + + //_.prototype.plant + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * Creates a clone of the chained sequence planting value as the wrapped value. + * @param value The value to plant as the wrapped value. + * @return Returns the new lodash wrapper instance. + */ + plant(value: number): LoDashImplicitWrapper<number>; + + /** + * @see _.plant + */ + plant(value: string): LoDashImplicitStringWrapper; + + /** + * @see _.plant + */ + plant(value: boolean): LoDashImplicitWrapper<boolean>; + + /** + * @see _.plant + */ + plant(value: number[]): LoDashImplicitNumberArrayWrapper; + + /** + * @see _.plant + */ + plant<T>(value: T[]): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.plant + */ + plant<T extends {}>(value: T): LoDashImplicitObjectWrapper<T>; + + /** + * @see _.plant + */ + plant(value: any): LoDashImplicitWrapper<any>; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.plant + */ + plant(value: number): LoDashExplicitWrapper<number>; + + /** + * @see _.plant + */ + plant(value: string): LoDashExplicitStringWrapper; + + /** + * @see _.plant + */ + plant(value: boolean): LoDashExplicitWrapper<boolean>; + + /** + * @see _.plant + */ + plant(value: number[]): LoDashExplicitNumberArrayWrapper; + + /** + * @see _.plant + */ + plant<T>(value: T[]): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.plant + */ + plant<T extends {}>(value: T): LoDashExplicitObjectWrapper<T>; + + /** + * @see _.plant + */ + plant(value: any): LoDashExplicitWrapper<any>; + } + + //_.prototype.reverse + interface LoDashImplicitArrayWrapper<T> { + /** + * Reverses the wrapped array so the first element becomes the last, the second element becomes the second to + * last, and so on. + * + * Note: This method mutates the wrapped array. + * + * @return Returns the new reversed lodash wrapper instance. + */ + reverse(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.reverse + */ + reverse(): LoDashExplicitArrayWrapper<T>; + } + + //_.prototype.toJSON + interface LoDashWrapperBase<T, TWrapper> { + /** + * @see _.value + */ + toJSON(): T; + } + + //_.prototype.toString + interface LoDashWrapperBase<T, TWrapper> { + /** + * Produces the result of coercing the unwrapped value to a string. + * + * @return Returns the coerced string value. + */ + toString(): string; + } + + //_.prototype.value + interface LoDashWrapperBase<T, TWrapper> { + /** + * Executes the chained sequence to extract the unwrapped value. + * + * @alias _.toJSON, _.valueOf + * + * @return Returns the resolved unwrapped value. + */ + value(): T; + } + + //_.valueOf + interface LoDashWrapperBase<T, TWrapper> { + /** + * @see _.value + */ + valueOf(): T; + } + + /************** + * Collection * + **************/ + + //_.at + interface LoDashStatic { + /** + * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be + * specified as individual arguments or as arrays of keys. + * + * @param collection The collection to iterate over. + * @param props The property names or indexes of elements to pick, specified individually or in arrays. + * @return Returns the new array of picked elements. + */ + at<T>( + collection: List<T>|Dictionary<T>, + ...props: (number|string|(number|string)[])[] + ): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.at + */ + at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.at + */ + at<T>(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.at + */ + at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.at + */ + at<T>(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper<T>; + } + + //_.countBy + interface LoDashStatic { + /** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The + * iteratee is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + countBy<T>( + collection: List<T>, + iteratee?: ListIterator<T, any>, + thisArg?: any + ): Dictionary<number>; + + /** + * @see _.countBy + */ + countBy<T>( + collection: Dictionary<T>, + iteratee?: DictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<number>; + + /** + * @see _.countBy + */ + countBy<T>( + collection: NumericDictionary<T>, + iteratee?: NumericDictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<number>; + + /** + * @see _.countBy + */ + countBy<T>( + collection: List<T>|Dictionary<T>|NumericDictionary<T>, + iteratee?: string, + thisArg?: any + ): Dictionary<number>; + + /** + * @see _.countBy + */ + countBy<W, T>( + collection: List<T>|Dictionary<T>|NumericDictionary<T>, + iteratee?: W + ): Dictionary<number>; + + /** + * @see _.countBy + */ + countBy<T>( + collection: List<T>|Dictionary<T>|NumericDictionary<T>, + iteratee?: Object + ): Dictionary<number>; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator<T, any>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<number>>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator<T, any>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<number>>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: string, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<number>>; + + /** + * @see _.countBy + */ + countBy<W>( + iteratee?: W + ): LoDashImplicitObjectWrapper<Dictionary<number>>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.countBy + */ + countBy<T>( + iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>|NumericDictionaryIterator<T, any>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<number>>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: string, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<number>>; + + /** + * @see _.countBy + */ + countBy<W>( + iteratee?: W + ): LoDashImplicitObjectWrapper<Dictionary<number>>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator<T, any>, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<number>>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.countBy + */ + countBy( + iteratee?: ListIterator<T, any>, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<number>>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<number>>; + + /** + * @see _.countBy + */ + countBy<W>( + iteratee?: W + ): LoDashExplicitObjectWrapper<Dictionary<number>>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.countBy + */ + countBy<T>( + iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>|NumericDictionaryIterator<T, any>, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<number>>; + + /** + * @see _.countBy + */ + countBy( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<number>>; + + /** + * @see _.countBy + */ + countBy<W>( + iteratee?: W + ): LoDashExplicitObjectWrapper<Dictionary<number>>; + } + + //_.each + interface LoDashStatic { + /** + * @see _.forEach + */ + each<T>( + collection: T[], + iteratee?: ListIterator<T, any>, + thisArg?: any + ): T[]; + + /** + * @see _.forEach + */ + each<T>( + collection: List<T>, + iteratee?: ListIterator<T, any>, + thisArg?: any + ): List<T>; + + /** + * @see _.forEach + */ + each<T>( + collection: Dictionary<T>, + iteratee?: DictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.forEach + */ + each<T extends {}>( + collection: T, + iteratee?: ObjectIterator<any, any>, + thisArgs?: any + ): T; + + /** + * @see _.forEach + */ + each<T extends {}, TValue>( + collection: T, + iteratee?: ObjectIterator<TValue, any>, + thisArgs?: any + ): T; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.forEach + */ + each( + iteratee: ListIterator<string, any>, + thisArg?: any + ): LoDashImplicitWrapper<string>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.forEach + */ + each( + iteratee: ListIterator<T, any>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.forEach + */ + each<TValue>( + iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>, + thisArg?: any + ): LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.forEach + */ + each( + iteratee: ListIterator<string, any>, + thisArg?: any + ): LoDashExplicitWrapper<string>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.forEach + */ + each( + iteratee: ListIterator<T, any>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.forEach + */ + each<TValue>( + iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>, + thisArg?: any + ): LoDashExplicitObjectWrapper<T>; + } + + //_.eachRight + interface LoDashStatic { + /** + * @see _.forEachRight + */ + eachRight<T>( + collection: T[], + iteratee?: ListIterator<T, any>, + thisArg?: any + ): T[]; + + /** + * @see _.forEachRight + */ + eachRight<T>( + collection: List<T>, + iteratee?: ListIterator<T, any>, + thisArg?: any + ): List<T>; + + /** + * @see _.forEachRight + */ + eachRight<T>( + collection: Dictionary<T>, + iteratee?: DictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.forEachRight + */ + eachRight<T extends {}>( + collection: T, + iteratee?: ObjectIterator<any, any>, + thisArgs?: any + ): T; + + /** + * @see _.forEachRight + */ + eachRight<T extends {}, TValue>( + collection: T, + iteratee?: ObjectIterator<TValue, any>, + thisArgs?: any + ): T; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.forEachRight + */ + eachRight( + iteratee: ListIterator<string, any>, + thisArg?: any + ): LoDashImplicitWrapper<string>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.forEachRight + */ + eachRight( + iteratee: ListIterator<T, any>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.forEachRight + */ + eachRight<TValue>( + iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>, + thisArg?: any + ): LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.forEachRight + */ + eachRight( + iteratee: ListIterator<string, any>, + thisArg?: any + ): LoDashExplicitWrapper<string>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.forEachRight + */ + eachRight( + iteratee: ListIterator<T, any>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.forEachRight + */ + eachRight<TValue>( + iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>, + thisArg?: any + ): LoDashExplicitObjectWrapper<T>; + } + + //_.every + interface LoDashStatic { + /** + * Checks if predicate returns truthy for all elements of collection. The predicate is bound to thisArg and + * invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns true if all elements pass the predicate check, else false. + */ + every<T>( + collection: List<T>, + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): boolean; + + /** + * @see _.every + */ + every<T>( + collection: Dictionary<T>, + predicate?: DictionaryIterator<T, boolean>, + thisArg?: any + ): boolean; + + /** + * @see _.every + */ + every<T>( + collection: List<T>|Dictionary<T>, + predicate?: string, + thisArg?: any + ): boolean; + + /** + * @see _.every + */ + every<TObject extends {}, T>( + collection: List<T>|Dictionary<T>, + predicate?: TObject + ): boolean; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.every + */ + every( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): boolean; + + /** + * @see _.every + */ + every( + predicate?: string, + thisArg?: any + ): boolean; + + /** + * @see _.every + */ + every<TObject extends {}>( + predicate?: TObject + ): boolean; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.every + */ + every<TResult>( + predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>, + thisArg?: any + ): boolean; + + /** + * @see _.every + */ + every( + predicate?: string, + thisArg?: any + ): boolean; + + /** + * @see _.every + */ + every<TObject extends {}>( + predicate?: TObject + ): boolean; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.every + */ + every( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitWrapper<boolean>; + + /** + * @see _.every + */ + every( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper<boolean>; + + /** + * @see _.every + */ + every<TObject extends {}>( + predicate?: TObject + ): LoDashExplicitWrapper<boolean>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.every + */ + every<TResult>( + predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>, + thisArg?: any + ): LoDashExplicitWrapper<boolean>; + + /** + * @see _.every + */ + every( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper<boolean>; + + /** + * @see _.every + */ + every<TObject extends {}>( + predicate?: TObject + ): LoDashExplicitWrapper<boolean>; + } + + //_.filter + interface LoDashStatic { + /** + * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The + * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new filtered array. + */ + filter<T>( + collection: List<T>, + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): T[]; + + /** + * @see _.filter + */ + filter<T>( + collection: Dictionary<T>, + predicate?: DictionaryIterator<T, boolean>, + thisArg?: any + ): T[]; + + /** + * @see _.filter + */ + filter( + collection: string, + predicate?: StringIterator<boolean>, + thisArg?: any + ): string[]; + + /** + * @see _.filter + */ + filter<T>( + collection: List<T>|Dictionary<T>, + predicate: string, + thisArg?: any + ): T[]; + + /** + * @see _.filter + */ + filter<W extends {}, T>( + collection: List<T>|Dictionary<T>, + predicate: W + ): T[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.filter + */ + filter( + predicate?: StringIterator<boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<string>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.filter + */ + filter( + predicate: ListIterator<T, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.filter + */ + filter( + predicate: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.filter + */ + filter<W>(predicate: W): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.filter + */ + filter<T>( + predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.filter + */ + filter<T>( + predicate: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.filter + */ + filter<W, T>(predicate: W): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.filter + */ + filter( + predicate?: StringIterator<boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<string>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.filter + */ + filter( + predicate: ListIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.filter + */ + filter( + predicate: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.filter + */ + filter<W>(predicate: W): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.filter + */ + filter<T>( + predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.filter + */ + filter<T>( + predicate: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.filter + */ + filter<W, T>(predicate: W): LoDashExplicitArrayWrapper<T>; + } + + //_.find + interface LoDashStatic { + /** + * Iterates over elements of collection, returning the first element predicate returns truthy for. + * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to search. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the matched element, else undefined. + */ + find<T>( + collection: List<T>, + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): T; + + /** + * @see _.find + */ + find<T>( + collection: Dictionary<T>, + predicate?: DictionaryIterator<T, boolean>, + thisArg?: any + ): T; + + /** + * @see _.find + */ + find<T>( + collection: List<T>|Dictionary<T>, + predicate?: string, + thisArg?: any + ): T; + + /** + * @see _.find + */ + find<TObject extends {}, T>( + collection: List<T>|Dictionary<T>, + predicate?: TObject + ): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.find + */ + find( + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): T; + + /** + * @see _.find + */ + find( + predicate?: string, + thisArg?: any + ): T; + + /** + * @see _.find + */ + find<TObject extends {}>( + predicate?: TObject + ): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.find + */ + find<TResult>( + predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>, + thisArg?: any + ): TResult; + + /** + * @see _.find + */ + find<TResult>( + predicate?: string, + thisArg?: any + ): TResult; + + /** + * @see _.find + */ + find<TObject extends {}, TResult>( + predicate?: TObject + ): TResult; + } + + //_.findLast + interface LoDashStatic { + /** + * This method is like _.find except that it iterates over elements of a collection from + * right to left. + * @param collection Searches for a value in this list. + * @param callback The function called per iteration. + * @param thisArg The this binding of callback. + * @return The found element, else undefined. + **/ + findLast<T>( + collection: Array<T>, + callback: ListIterator<T, boolean>, + thisArg?: any): T; + + /** + * @see _.find + **/ + findLast<T>( + collection: List<T>, + callback: ListIterator<T, boolean>, + thisArg?: any): T; + + /** + * @see _.find + **/ + findLast<T>( + collection: Dictionary<T>, + callback: DictionaryIterator<T, boolean>, + thisArg?: any): T; + + /** + * @see _.find + * @param _.pluck style callback + **/ + findLast<W, T>( + collection: Array<T>, + whereValue: W): T; + + /** + * @see _.find + * @param _.pluck style callback + **/ + findLast<W, T>( + collection: List<T>, + whereValue: W): T; + + /** + * @see _.find + * @param _.pluck style callback + **/ + findLast<W, T>( + collection: Dictionary<T>, + whereValue: W): T; + + /** + * @see _.find + * @param _.where style callback + **/ + findLast<T>( + collection: Array<T>, + pluckValue: string): T; + + /** + * @see _.find + * @param _.where style callback + **/ + findLast<T>( + collection: List<T>, + pluckValue: string): T; + + /** + * @see _.find + * @param _.where style callback + **/ + findLast<T>( + collection: Dictionary<T>, + pluckValue: string): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.findLast + */ + findLast( + callback: ListIterator<T, boolean>, + thisArg?: any): T; + /** + * @see _.findLast + * @param _.where style callback + */ + findLast<W>( + whereValue: W): T; + + /** + * @see _.findLast + * @param _.where style callback + */ + findLast( + pluckValue: string): T; + } + + //_.forEach + interface LoDashStatic { + /** + * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg + * and invoked with three arguments: + * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. + * + * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To + * avoid this behavior _.forIn or _.forOwn may be used for object iteration. + * + * @alias _.each + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + */ + forEach<T>( + collection: T[], + iteratee?: ListIterator<T, any>, + thisArg?: any + ): T[]; + + /** + * @see _.forEach + */ + forEach<T>( + collection: List<T>, + iteratee?: ListIterator<T, any>, + thisArg?: any + ): List<T>; + + /** + * @see _.forEach + */ + forEach<T>( + collection: Dictionary<T>, + iteratee?: DictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.forEach + */ + forEach<T extends {}>( + collection: T, + iteratee?: ObjectIterator<any, any>, + thisArgs?: any + ): T; + + /** + * @see _.forEach + */ + forEach<T extends {}, TValue>( + collection: T, + iteratee?: ObjectIterator<TValue, any>, + thisArgs?: any + ): T; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.forEach + */ + forEach( + iteratee: ListIterator<string, any>, + thisArg?: any + ): LoDashImplicitWrapper<string>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.forEach + */ + forEach( + iteratee: ListIterator<T, any>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.forEach + */ + forEach<TValue>( + iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>, + thisArg?: any + ): LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.forEach + */ + forEach( + iteratee: ListIterator<string, any>, + thisArg?: any + ): LoDashExplicitWrapper<string>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.forEach + */ + forEach( + iteratee: ListIterator<T, any>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.forEach + */ + forEach<TValue>( + iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>, + thisArg?: any + ): LoDashExplicitObjectWrapper<T>; + } + + //_.forEachRight + interface LoDashStatic { + /** + * This method is like _.forEach except that it iterates over elements of collection from right to left. + * + * @alias _.eachRight + * + * @param collection The collection to iterate over. + * @param iteratee The function called per iteration. + * @param thisArg The this binding of callback. + */ + forEachRight<T>( + collection: T[], + iteratee?: ListIterator<T, any>, + thisArg?: any + ): T[]; + + /** + * @see _.forEachRight + */ + forEachRight<T>( + collection: List<T>, + iteratee?: ListIterator<T, any>, + thisArg?: any + ): List<T>; + + /** + * @see _.forEachRight + */ + forEachRight<T>( + collection: Dictionary<T>, + iteratee?: DictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.forEachRight + */ + forEachRight<T extends {}>( + collection: T, + iteratee?: ObjectIterator<any, any>, + thisArgs?: any + ): T; + + /** + * @see _.forEachRight + */ + forEachRight<T extends {}, TValue>( + collection: T, + iteratee?: ObjectIterator<TValue, any>, + thisArgs?: any + ): T; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.forEachRight + */ + forEachRight( + iteratee: ListIterator<string, any>, + thisArg?: any + ): LoDashImplicitWrapper<string>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.forEachRight + */ + forEachRight( + iteratee: ListIterator<T, any>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.forEachRight + */ + forEachRight<TValue>( + iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>, + thisArg?: any + ): LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.forEachRight + */ + forEachRight( + iteratee: ListIterator<string, any>, + thisArg?: any + ): LoDashExplicitWrapper<string>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.forEachRight + */ + forEachRight( + iteratee: ListIterator<T, any>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.forEachRight + */ + forEachRight<TValue>( + iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>, + thisArg?: any + ): LoDashExplicitObjectWrapper<T>; + } + + //_.groupBy + interface LoDashStatic { + /** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is an array of the elements responsible for generating the + * key. The iteratee is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + groupBy<T, TKey>( + collection: List<T>, + iteratee?: ListIterator<T, TKey>, + thisArg?: any + ): Dictionary<T[]>; + + /** + * @see _.groupBy + */ + groupBy<T>( + collection: List<any>, + iteratee?: ListIterator<T, any>, + thisArg?: any + ): Dictionary<T[]>; + + /** + * @see _.groupBy + */ + groupBy<T, TKey>( + collection: Dictionary<T>, + iteratee?: DictionaryIterator<T, TKey>, + thisArg?: any + ): Dictionary<T[]>; + + /** + * @see _.groupBy + */ + groupBy<T>( + collection: Dictionary<any>, + iteratee?: DictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<T[]>; + + /** + * @see _.groupBy + */ + groupBy<T, TValue>( + collection: List<T>|Dictionary<T>, + iteratee?: string, + thisArg?: TValue + ): Dictionary<T[]>; + + /** + * @see _.groupBy + */ + groupBy<T>( + collection: List<T>|Dictionary<T>, + iteratee?: string, + thisArg?: any + ): Dictionary<T[]>; + + /** + * @see _.groupBy + */ + groupBy<TWhere, T>( + collection: List<T>|Dictionary<T>, + iteratee?: TWhere + ): Dictionary<T[]>; + + /** + * @see _.groupBy + */ + groupBy<T>( + collection: List<T>|Dictionary<T>, + iteratee?: Object + ): Dictionary<T[]>; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.groupBy + */ + groupBy<TKey>( + iteratee?: ListIterator<T, TKey>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<T[]>>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.groupBy + */ + groupBy<TKey>( + iteratee?: ListIterator<T, TKey>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<TValue>( + iteratee?: string, + thisArg?: TValue + ): LoDashImplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<TWhere>( + iteratee?: TWhere + ): LoDashImplicitObjectWrapper<Dictionary<T[]>>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.groupBy + */ + groupBy<T, TKey>( + iteratee?: ListIterator<T, TKey>|DictionaryIterator<T, TKey>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<T>( + iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<T, TValue>( + iteratee?: string, + thisArg?: TValue + ): LoDashImplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<T>( + iteratee?: string, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<TWhere, T>( + iteratee?: TWhere + ): LoDashImplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<T>( + iteratee?: Object + ): LoDashImplicitObjectWrapper<Dictionary<T[]>>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.groupBy + */ + groupBy<TKey>( + iteratee?: ListIterator<T, TKey>, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<T[]>>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.groupBy + */ + groupBy<TKey>( + iteratee?: ListIterator<T, TKey>, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<TValue>( + iteratee?: string, + thisArg?: TValue + ): LoDashExplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<TWhere>( + iteratee?: TWhere + ): LoDashExplicitObjectWrapper<Dictionary<T[]>>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.groupBy + */ + groupBy<T, TKey>( + iteratee?: ListIterator<T, TKey>|DictionaryIterator<T, TKey>, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<T>( + iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<T, TValue>( + iteratee?: string, + thisArg?: TValue + ): LoDashExplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<T>( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<TWhere, T>( + iteratee?: TWhere + ): LoDashExplicitObjectWrapper<Dictionary<T[]>>; + + /** + * @see _.groupBy + */ + groupBy<T>( + iteratee?: Object + ): LoDashExplicitObjectWrapper<Dictionary<T[]>>; + } + + //_.includes + interface LoDashStatic { + /** + * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, + * it’s used as the offset from the end of collection. + * + * @param collection The collection to search. + * @param target The value to search for. + * @param fromIndex The index to search from. + * @return True if the target element is found, else false. + */ + includes<T>( + collection: List<T>|Dictionary<T>, + target: T, + fromIndex?: number + ): boolean; + + /** + * @see _.includes + */ + includes( + collection: string, + target: string, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.includes + */ + includes( + target: T, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.includes + */ + includes<TValue>( + target: TValue, + fromIndex?: number + ): boolean; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.includes + */ + includes( + target: string, + fromIndex?: number + ): boolean; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.includes + */ + includes( + target: T, + fromIndex?: number + ): LoDashExplicitWrapper<boolean>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.includes + */ + includes<TValue>( + target: TValue, + fromIndex?: number + ): LoDashExplicitWrapper<boolean>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.includes + */ + includes( + target: string, + fromIndex?: number + ): LoDashExplicitWrapper<boolean>; + } + + //_.keyBy + interface LoDashStatic { + /** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is the last element responsible for generating the key. The + * iteratee function is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the composed aggregate object. + */ + keyBy<T>( + collection: List<T>, + iteratee?: ListIterator<T, any>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.keyBy + */ + keyBy<T>( + collection: NumericDictionary<T>, + iteratee?: NumericDictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.keyBy + */ + keyBy<T>( + collection: Dictionary<T>, + iteratee?: DictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.keyBy + */ + keyBy<T>( + collection: List<T>|NumericDictionary<T>|Dictionary<T>, + iteratee?: string, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.keyBy + */ + keyBy<W extends Object, T>( + collection: List<T>|NumericDictionary<T>|Dictionary<T>, + iteratee?: W + ): Dictionary<T>; + + /** + * @see _.keyBy + */ + keyBy<T>( + collection: List<T>|NumericDictionary<T>|Dictionary<T>, + iteratee?: Object + ): Dictionary<T>; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.keyBy + */ + keyBy( + iteratee?: ListIterator<T, any>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<T>>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.keyBy + */ + keyBy( + iteratee?: ListIterator<T, any>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.keyBy + */ + keyBy( + iteratee?: string, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.keyBy + */ + keyBy<W extends Object>( + iteratee?: W + ): LoDashImplicitObjectWrapper<Dictionary<T>>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.keyBy + */ + keyBy<T>( + iteratee?: ListIterator<T, any>|NumericDictionaryIterator<T, any>|DictionaryIterator<T, any>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.keyBy + */ + keyBy<T>( + iteratee?: string, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.keyBy + */ + keyBy<W extends Object, T>( + iteratee?: W + ): LoDashImplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.keyBy + */ + keyBy<T>( + iteratee?: Object + ): LoDashImplicitObjectWrapper<Dictionary<T>>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.keyBy + */ + keyBy( + iteratee?: ListIterator<T, any>, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<T>>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.keyBy + */ + keyBy( + iteratee?: ListIterator<T, any>, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.keyBy + */ + keyBy( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.keyBy + */ + keyBy<W extends Object>( + iteratee?: W + ): LoDashExplicitObjectWrapper<Dictionary<T>>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.keyBy + */ + keyBy<T>( + iteratee?: ListIterator<T, any>|NumericDictionaryIterator<T, any>|DictionaryIterator<T, any>, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.keyBy + */ + keyBy<T>( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.keyBy + */ + keyBy<W extends Object, T>( + iteratee?: W + ): LoDashExplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.keyBy + */ + keyBy<T>( + iteratee?: Object + ): LoDashExplicitObjectWrapper<Dictionary<T>>; + } + + //_.invokeMap + interface LoDashStatic { + /** + * Invokes the method named by methodName on each element in the collection returning + * an array of the results of each invoked method. Additional arguments will be provided + * to each invoked method. If methodName is a function it will be invoked for, and this + * bound to, each element in the collection. + * @param collection The collection to iterate over. + * @param methodName The name of the method to invoke. + * @param args Arguments to invoke the method with. + **/ + invokeMap<T extends {}>( + collection: Array<T>, + methodName: string, + ...args: any[]): any; + + /** + * @see _.invokeMap + **/ + invokeMap<T extends {}>( + collection: List<T>, + methodName: string, + ...args: any[]): any; + + /** + * @see _.invokeMap + **/ + invokeMap<T extends {}>( + collection: Dictionary<T>, + methodName: string, + ...args: any[]): any; + + /** + * @see _.invokeMap + **/ + invokeMap<T extends {}>( + collection: Array<T>, + method: Function, + ...args: any[]): any; + + /** + * @see _.invokeMap + **/ + invokeMap<T extends {}>( + collection: List<T>, + method: Function, + ...args: any[]): any; + + /** + * @see _.invokeMap + **/ + invokeMap<T extends {}>( + collection: Dictionary<T>, + method: Function, + ...args: any[]): any; + } + + //_.map + interface LoDashStatic { + /** + * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to + * thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for iteratee the created _.property style callback returns the property value + * of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for iteratee the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, + * _.reject, and _.some. + * + * The guarded methods are: + * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, + * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, + * sample, some, sum, uniq, and words + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the new mapped array. + */ + map<T, TResult>( + collection: List<T>, + iteratee?: ListIterator<T, TResult>, + thisArg?: any + ): TResult[]; + + /** + * @see _.map + */ + map<T extends {}, TResult>( + collection: Dictionary<T>, + iteratee?: DictionaryIterator<T, TResult>, + thisArg?: any + ): TResult[]; + + /** + * @see _.map + */ + map<T, TResult>( + collection: List<T>|Dictionary<T>, + iteratee?: string + ): TResult[]; + + /** + * @see _.map + */ + map<T, TObject extends {}>( + collection: List<T>|Dictionary<T>, + iteratee?: TObject + ): boolean[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.map + */ + map<TResult>( + iteratee?: ListIterator<T, TResult>, + thisArg?: any + ): LoDashImplicitArrayWrapper<TResult>; + + /** + * @see _.map + */ + map<TResult>( + iteratee?: string + ): LoDashImplicitArrayWrapper<TResult>; + + /** + * @see _.map + */ + map<TObject extends {}>( + iteratee?: TObject + ): LoDashImplicitArrayWrapper<boolean>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.map + */ + map<TValue, TResult>( + iteratee?: ListIterator<TValue, TResult>|DictionaryIterator<TValue, TResult>, + thisArg?: any + ): LoDashImplicitArrayWrapper<TResult>; + + /** + * @see _.map + */ + map<TValue, TResult>( + iteratee?: string + ): LoDashImplicitArrayWrapper<TResult>; + + /** + * @see _.map + */ + map<TObject extends {}>( + iteratee?: TObject + ): LoDashImplicitArrayWrapper<boolean>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.map + */ + map<TResult>( + iteratee?: ListIterator<T, TResult>, + thisArg?: any + ): LoDashExplicitArrayWrapper<TResult>; + + /** + * @see _.map + */ + map<TResult>( + iteratee?: string + ): LoDashExplicitArrayWrapper<TResult>; + + /** + * @see _.map + */ + map<TObject extends {}>( + iteratee?: TObject + ): LoDashExplicitArrayWrapper<boolean>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.map + */ + map<TValue, TResult>( + iteratee?: ListIterator<TValue, TResult>|DictionaryIterator<TValue, TResult>, + thisArg?: any + ): LoDashExplicitArrayWrapper<TResult>; + + /** + * @see _.map + */ + map<TValue, TResult>( + iteratee?: string + ): LoDashExplicitArrayWrapper<TResult>; + + /** + * @see _.map + */ + map<TObject extends {}>( + iteratee?: TObject + ): LoDashExplicitArrayWrapper<boolean>; + } + + //_.partition + interface LoDashStatic { + /** + * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, + * while the second of which contains elements predicate returns falsey for. + * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback + * returns the property value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback + * returns true for elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns + * true for elements that have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param callback The function called per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the array of grouped elements. + **/ + partition<T>( + collection: List<T>, + callback: ListIterator<T, boolean>, + thisArg?: any): T[][]; + + /** + * @see _.partition + **/ + partition<T>( + collection: Dictionary<T>, + callback: DictionaryIterator<T, boolean>, + thisArg?: any): T[][]; + + /** + * @see _.partition + **/ + partition<W, T>( + collection: List<T>, + whereValue: W): T[][]; + + /** + * @see _.partition + **/ + partition<W, T>( + collection: Dictionary<T>, + whereValue: W): T[][]; + + /** + * @see _.partition + **/ + partition<T>( + collection: List<T>, + path: string, + srcValue: any): T[][]; + + /** + * @see _.partition + **/ + partition<T>( + collection: Dictionary<T>, + path: string, + srcValue: any): T[][]; + + /** + * @see _.partition + **/ + partition<T>( + collection: List<T>, + pluckValue: string): T[][]; + + /** + * @see _.partition + **/ + partition<T>( + collection: Dictionary<T>, + pluckValue: string): T[][]; + } + + interface LoDashImplicitStringWrapper { + /** + * @see _.partition + */ + partition( + callback: ListIterator<string, boolean>, + thisArg?: any): LoDashImplicitArrayWrapper<string[]>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.partition + */ + partition( + callback: ListIterator<T, boolean>, + thisArg?: any): LoDashImplicitArrayWrapper<T[]>; + /** + * @see _.partition + */ + partition<W>( + whereValue: W): LoDashImplicitArrayWrapper<T[]>; + /** + * @see _.partition + */ + partition( + path: string, + srcValue: any): LoDashImplicitArrayWrapper<T[]>; + /** + * @see _.partition + */ + partition( + pluckValue: string): LoDashImplicitArrayWrapper<T[]>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.partition + */ + partition<TResult>( + callback: ListIterator<TResult, boolean>, + thisArg?: any): LoDashImplicitArrayWrapper<TResult[]>; + + /** + * @see _.partition + */ + partition<TResult>( + callback: DictionaryIterator<TResult, boolean>, + thisArg?: any): LoDashImplicitArrayWrapper<TResult[]>; + + /** + * @see _.partition + */ + partition<W, TResult>( + whereValue: W): LoDashImplicitArrayWrapper<TResult[]>; + + /** + * @see _.partition + */ + partition<TResult>( + path: string, + srcValue: any): LoDashImplicitArrayWrapper<TResult[]>; + + /** + * @see _.partition + */ + partition<TResult>( + pluckValue: string): LoDashImplicitArrayWrapper<TResult[]>; + } + + //_.reduce + interface LoDashStatic { + /** + * Reduces a collection to a value which is the accumulated result of running each + * element in the collection through the callback, where each successive callback execution + * consumes the return value of the previous execution. If accumulator is not provided the + * first element of the collection will be used as the initial accumulator value. The callback + * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). + * @param collection The collection to iterate over. + * @param callback The function called per iteration. + * @param accumulator Initial value of the accumulator. + * @param thisArg The this binding of callback. + * @return Returns the accumulated value. + **/ + reduce<T, TResult>( + collection: Array<T>, + callback: MemoIterator<T, TResult>, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + reduce<T, TResult>( + collection: List<T>, + callback: MemoIterator<T, TResult>, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + reduce<T, TResult>( + collection: Dictionary<T>, + callback: MemoIterator<T, TResult>, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + reduce<T, TResult>( + collection: Array<T>, + callback: MemoIterator<T, TResult>, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + reduce<T, TResult>( + collection: List<T>, + callback: MemoIterator<T, TResult>, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + reduce<T, TResult>( + collection: Dictionary<T>, + callback: MemoIterator<T, TResult>, + thisArg?: any): TResult; + + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.reduce + **/ + reduce<TResult>( + callback: MemoIterator<T, TResult>, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + reduce<TResult>( + callback: MemoIterator<T, TResult>, + thisArg?: any): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.reduce + **/ + reduce<TValue, TResult>( + callback: MemoIterator<TValue, TResult>, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduce + **/ + reduce<TValue, TResult>( + callback: MemoIterator<TValue, TResult>, + thisArg?: any): TResult; + } + + //_.reduceRight + interface LoDashStatic { + /** + * This method is like _.reduce except that it iterates over elements of a collection from + * right to left. + * @param collection The collection to iterate over. + * @param callback The function called per iteration. + * @param accumulator Initial value of the accumulator. + * @param thisArg The this binding of callback. + * @return The accumulated value. + **/ + reduceRight<T, TResult>( + collection: Array<T>, + callback: MemoIterator<T, TResult>, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight<T, TResult>( + collection: List<T>, + callback: MemoIterator<T, TResult>, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight<T, TResult>( + collection: Dictionary<T>, + callback: MemoIterator<T, TResult>, + accumulator: TResult, + thisArg?: any): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight<T, TResult>( + collection: Array<T>, + callback: MemoIterator<T, TResult>, + thisArg?: any): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight<T, TResult>( + collection: List<T>, + callback: MemoIterator<T, TResult>, + thisArg?: any): TResult; + + /** + * @see _.reduceRight + **/ + reduceRight<T, TResult>( + collection: Dictionary<T>, + callback: MemoIterator<T, TResult>, + thisArg?: any): TResult; + } + + //_.reject + interface LoDashStatic { + /** + * The opposite of _.filter; this method returns the elements of collection that predicate does not return + * truthy for. + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the new filtered array. + */ + reject<T>( + collection: List<T>, + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): T[]; + + /** + * @see _.reject + */ + reject<T>( + collection: Dictionary<T>, + predicate?: DictionaryIterator<T, boolean>, + thisArg?: any + ): T[]; + + /** + * @see _.reject + */ + reject( + collection: string, + predicate?: StringIterator<boolean>, + thisArg?: any + ): string[]; + + /** + * @see _.reject + */ + reject<T>( + collection: List<T>|Dictionary<T>, + predicate: string, + thisArg?: any + ): T[]; + + /** + * @see _.reject + */ + reject<W extends {}, T>( + collection: List<T>|Dictionary<T>, + predicate: W + ): T[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.reject + */ + reject( + predicate?: StringIterator<boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<string>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.reject + */ + reject( + predicate: ListIterator<T, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.reject + */ + reject( + predicate: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.reject + */ + reject<W>(predicate: W): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.reject + */ + reject<T>( + predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.reject + */ + reject<T>( + predicate: string, + thisArg?: any + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.reject + */ + reject<W, T>(predicate: W): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.reject + */ + reject( + predicate?: StringIterator<boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<string>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.reject + */ + reject( + predicate: ListIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.reject + */ + reject( + predicate: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.reject + */ + reject<W>(predicate: W): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.reject + */ + reject<T>( + predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.reject + */ + reject<T>( + predicate: string, + thisArg?: any + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.reject + */ + reject<W, T>(predicate: W): LoDashExplicitArrayWrapper<T>; + } + + //_.sample + interface LoDashStatic { + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + sample<T>(collection: Array<T>): T; + + /** + * @see _.sample + **/ + sample<T>(collection: List<T>): T; + + /** + * @see _.sample + **/ + sample<T>(collection: Dictionary<T>): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.sample + **/ + sample(): LoDashImplicitWrapper<T>; + } + + //_.sampleSize + interface LoDashStatic { + /** + * Gets `n` random elements from `collection`. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=0] The number of elements to sample. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3, 4], 2); + * // => [3, 1] + */ + sampleSize<T>(collection: Array<T>, n: number): T[]; + + /** + * @see _.sampleSize + **/ + sampleSize<T>(collection: List<T>, n: number): T[]; + + /** + * @see _.sampleSize + **/ + sampleSize<T>(collection: Dictionary<T>, n: number): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.sampleSize + **/ + sampleSize(n: number): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sampleSize + **/ + sampleSize(): LoDashImplicitWrapper<T>; + } + + //_.shuffle + interface LoDashStatic { + /** + * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. + * + * @param collection The collection to shuffle. + * @return Returns the new shuffled array. + */ + shuffle<T>(collection: List<T>|Dictionary<T>): T[]; + + /** + * @see _.shuffle + */ + shuffle(collection: string): string[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.shuffle + */ + shuffle(): LoDashImplicitArrayWrapper<string>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.shuffle + */ + shuffle(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.shuffle + */ + shuffle<T>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.shuffle + */ + shuffle(): LoDashExplicitArrayWrapper<string>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.shuffle + */ + shuffle(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.shuffle + */ + shuffle<T>(): LoDashExplicitArrayWrapper<T>; + } + + //_.size + interface LoDashStatic { + /** + * Gets the size of collection by returning its length for array-like values or the number of own enumerable + * properties for objects. + * + * @param collection The collection to inspect. + * @return Returns the size of collection. + */ + size<T>(collection: List<T>|Dictionary<T>): number; + + /** + * @see _.size + */ + size(collection: string): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.size + */ + size(): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.size + */ + size(): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.size + */ + size(): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.size + */ + size(): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.size + */ + size(): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.size + */ + size(): LoDashExplicitWrapper<number>; + } + + //_.some + interface LoDashStatic { + /** + * Checks if predicate returns truthy for any element of collection. The function returns as soon as it finds + * a passing value and does not iterate over the entire collection. The predicate is bound to thisArg and + * invoked with three arguments: (value, index|key, collection). + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param collection The collection to iterate over. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns true if any element passes the predicate check, else false. + */ + some<T>( + collection: List<T>, + predicate?: ListIterator<T, boolean>, + thisArg?: any + ): boolean; + + /** + * @see _.some + */ + some<T>( + collection: Dictionary<T>, + predicate?: DictionaryIterator<T, boolean>, + thisArg?: any + ): boolean; + + /** + * @see _.some + */ + some<T>( + collection: NumericDictionary<T>, + predicate?: NumericDictionaryIterator<T, boolean>, + thisArg?: any + ): boolean; + + /** + * @see _.some + */ + some<T>( + collection: List<T>|Dictionary<T>|NumericDictionary<T>, + predicate?: string, + thisArg?: any + ): boolean; + + /** + * @see _.some + */ + some<TObject extends {}, T>( + collection: List<T>|Dictionary<T>|NumericDictionary<T>, + predicate?: TObject + ): boolean; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.some + */ + some( + predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>, + thisArg?: any + ): boolean; + + /** + * @see _.some + */ + some( + predicate?: string, + thisArg?: any + ): boolean; + + /** + * @see _.some + */ + some<TObject extends {}>( + predicate?: TObject + ): boolean; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.some + */ + some<TResult>( + predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>, + thisArg?: any + ): boolean; + + /** + * @see _.some + */ + some( + predicate?: string, + thisArg?: any + ): boolean; + + /** + * @see _.some + */ + some<TObject extends {}>( + predicate?: TObject + ): boolean; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.some + */ + some( + predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitWrapper<boolean>; + + /** + * @see _.some + */ + some( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper<boolean>; + + /** + * @see _.some + */ + some<TObject extends {}>( + predicate?: TObject + ): LoDashExplicitWrapper<boolean>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.some + */ + some<TResult>( + predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>, + thisArg?: any + ): LoDashExplicitWrapper<boolean>; + + /** + * @see _.some + */ + some( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper<boolean>; + + /** + * @see _.some + */ + some<TObject extends {}>( + predicate?: TObject + ): LoDashExplicitWrapper<boolean>; + } + + //_.sortBy + interface LoDashStatic { + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection through each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]] + * The iteratees to sort by, specified individually or in arrays. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 42 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + */ + sortBy<T, TSort>( + collection: List<T>, + iteratee?: ListIterator<T, TSort> + ): T[]; + + /** + * @see _.sortBy + */ + sortBy<T, TSort>( + collection: Dictionary<T>, + iteratee?: DictionaryIterator<T, TSort> + ): T[]; + + /** + * @see _.sortBy + */ + sortBy<T>( + collection: List<T>|Dictionary<T>, + iteratee: string + ): T[]; + + /** + * @see _.sortBy + */ + sortBy<W extends {}, T>( + collection: List<T>|Dictionary<T>, + whereValue: W + ): T[]; + + /** + * @see _.sortBy + */ + sortBy<T>( + collection: List<T>|Dictionary<T> + ): T[]; + + /** + * @see _.sortBy + */ + sortBy<T>( + collection: (Array<T>|List<T>), + iteratees: (ListIterator<T, any>|string|Object)[]): T[]; + + /** + * @see _.sortBy + */ + sortBy<T>( + collection: (Array<T>|List<T>), + ...iteratees: (ListIterator<T, boolean>|Object|string)[]): T[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.sortBy + */ + sortBy<TSort>( + iteratee?: ListIterator<T, TSort> + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy(iteratee: string): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy<W extends {}>(whereValue: W): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy(): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy(...iteratees: (ListIterator<T, boolean>|Object|string)[]): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortBy + **/ + sortBy(iteratees: (ListIterator<T, any>|string|Object)[]): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.sortBy + */ + sortBy<T, TSort>( + iteratee?: ListIterator<T, TSort>|DictionaryIterator<T, TSort> + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy<T>(iteratee: string): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy<W extends {}, T>(whereValue: W): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy<T>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.sortBy + */ + sortBy<TSort>( + iteratee?: ListIterator<T, TSort> + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy(iteratee: string): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy<W extends {}>(whereValue: W): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.sortBy + */ + sortBy<T, TSort>( + iteratee?: ListIterator<T, TSort>|DictionaryIterator<T, TSort> + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy<T>(iteratee: string): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy<W extends {}, T>(whereValue: W): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.sortBy + */ + sortBy<T>(): LoDashExplicitArrayWrapper<T>; + } + + //_.orderBy + interface LoDashStatic { + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} [iteratees=[_.identity]] The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 42 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // sort by `user` in ascending order and by `age` in descending order + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] + */ + orderBy<W extends Object, T>( + collection: List<T>, + iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + + /** + * @see _.orderBy + */ + orderBy<T>( + collection: List<T>, + iteratees: ListIterator<T, any>|string|Object|(ListIterator<T, any>|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + + /** + * @see _.orderBy + */ + orderBy<W extends Object, T>( + collection: NumericDictionary<T>, + iteratees: NumericDictionaryIterator<T, any>|string|W|(NumericDictionaryIterator<T, any>|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + + /** + * @see _.orderBy + */ + orderBy<T>( + collection: NumericDictionary<T>, + iteratees: NumericDictionaryIterator<T, any>|string|Object|(NumericDictionaryIterator<T, any>|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + + /** + * @see _.orderBy + */ + orderBy<W extends Object, T>( + collection: Dictionary<T>, + iteratees: DictionaryIterator<T, any>|string|W|(DictionaryIterator<T, any>|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + + /** + * @see _.orderBy + */ + orderBy<T>( + collection: Dictionary<T>, + iteratees: DictionaryIterator<T, any>|string|Object|(DictionaryIterator<T, any>|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): T[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.orderBy + */ + orderBy( + iteratees: ListIterator<T, any>|string|(ListIterator<T, any>|string)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.orderBy + */ + orderBy<W extends Object>( + iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.orderBy + */ + orderBy<W extends Object, T>( + iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.orderBy + */ + orderBy<T>( + iteratees: ListIterator<T, any>|string|Object|(ListIterator<T, any>|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.orderBy + */ + orderBy<W extends Object, T>( + iteratees: NumericDictionaryIterator<T, any>|string|W|(NumericDictionaryIterator<T, any>|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.orderBy + */ + orderBy<T>( + iteratees: NumericDictionaryIterator<T, any>|string|Object|(NumericDictionaryIterator<T, any>|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.orderBy + */ + orderBy<W extends Object, T>( + iteratees: DictionaryIterator<T, any>|string|W|(DictionaryIterator<T, any>|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper<T>; + + /** + * @see _.orderBy + */ + orderBy<T>( + iteratees: DictionaryIterator<T, any>|string|Object|(DictionaryIterator<T, any>|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.orderBy + */ + orderBy( + iteratees: ListIterator<T, any>|string|(ListIterator<T, any>|string)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.orderBy + */ + orderBy<W extends Object>( + iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.orderBy + */ + orderBy<W extends Object, T>( + iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.orderBy + */ + orderBy<T>( + iteratees: ListIterator<T, any>|string|Object|(ListIterator<T, any>|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.orderBy + */ + orderBy<W extends Object, T>( + iteratees: NumericDictionaryIterator<T, any>|string|W|(NumericDictionaryIterator<T, any>|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.orderBy + */ + orderBy<T>( + iteratees: NumericDictionaryIterator<T, any>|string|Object|(NumericDictionaryIterator<T, any>|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.orderBy + */ + orderBy<W extends Object, T>( + iteratees: DictionaryIterator<T, any>|string|W|(DictionaryIterator<T, any>|string|W)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper<T>; + + /** + * @see _.orderBy + */ + orderBy<T>( + iteratees: DictionaryIterator<T, any>|string|Object|(DictionaryIterator<T, any>|string|Object)[], + orders?: boolean|string|(boolean|string)[] + ): LoDashExplicitArrayWrapper<T>; + } + + /******** + * Date * + ********/ + + //_.now + interface LoDashStatic { + /** + * Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @return The number of milliseconds. + */ + now(): number; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.now + */ + now(): number; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.now + */ + now(): LoDashExplicitWrapper<number>; + } + + /************* + * Functions * + *************/ + + //_.after + interface LoDashStatic { + /** + * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. + * + * @param n The number of calls before func is invoked. + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + after<TFunc extends Function>( + n: number, + func: TFunc + ): TFunc; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.after + **/ + after<TFunc extends Function>(func: TFunc): LoDashImplicitObjectWrapper<TFunc>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.after + **/ + after<TFunc extends Function>(func: TFunc): LoDashExplicitObjectWrapper<TFunc>; + } + + //_.ary + interface LoDashStatic { + /** + * Creates a function that accepts up to n arguments ignoring any additional arguments. + * + * @param func The function to cap arguments for. + * @param n The arity cap. + * @returns Returns the new function. + */ + ary<TResult extends Function>( + func: Function, + n?: number + ): TResult; + + ary<T extends Function, TResult extends Function>( + func: T, + n?: number + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.ary + */ + ary<TResult extends Function>(n?: number): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.ary + */ + ary<TResult extends Function>(n?: number): LoDashExplicitObjectWrapper<TResult>; + } + + //_.before + interface LoDashStatic { + /** + * Creates a function that invokes func, with the this binding and arguments of the created function, while + * it’s called less than n times. Subsequent calls to the created function return the result of the last func + * invocation. + * + * @param n The number of calls at which func is no longer invoked. + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + before<TFunc extends Function>( + n: number, + func: TFunc + ): TFunc; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.before + **/ + before<TFunc extends Function>(func: TFunc): LoDashImplicitObjectWrapper<TFunc>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.before + **/ + before<TFunc extends Function>(func: TFunc): LoDashExplicitObjectWrapper<TFunc>; + } + + //_.bind + interface FunctionBind { + placeholder: any; + + <T extends Function, TResult extends Function>( + func: T, + thisArg: any, + ...partials: any[] + ): TResult; + + <TResult extends Function>( + func: Function, + thisArg: any, + ...partials: any[] + ): TResult; + } + + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind + * arguments to those provided to the bound function. + * + * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for + * partially applied arguments. + * + * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. + * + * @param func The function to bind. + * @param thisArg The this binding of func. + * @param partials The arguments to be partially applied. + * @return Returns the new bound function. + */ + bind: FunctionBind; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.bind + */ + bind<TResult extends Function>( + thisArg: any, + ...partials: any[] + ): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.bind + */ + bind<TResult extends Function>( + thisArg: any, + ...partials: any[] + ): LoDashExplicitObjectWrapper<TResult>; + } + + //_.bindAll + interface LoDashStatic { + /** + * Binds methods of an object to the object itself, overwriting the existing method. Method names may be + * specified as individual arguments or as arrays of method names. If no method names are provided all + * enumerable function properties, own and inherited, of object are bound. + * + * Note: This method does not set the "length" property of bound functions. + * + * @param object The object to bind and assign the bound methods to. + * @param methodNames The object method names to bind, specified as individual method names or arrays of + * method names. + * @return Returns object. + */ + bindAll<T>( + object: T, + ...methodNames: (string|string[])[] + ): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.bindAll + */ + bindAll(...methodNames: (string|string[])[]): LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.bindAll + */ + bindAll(...methodNames: (string|string[])[]): LoDashExplicitObjectWrapper<T>; + } + + //_.bindKey + interface FunctionBindKey { + placeholder: any; + + <T extends Object, TResult extends Function>( + object: T, + key: any, + ...partials: any[] + ): TResult; + + <TResult extends Function>( + object: Object, + key: any, + ...partials: any[] + ): TResult; + } + + interface LoDashStatic { + /** + * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments + * to those provided to the bound function. + * + * This method differs from _.bind by allowing bound functions to reference methods that may be redefined + * or don’t yet exist. See Peter Michaux’s article for more details. + * + * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder + * for partially applied arguments. + * + * @param object The object the method belongs to. + * @param key The key of the method. + * @param partials The arguments to be partially applied. + * @return Returns the new bound function. + */ + bindKey: FunctionBindKey; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.bindKey + */ + bindKey<TResult extends Function>( + key: any, + ...partials: any[] + ): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.bindKey + */ + bindKey<TResult extends Function>( + key: any, + ...partials: any[] + ): LoDashExplicitObjectWrapper<TResult>; + } + + //_.createCallback + interface LoDashStatic { + /** + * Produces a callback bound to an optional thisArg. If func is a property name the created + * callback will return the property value for a given element. If func is an object the created + * callback will return true for elements that contain the equivalent object properties, + * otherwise it will return false. + * @param func The value to convert to a callback. + * @param thisArg The this binding of the created callback. + * @param argCount The number of arguments the callback accepts. + * @return A callback function. + **/ + createCallback( + func: string, + thisArg?: any, + argCount?: number): () => any; + + /** + * @see _.createCallback + **/ + createCallback( + func: Dictionary<any>, + thisArg?: any, + argCount?: number): () => boolean; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.createCallback + **/ + createCallback( + thisArg?: any, + argCount?: number): LoDashImplicitObjectWrapper<() => any>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.createCallback + **/ + createCallback( + thisArg?: any, + argCount?: number): LoDashImplicitObjectWrapper<() => any>; + } + + //_.curry + interface LoDashStatic { + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curry<T1, R>(func: (t1: T1) => R): + CurriedFunction1<T1, R>; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curry<T1, T2, R>(func: (t1: T1, t2: T2) => R): + CurriedFunction2<T1, T2, R>; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curry<T1, T2, T3, R>(func: (t1: T1, t2: T2, t3: T3) => R): + CurriedFunction3<T1, T2, T3, R>; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curry<T1, T2, T3, T4, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): + CurriedFunction4<T1, T2, T3, T4, R>; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curry<T1, T2, T3, T4, T5, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): + CurriedFunction5<T1, T2, T3, T4, T5, R>; + /** + * Creates a function that accepts one or more arguments of func that when called either invokes func returning + * its result, if all func arguments have been provided, or returns a function that accepts one or more of the + * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curry<TResult extends Function>( + func: Function, + arity?: number): TResult; + } + + interface CurriedFunction1<T1, R> { + (): CurriedFunction1<T1, R>; + (t1: T1): R; + } + + interface CurriedFunction2<T1, T2, R> { + (): CurriedFunction2<T1, T2, R>; + (t1: T1): CurriedFunction1<T2, R>; + (t1: T1, t2: T2): R; + } + + interface CurriedFunction3<T1, T2, T3, R> { + (): CurriedFunction3<T1, T2, T3, R>; + (t1: T1): CurriedFunction2<T2, T3, R>; + (t1: T1, t2: T2): CurriedFunction1<T3, R>; + (t1: T1, t2: T2, t3: T3): R; + } + + interface CurriedFunction4<T1, T2, T3, T4, R> { + (): CurriedFunction4<T1, T2, T3, T4, R>; + (t1: T1): CurriedFunction3<T2, T3, T4, R>; + (t1: T1, t2: T2): CurriedFunction2<T3, T4, R>; + (t1: T1, t2: T2, t3: T3): CurriedFunction1<T4, R>; + (t1: T1, t2: T2, t3: T3, t4: T4): R; + } + + interface CurriedFunction5<T1, T2, T3, T4, T5, R> { + (): CurriedFunction5<T1, T2, T3, T4, T5, R>; + (t1: T1): CurriedFunction4<T2, T3, T4, T5, R>; + (t1: T1, t2: T2): CurriedFunction3<T3, T4, T5, R>; + (t1: T1, t2: T2, t3: T3): CurriedFunction2<T4, T5, R>; + (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1<T5, R>; + (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.curry + **/ + curry<TResult extends Function>(arity?: number): LoDashImplicitObjectWrapper<TResult>; + } + + //_.curryRight + interface LoDashStatic { + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curryRight<T1, R>(func: (t1: T1) => R): + CurriedFunction1<T1, R>; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curryRight<T1, T2, R>(func: (t1: T1, t2: T2) => R): + CurriedFunction2<T2, T1, R>; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curryRight<T1, T2, T3, R>(func: (t1: T1, t2: T2, t3: T3) => R): + CurriedFunction3<T3, T2, T1, R>; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curryRight<T1, T2, T3, T4, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): + CurriedFunction4<T4, T3, T2, T1, R>; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @return Returns the new curried function. + */ + curryRight<T1, T2, T3, T4, T5, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): + CurriedFunction5<T5, T4, T3, T2, T1, R>; + /** + * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight + * instead of _.partial. + * @param func The function to curry. + * @param arity The arity of func. + * @return Returns the new curried function. + */ + curryRight<TResult extends Function>( + func: Function, + arity?: number): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.curryRight + **/ + curryRight<TResult extends Function>(arity?: number): LoDashImplicitObjectWrapper<TResult>; + } + + //_.debounce + interface DebounceSettings { + /** + * Specify invoking on the leading edge of the timeout. + */ + leading?: boolean; + + /** + * The maximum time func is allowed to be delayed before it’s invoked. + */ + maxWait?: number; + + /** + * Specify invoking on the trailing edge of the timeout. + */ + trailing?: boolean; + } + + interface LoDashStatic { + /** + * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since + * the last time the debounced function was invoked. The debounced function comes with a cancel method to + * cancel delayed invocations. Provide an options object to indicate that func should be invoked on the + * leading and/or trailing edge of the wait timeout. Subsequent calls to the debounced function return the + * result of the last func invocation. + * + * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only + * if the the debounced function is invoked more than once during the wait timeout. + * + * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. + * + * @param func The function to debounce. + * @param wait The number of milliseconds to delay. + * @param options The options object. + * @param options.leading Specify invoking on the leading edge of the timeout. + * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. + * @param options.trailing Specify invoking on the trailing edge of the timeout. + * @return Returns the new debounced function. + */ + debounce<T extends Function>( + func: T, + wait?: number, + options?: DebounceSettings + ): T & Cancelable; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.debounce + */ + debounce( + wait?: number, + options?: DebounceSettings + ): LoDashImplicitObjectWrapper<T & Cancelable>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.debounce + */ + debounce( + wait?: number, + options?: DebounceSettings + ): LoDashExplicitObjectWrapper<T & Cancelable>; + } + + //_.defer + interface LoDashStatic { + /** + * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to + * func when it’s invoked. + * + * @param func The function to defer. + * @param args The arguments to invoke the function with. + * @return Returns the timer id. + */ + defer<T extends Function>( + func: T, + ...args: any[] + ): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.defer + */ + defer(...args: any[]): LoDashImplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.defer + */ + defer(...args: any[]): LoDashExplicitWrapper<number>; + } + + //_.delay + interface LoDashStatic { + /** + * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. + * + * @param func The function to delay. + * @param wait The number of milliseconds to delay invocation. + * @param args The arguments to invoke the function with. + * @return Returns the timer id. + */ + delay<T extends Function>( + func: T, + wait: number, + ...args: any[] + ): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.delay + */ + delay( + wait: number, + ...args: any[] + ): LoDashImplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.delay + */ + delay( + wait: number, + ...args: any[] + ): LoDashExplicitWrapper<number>; + } + + interface LoDashStatic { + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + flip<T extends Function>(func: T): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.flip + */ + flip(): LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.flip + */ + flip(): LoDashExplicitObjectWrapper<T>; + } + + //_.flow + interface LoDashStatic { + /** + * Creates a function that returns the result of invoking the provided functions with the this binding of the + * created function, where each successive invocation is supplied the return value of the previous. + * + * @param funcs Functions to invoke. + * @return Returns the new function. + */ + flow<TResult extends Function>(...funcs: Function[]): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.flow + */ + flow<TResult extends Function>(...funcs: Function[]): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.flow + */ + flow<TResult extends Function>(...funcs: Function[]): LoDashExplicitObjectWrapper<TResult>; + } + + //_.flowRight + interface LoDashStatic { + /** + * This method is like _.flow except that it creates a function that invokes the provided functions from right + * to left. + * + * @param funcs Functions to invoke. + * @return Returns the new function. + */ + flowRight<TResult extends Function>(...funcs: Function[]): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.flowRight + */ + flowRight<TResult extends Function>(...funcs: Function[]): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.flowRight + */ + flowRight<TResult extends Function>(...funcs: Function[]): LoDashExplicitObjectWrapper<TResult>; + } + + + //_.memoize + interface MemoizedFunction extends Function { + cache: MapCache; + } + + interface LoDashStatic { + /** + * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for + * storing the result based on the arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with + * the this binding of the memoized function. + * @param func The function to have its output memoized. + * @param resolver The function to resolve the cache key. + * @return Returns the new memoizing function. + */ + memoize<TResult extends MemoizedFunction>( + func: Function, + resolver?: Function): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.memoize + */ + memoize<TResult extends MemoizedFunction>(resolver?: Function): LoDashImplicitObjectWrapper<TResult>; + } + + //_.overArgs (was _.modArgs) + interface LoDashStatic { + /** + * Creates a function that runs each argument through a corresponding transform function. + * + * @param func The function to wrap. + * @param transforms The functions to transform arguments, specified as individual functions or arrays + * of functions. + * @return Returns the new function. + */ + overArgs<T extends Function, TResult extends Function>( + func: T, + ...transforms: Function[] + ): TResult; + + /** + * @see _.overArgs + */ + overArgs<T extends Function, TResult extends Function>( + func: T, + transforms: Function[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.overArgs + */ + overArgs<TResult extends Function>(...transforms: Function[]): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.overArgs + */ + overArgs<TResult extends Function>(transforms: Function[]): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.overArgs + */ + overArgs<TResult extends Function>(...transforms: Function[]): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.overArgs + */ + overArgs<TResult extends Function>(transforms: Function[]): LoDashExplicitObjectWrapper<TResult>; + } + + //_.negate + interface LoDashStatic { + /** + * Creates a function that negates the result of the predicate func. The func predicate is invoked with + * the this binding and arguments of the created function. + * + * @param predicate The predicate to negate. + * @return Returns the new function. + */ + negate<T extends Function>(predicate: T): (...args: any[]) => boolean; + + /** + * @see _.negate + */ + negate<T extends Function, TResult extends Function>(predicate: T): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.negate + */ + negate(): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + + /** + * @see _.negate + */ + negate<TResult extends Function>(): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.negate + */ + negate(): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + + /** + * @see _.negate + */ + negate<TResult extends Function>(): LoDashExplicitObjectWrapper<TResult>; + } + + //_.once + interface LoDashStatic { + /** + * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value + * of the first call. The func is invoked with the this binding and arguments of the created function. + * + * @param func The function to restrict. + * @return Returns the new restricted function. + */ + once<T extends Function>(func: T): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.once + */ + once(): LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.once + */ + once(): LoDashExplicitObjectWrapper<T>; + } + + //_.partial + interface LoDashStatic { + /** + * Creates a function that, when called, invokes func with any additional partial arguments + * prepended to those provided to the new function. This method is similar to _.bind except + * it does not alter the this binding. + * @param func The function to partially apply arguments to. + * @param args Arguments to be partially applied. + * @return The new partially applied function. + **/ + partial: Partial; + } + + type PH = LoDashStatic; + + interface Function0<R> { + (): R; + } + interface Function1<T1, R> { + (t1: T1): R; + } + interface Function2<T1, T2, R> { + (t1: T1, t2: T2): R; + } + interface Function3<T1, T2, T3, R> { + (t1: T1, t2: T2, t3: T3): R; + } + interface Function4<T1, T2, T3, T4, R> { + (t1: T1, t2: T2, t3: T3, t4: T4): R; + } + + interface Partial { + // arity 0 + <R>(func: Function0<R>): Function0<R>; + // arity 1 + <T1, R>(func: Function1<T1, R>): Function1<T1, R>; + <T1, R>(func: Function1<T1, R>, arg1: T1): Function0<R>; + // arity 2 + <T1, T2, R>(func: Function2<T1, T2, R>): Function2<T1, T2, R>; + <T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1): Function1< T2, R>; + <T1, T2, R>(func: Function2<T1, T2, R>, plc1: PH, arg2: T2): Function1<T1, R>; + <T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1, arg2: T2): Function0< R>; + // arity 3 + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>): Function3<T1, T2, T3, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1): Function2< T2, T3, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, plc1: PH, arg2: T2): Function2<T1, T3, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2): Function1< T3, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, plc1: PH, plc2: PH, arg3: T3): Function2<T1, T2, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, plc1: PH, arg2: T2, arg3: T3): Function1<T1, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2, arg3: T3): Function0< R>; + // arity 4 + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>): Function4<T1, T2, T3, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1): Function3< T2, T3, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2): Function3<T1, T3, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2): Function2< T3, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, plc2: PH, arg3: T3): Function3<T1, T2, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3): Function2< T2, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2, arg3: T3): Function2<T1, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3): Function1< T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3<T1, T2, T3, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2<T1, T3, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2<T1, T2, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1<T1, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; + // catch-all + (func: Function, ...args: any[]): Function; + } + + //_.partialRight + interface LoDashStatic { + /** + * This method is like _.partial except that partial arguments are appended to those provided + * to the new function. + * @param func The function to partially apply arguments to. + * @param args Arguments to be partially applied. + * @return The new partially applied function. + **/ + partialRight: PartialRight + } + + interface PartialRight { + // arity 0 + <R>(func: Function0<R>): Function0<R>; + // arity 1 + <T1, R>(func: Function1<T1, R>): Function1<T1, R>; + <T1, R>(func: Function1<T1, R>, arg1: T1): Function0<R>; + // arity 2 + <T1, T2, R>(func: Function2<T1, T2, R>): Function2<T1, T2, R>; + <T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1, plc2: PH): Function1< T2, R>; + <T1, T2, R>(func: Function2<T1, T2, R>, arg2: T2): Function1<T1, R>; + <T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1, arg2: T2): Function0< R>; + // arity 3 + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>): Function3<T1, T2, T3, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, plc2: PH, plc3: PH): Function2< T2, T3, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg2: T2, plc3: PH): Function2<T1, T3, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2, plc3: PH): Function1< T3, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg3: T3): Function2<T1, T2, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg2: T2, arg3: T3): Function1<T1, R>; + <T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2, arg3: T3): Function0< R>; + // arity 4 + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>): Function4<T1, T2, T3, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3< T2, T3, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, plc3: PH, plc4: PH): Function3<T1, T3, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2< T3, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg3: T3, plc4: PH): Function3<T1, T2, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2< T2, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, arg3: T3, plc4: PH): Function2<T1, T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1< T4, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg4: T4): Function3<T1, T2, T3, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, plc3: PH, arg4: T4): Function2<T1, T3, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg3: T3, arg4: T4): Function2<T1, T2, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, arg3: T3, arg4: T4): Function1<T1, R>; + <T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; + // catch-all + (func: Function, ...args: any[]): Function; + } + + //_.rearg + interface LoDashStatic { + /** + * Creates a function that invokes func with arguments arranged according to the specified indexes where the + * argument value at the first index is provided as the first argument, the argument value at the second index + * is provided as the second argument, and so on. + * @param func The function to rearrange arguments for. + * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. + * @return Returns the new function. + */ + rearg<TResult extends Function>(func: Function, indexes: number[]): TResult; + + /** + * @see _.rearg + */ + rearg<TResult extends Function>(func: Function, ...indexes: number[]): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.rearg + */ + rearg<TResult extends Function>(indexes: number[]): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.rearg + */ + rearg<TResult extends Function>(...indexes: number[]): LoDashImplicitObjectWrapper<TResult>; + } + + //_.rest + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of the created function and arguments from start + * and beyond provided as an array. + * + * Note: This method is based on the rest parameter. + * + * @param func The function to apply a rest parameter to. + * @param start The start position of the rest parameter. + * @return Returns the new function. + */ + rest<TResult extends Function>( + func: Function, + start?: number + ): TResult; + + /** + * @see _.rest + */ + rest<TResult extends Function, TFunc extends Function>( + func: TFunc, + start?: number + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.rest + */ + rest<TResult extends Function>(start?: number): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.rest + */ + rest<TResult extends Function>(start?: number): LoDashExplicitObjectWrapper<TResult>; + } + + //_.spread + interface LoDashStatic { + /** + * Creates a function that invokes func with the this binding of the created function and an array of arguments + * much like Function#apply. + * + * Note: This method is based on the spread operator. + * + * @param func The function to spread arguments over. + * @return Returns the new function. + */ + spread<F extends Function, T extends Function>(func: F): T; + + /** + * @see _.spread + */ + spread<T extends Function>(func: Function): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.spread + */ + spread<T extends Function>(): LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.spread + */ + spread<T extends Function>(): LoDashExplicitObjectWrapper<T>; + } + + //_.throttle + interface ThrottleSettings { + /** + * If you'd like to disable the leading-edge call, pass this as false. + */ + leading?: boolean; + + /** + * If you'd like to disable the execution on the trailing-edge, pass false. + */ + trailing?: boolean; + } + + interface LoDashStatic { + /** + * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled + * function comes with a cancel method to cancel delayed invocations. Provide an options object to indicate + * that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls to + * the throttled function return the result of the last func call. + * + * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if + * the the throttled function is invoked more than once during the wait timeout. + * + * @param func The function to throttle. + * @param wait The number of milliseconds to throttle invocations to. + * @param options The options object. + * @param options.leading Specify invoking on the leading edge of the timeout. + * @param options.trailing Specify invoking on the trailing edge of the timeout. + * @return Returns the new throttled function. + */ + throttle<T extends Function>( + func: T, + wait?: number, + options?: ThrottleSettings + ): T & Cancelable; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.throttle + */ + throttle( + wait?: number, + options?: ThrottleSettings + ): LoDashImplicitObjectWrapper<T & Cancelable>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.throttle + */ + throttle( + wait?: number, + options?: ThrottleSettings + ): LoDashExplicitObjectWrapper<T & Cancelable>; + } + + //_.unary + interface LoDashStatic { + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + unary<T extends Function>(func: T): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.unary + */ + unary(): LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.unary + */ + unary(): LoDashExplicitObjectWrapper<T>; + } + + //_.wrap + interface LoDashStatic { + /** + * Creates a function that provides value to the wrapper function as its first argument. Any additional + * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is + * invoked with the this binding of the created function. + * + * @param value The value to wrap. + * @param wrapper The wrapper function. + * @return Returns the new function. + */ + wrap<V, W extends Function, R extends Function>( + value: V, + wrapper: W + ): R; + + /** + * @see _.wrap + */ + wrap<V, R extends Function>( + value: V, + wrapper: Function + ): R; + + /** + * @see _.wrap + */ + wrap<R extends Function>( + value: any, + wrapper: Function + ): R; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.wrap + */ + wrap<W extends Function, R extends Function>(wrapper: W): LoDashImplicitObjectWrapper<R>; + + /** + * @see _.wrap + */ + wrap<R extends Function>(wrapper: Function): LoDashImplicitObjectWrapper<R>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.wrap + */ + wrap<W extends Function, R extends Function>(wrapper: W): LoDashImplicitObjectWrapper<R>; + + /** + * @see _.wrap + */ + wrap<R extends Function>(wrapper: Function): LoDashImplicitObjectWrapper<R>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.wrap + */ + wrap<W extends Function, R extends Function>(wrapper: W): LoDashImplicitObjectWrapper<R>; + + /** + * @see _.wrap + */ + wrap<R extends Function>(wrapper: Function): LoDashImplicitObjectWrapper<R>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.wrap + */ + wrap<W extends Function, R extends Function>(wrapper: W): LoDashExplicitObjectWrapper<R>; + + /** + * @see _.wrap + */ + wrap<R extends Function>(wrapper: Function): LoDashExplicitObjectWrapper<R>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.wrap + */ + wrap<W extends Function, R extends Function>(wrapper: W): LoDashExplicitObjectWrapper<R>; + + /** + * @see _.wrap + */ + wrap<R extends Function>(wrapper: Function): LoDashExplicitObjectWrapper<R>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.wrap + */ + wrap<W extends Function, R extends Function>(wrapper: W): LoDashExplicitObjectWrapper<R>; + + /** + * @see _.wrap + */ + wrap<R extends Function>(wrapper: Function): LoDashExplicitObjectWrapper<R>; + } + + /******** + * Lang * + ********/ + + //_.clone + interface LoDashStatic { + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + clone<T>(value: T): T; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.clone + */ + clone(): T; + } + + interface LoDashImplicitArrayWrapper<T> { + + /** + * @see _.clone + */ + clone(): T[]; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.clone + */ + clone(): T; + } + + //_.cloneDeep + interface LoDashStatic { + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + cloneDeep<T>(value: T): T; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.cloneDeep + */ + cloneDeep(): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.cloneDeep + */ + cloneDeep(): T[]; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.cloneDeep + */ + cloneDeep(): T; + } + + //_.cloneWith + interface LoDashStatic { + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + clone<T>( + value: T, + customizer: (value: any) => any): T; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.clone + */ + clone(customizer: (value: any) => any): T; + } + + interface LoDashImplicitArrayWrapper<T> { + + /** + * @see _.clone + */ + clone(customizer: (value: any) => any): T[]; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.clone + */ + clone(customizer: (value: any) => any): T; + } + + //_.cloneDeepWith + interface LoDashStatic { + /** + * Creates a deep clone of value. If customizer is provided it’s invoked to produce the cloned values. If + * customizer returns undefined cloning is handled by the method instead. The customizer is bound to thisArg + * and invoked with up to three argument; (value [, index|key, object]). + * Note: This method is loosely based on the structured clone algorithm. The enumerable properties of arguments + * objects and objects created by constructors other than Object are cloned to plain Object objects. An empty + * object is returned for uncloneable values such as functions, DOM nodes, Maps, Sets, and WeakMaps. + * @param value The value to deep clone. + * @param customizer The function to customize cloning values. + * @param thisArg The this binding of customizer. + * @return Returns the deep cloned value. + */ + cloneDeep<T>( + value: T, + customizer: (value: any) => any): T; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.cloneDeep + */ + cloneDeep(customizer: (value: any) => any): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.cloneDeep + */ + cloneDeep(customizer: (value: any) => any): T[]; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.cloneDeep + */ + cloneDeep(customizer: (value: any) => any): T; + } + + //_.eq + interface LoDashStatic { + /** + * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + eq( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isEqual + */ + eq( + other: any + ): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isEqual + */ + eq( + other: any + ): LoDashExplicitWrapper<boolean>; + } + + //_.gt + interface LoDashStatic { + /** + * Checks if value is greater than other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is greater than other, else false. + */ + gt( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.gt + */ + gt(other: any): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.gt + */ + gt(other: any): LoDashExplicitWrapper<boolean>; + } + + //_.gte + interface LoDashStatic { + /** + * Checks if value is greater than or equal to other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is greater than or equal to other, else false. + */ + gte( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.gte + */ + gte(other: any): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.gte + */ + gte(other: any): LoDashExplicitWrapper<boolean>; + } + + //_.isArguments + interface LoDashStatic { + /** + * Checks if value is classified as an arguments object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isArguments(value?: any): value is IArguments; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isArguments + */ + isArguments(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isArguments + */ + isArguments(): LoDashExplicitWrapper<boolean>; + } + + //_.isArray + interface LoDashStatic { + /** + * Checks if value is classified as an Array object. + * @param value The value to check. + * + * @return Returns true if value is correctly classified, else false. + */ + isArray<T>(value?: any): value is T[]; + } + + interface LoDashImplicitWrapperBase<T,TWrapper> { + /** + * @see _.isArray + */ + isArray(): boolean; + } + + interface LoDashExplicitWrapperBase<T,TWrapper> { + /** + * @see _.isArray + */ + isArray(): LoDashExplicitWrapper<boolean>; + } + + //_.isArrayLike + interface LoDashStatic { + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @type Function + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + isArrayLike<T>(value?: any): value is T[]; + } + + interface LoDashImplicitWrapperBase<T,TWrapper> { + /** + * @see _.isArrayLike + */ + isArrayLike(): boolean; + } + + interface LoDashExplicitWrapperBase<T,TWrapper> { + /** + * @see _.isArrayLike + */ + isArrayLike(): LoDashExplicitWrapper<boolean>; + } + + //_.isArrayLikeObject + interface LoDashStatic { + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @type Function + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + isArrayLikeObject<T>(value?: any): value is T[]; + } + + interface LoDashImplicitWrapperBase<T,TWrapper> { + /** + * @see _.isArrayLikeObject + */ + isArrayLikeObject(): boolean; + } + + interface LoDashExplicitWrapperBase<T,TWrapper> { + /** + * @see _.isArrayLikeObject + */ + isArrayLikeObject(): LoDashExplicitWrapper<boolean>; + } + + //_.isBoolean + interface LoDashStatic { + /** + * Checks if value is classified as a boolean primitive or object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isBoolean(value?: any): value is boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isBoolean + */ + isBoolean(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isBoolean + */ + isBoolean(): LoDashExplicitWrapper<boolean>; + } + + //_.isDate + interface LoDashStatic { + /** + * Checks if value is classified as a Date object. + * @param value The value to check. + * + * @return Returns true if value is correctly classified, else false. + */ + isDate(value?: any): value is Date; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isDate + */ + isDate(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isDate + */ + isDate(): LoDashExplicitWrapper<boolean>; + } + + //_.isElement + interface LoDashStatic { + /** + * Checks if value is a DOM element. + * + * @param value The value to check. + * @return Returns true if value is a DOM element, else false. + */ + isElement(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isElement + */ + isElement(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isElement + */ + isElement(): LoDashExplicitWrapper<boolean>; + } + + //_.isEmpty + interface LoDashStatic { + /** + * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or + * jQuery-like collection with a length greater than 0 or an object with own enumerable properties. + * @param value The value to inspect. + * @return Returns true if value is empty, else false. + **/ + isEmpty(value?: any[]|Dictionary<any>|string|any): boolean; + } + + interface LoDashImplicitWrapperBase<T,TWrapper> { + /** + * @see _.isEmpty + */ + isEmpty(): boolean; + } + + //_.isEqual + interface LoDashStatic { + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are **not** supported. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + isEqual( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isEqual + */ + isEqual( + other: any + ): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isEqual + */ + isEqual( + other: any + ): LoDashExplicitWrapper<boolean>; + } + + // _.isEqualWith + interface IsEqualCustomizer { + (value: any, other: any, indexOrKey?: number|string): boolean; + } + + interface LoDashStatic { + /** + * This method is like `_.isEqual` except that it accepts `customizer` which is + * invoked to compare values. If `customizer` returns `undefined` comparisons are + * handled by the method instead. The `customizer` is invoked with up to seven arguments: + * (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + isEqualWith( + value: any, + other: any, + customizer: IsEqualCustomizer + ): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isEqualWith + */ + isEqualWith( + other: any, + customizer: IsEqualCustomizer + ): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isEqualWith + */ + isEqualWith( + other: any, + customizer: IsEqualCustomizer + ): LoDashExplicitWrapper<boolean>; + } + + //_.isError + interface LoDashStatic { + /** + * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError + * object. + * + * @param value The value to check. + * @return Returns true if value is an error object, else false. + */ + isError(value: any): value is Error; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isError + */ + isError(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isError + */ + isError(): LoDashExplicitWrapper<boolean>; + } + + //_.isFinite + interface LoDashStatic { + /** + * Checks if value is a finite primitive number. + * + * Note: This method is based on Number.isFinite. + * + * @param value The value to check. + * @return Returns true if value is a finite number, else false. + */ + isFinite(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isFinite + */ + isFinite(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isFinite + */ + isFinite(): LoDashExplicitWrapper<boolean>; + } + + //_.isFunction + interface LoDashStatic { + /** + * Checks if value is classified as a Function object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isFunction(value?: any): value is Function; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isFunction + */ + isFunction(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isFunction + */ + isFunction(): LoDashExplicitWrapper<boolean>; + } + + //_.isInteger + interface LoDashStatic { + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + isInteger(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isInteger + */ + isInteger(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isInteger + */ + isInteger(): LoDashExplicitWrapper<boolean>; + } + + //_.isLength + interface LoDashStatic { + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + isLength(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isLength + */ + isLength(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isLength + */ + isLength(): LoDashExplicitWrapper<boolean>; + } + + //_.isMatch + interface isMatchCustomizer { + (value: any, other: any, indexOrKey?: number|string): boolean; + } + + interface LoDashStatic { + /** + * Performs a deep comparison between `object` and `source` to determine if + * `object` contains equivalent property values. + * + * **Note:** This method supports comparing the same values as `_.isEqual`. + * + * @static + * @memberOf _ + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.isMatch(object, { 'age': 40 }); + * // => true + * + * _.isMatch(object, { 'age': 36 }); + * // => false + */ + isMatch(object: Object, source: Object): boolean; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.isMatch + */ + isMatch(source: Object): boolean; + } + + //_.isMatchWith + interface isMatchWithCustomizer { + (value: any, other: any, indexOrKey?: number|string): boolean; + } + + interface LoDashStatic { + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined` comparisons + * are handled by the method instead. The `customizer` is invoked with three + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + isMatchWith(object: Object, source: Object, customizer: isMatchWithCustomizer): boolean; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.isMatchWith + */ + isMatchWith(source: Object, customizer: isMatchWithCustomizer): boolean; + } + + //_.isNaN + interface LoDashStatic { + /** + * Checks if value is NaN. + * + * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values. + * + * @param value The value to check. + * @return Returns true if value is NaN, else false. + */ + isNaN(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.isNaN + */ + isNaN(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.isNaN + */ + isNaN(): LoDashExplicitWrapper<boolean>; + } + + //_.isNative + interface LoDashStatic { + /** + * Checks if value is a native function. + * @param value The value to check. + * + * @retrun Returns true if value is a native function, else false. + */ + isNative(value: any): value is Function; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isNative + */ + isNative(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isNative + */ + isNative(): LoDashExplicitWrapper<boolean>; + } + + //_.isNil + interface LoDashStatic { + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + isNil(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isNil + */ + isNil(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isNil + */ + isNil(): LoDashExplicitWrapper<boolean>; + } + + //_.isNull + interface LoDashStatic { + /** + * Checks if value is null. + * + * @param value The value to check. + * @return Returns true if value is null, else false. + */ + isNull(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isNull + */ + isNull(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isNull + */ + isNull(): LoDashExplicitWrapper<boolean>; + } + + //_.isNumber + interface LoDashStatic { + /** + * Checks if value is classified as a Number primitive or object. + * + * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isNumber(value?: any): value is number; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isNumber + */ + isNumber(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isNumber + */ + isNumber(): LoDashExplicitWrapper<boolean>; + } + + //_.isObject + interface LoDashStatic { + /** + * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), + * and new String('')) + * + * @param value The value to check. + * @return Returns true if value is an object, else false. + */ + isObject(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isObject + */ + isObject(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isObject + */ + isObject(): LoDashExplicitWrapper<boolean>; + } + + //_.isObjectLike + interface LoDashStatic { + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + isObjectLike(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isObjectLike + */ + isObjectLike(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isObjectLike + */ + isObjectLike(): LoDashExplicitWrapper<boolean>; + } + + //_.isPlainObject + interface LoDashStatic { + /** + * Checks if value is a plain object, that is, an object created by the Object constructor or one with a + * [[Prototype]] of null. + * + * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties. + * + * @param value The value to check. + * @return Returns true if value is a plain object, else false. + */ + isPlainObject(value?: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isPlainObject + */ + isPlainObject(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isPlainObject + */ + isPlainObject(): LoDashExplicitWrapper<boolean>; + } + + //_.isRegExp + interface LoDashStatic { + /** + * Checks if value is classified as a RegExp object. + * @param value The value to check. + * + * @return Returns true if value is correctly classified, else false. + */ + isRegExp(value?: any): value is RegExp; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isRegExp + */ + isRegExp(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isRegExp + */ + isRegExp(): LoDashExplicitWrapper<boolean>; + } + + //_.isSafeInteger + interface LoDashStatic { + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + isSafeInteger(value: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isSafeInteger + */ + isSafeInteger(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isSafeInteger + */ + isSafeInteger(): LoDashExplicitWrapper<boolean>; + } + + //_.isString + interface LoDashStatic { + /** + * Checks if value is classified as a String primitive or object. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isString(value?: any): value is string; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isString + */ + isString(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isString + */ + isString(): LoDashExplicitWrapper<boolean>; + } + + //_.isSymbol + interface LoDashStatic { + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + isSymbol(value: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isSymbol + */ + isSymbol(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isSymbol + */ + isSymbol(): LoDashExplicitWrapper<boolean>; + } + + //_.isTypedArray + interface LoDashStatic { + /** + * Checks if value is classified as a typed array. + * + * @param value The value to check. + * @return Returns true if value is correctly classified, else false. + */ + isTypedArray(value: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isTypedArray + */ + isTypedArray(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isTypedArray + */ + isTypedArray(): LoDashExplicitWrapper<boolean>; + } + + //_.isUndefined + interface LoDashStatic { + /** + * Checks if value is undefined. + * + * @param value The value to check. + * @return Returns true if value is undefined, else false. + */ + isUndefined(value: any): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * see _.isUndefined + */ + isUndefined(): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * see _.isUndefined + */ + isUndefined(): LoDashExplicitWrapper<boolean>; + } + + //_.lt + interface LoDashStatic { + /** + * Checks if value is less than other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is less than other, else false. + */ + lt( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.lt + */ + lt(other: any): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.lt + */ + lt(other: any): LoDashExplicitWrapper<boolean>; + } + + //_.lte + interface LoDashStatic { + /** + * Checks if value is less than or equal to other. + * + * @param value The value to compare. + * @param other The other value to compare. + * @return Returns true if value is less than or equal to other, else false. + */ + lte( + value: any, + other: any + ): boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.lte + */ + lte(other: any): boolean; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.lte + */ + lte(other: any): LoDashExplicitWrapper<boolean>; + } + + //_.toArray + interface LoDashStatic { + /** + * Converts value to an array. + * + * @param value The value to convert. + * @return Returns the converted array. + */ + toArray<T>(value: List<T>|Dictionary<T>|NumericDictionary<T>): T[]; + + /** + * @see _.toArray + */ + toArray<TValue, TResult>(value: TValue): TResult[]; + + /** + * @see _.toArray + */ + toArray<TResult>(value?: any): TResult[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.toArray + */ + toArray<TResult>(): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.toArray + */ + toArray(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.toArray + */ + toArray<TResult>(): LoDashImplicitArrayWrapper<TResult>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.toArray + */ + toArray<TResult>(): LoDashExplicitArrayWrapper<TResult>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.toArray + */ + toArray(): LoDashExplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.toArray + */ + toArray<TResult>(): LoDashExplicitArrayWrapper<TResult>; + } + + //_.toPlainObject + interface LoDashStatic { + /** + * Converts value to a plain object flattening inherited enumerable properties of value to own properties + * of the plain object. + * + * @param value The value to convert. + * @return Returns the converted plain object. + */ + toPlainObject<TResult extends {}>(value?: any): TResult; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.toPlainObject + */ + toPlainObject<TResult extends {}>(): LoDashImplicitObjectWrapper<TResult>; + } + + //_.toInteger + interface LoDashStatic { + /** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ + toInteger(value: any): number; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.toInteger + */ + toInteger(): LoDashImplicitWrapper<number>; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.toInteger + */ + toInteger(): LoDashExplicitWrapper<number>; + } + + //_.toLength + interface LoDashStatic { + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @return {number} Returns the converted integer. + * @example + * + * _.toLength(3); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3'); + * // => 3 + */ + toLength(value: any): number; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.toLength + */ + toLength(): LoDashImplicitWrapper<number>; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.toLength + */ + toLength(): LoDashExplicitWrapper<number>; + } + + //_.toNumber + interface LoDashStatic { + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ + toNumber(value: any): number; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.toNumber + */ + toNumber(): LoDashImplicitWrapper<number>; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.toNumber + */ + toNumber(): LoDashExplicitWrapper<number>; + } + + //_.toSafeInteger + interface LoDashStatic { + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3'); + * // => 3 + */ + toSafeInteger(value: any): number; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.toSafeInteger + */ + toSafeInteger(): LoDashImplicitWrapper<number>; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.toSafeInteger + */ + toSafeInteger(): LoDashExplicitWrapper<number>; + } + + //_.toString DUMMY + interface LoDashStatic { + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + toString(value: any): string; + } + + /******** + * Math * + ********/ + + //_.add + interface LoDashStatic { + /** + * Adds two numbers. + * + * @param augend The first number to add. + * @param addend The second number to add. + * @return Returns the sum. + */ + add( + augend: number, + addend: number + ): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.add + */ + add(addend: number): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.add + */ + add(addend: number): LoDashExplicitWrapper<number>; + } + + //_.ceil + interface LoDashStatic { + /** + * Calculates n rounded up to precision. + * + * @param n The number to round up. + * @param precision The precision to round up to. + * @return Returns the rounded up number. + */ + ceil( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.ceil + */ + ceil(precision?: number): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.ceil + */ + ceil(precision?: number): LoDashExplicitWrapper<number>; + } + + //_.floor + interface LoDashStatic { + /** + * Calculates n rounded down to precision. + * + * @param n The number to round down. + * @param precision The precision to round down to. + * @return Returns the rounded down number. + */ + floor( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.floor + */ + floor(precision?: number): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.floor + */ + floor(precision?: number): LoDashExplicitWrapper<number>; + } + + //_.max + interface LoDashStatic { + /** + * Computes the maximum value of `array`. If `array` is empty or falsey + * `undefined` is returned. + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + */ + max<T>( + collection: List<T> + ): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.max + */ + max(): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.max + */ + max<T>(): T; + } + + //_.maxBy + interface LoDashStatic { + /** + * This method is like `_.max` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * the value is ranked. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {*} Returns the maximum value. + * @example + * + * var objects = [{ 'n': 1 }, { 'n': 2 }]; + * + * _.maxBy(objects, function(o) { return o.a; }); + * // => { 'n': 2 } + * + * // using the `_.property` iteratee shorthand + * _.maxBy(objects, 'n'); + * // => { 'n': 2 } + */ + maxBy<T>( + collection: List<T>, + iteratee?: ListIterator<T, any> + ): T; + + /** + * @see _.maxBy + */ + maxBy<T>( + collection: Dictionary<T>, + iteratee?: DictionaryIterator<T, any> + ): T; + + /** + * @see _.maxBy + */ + maxBy<T>( + collection: List<T>|Dictionary<T>, + iteratee?: string + ): T; + + /** + * @see _.maxBy + */ + maxBy<TObject extends {}, T>( + collection: List<T>|Dictionary<T>, + whereValue?: TObject + ): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.maxBy + */ + maxBy( + iteratee?: ListIterator<T, any> + ): T; + + /** + * @see _.maxBy + */ + maxBy( + iteratee?: string + ): T; + + /** + * @see _.maxBy + */ + maxBy<TObject extends {}>( + whereValue?: TObject + ): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.maxBy + */ + maxBy<T>( + iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>, + thisArg?: any + ): T; + + /** + * @see _.maxBy + */ + maxBy<T>( + iteratee?: string, + thisArg?: any + ): T; + + /** + * @see _.maxBy + */ + maxBy<TObject extends {}, T>( + whereValue?: TObject + ): T; + } + + //_.mean + interface LoDashStatic { + /** + * Computes the mean of the values in `array`. + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {number} Returns the mean. + * @example + * + * _.mean([4, 2, 8, 6]); + * // => 5 + */ + mean<T>( + collection: List<T> + ): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.mean + */ + mean<T>(): number; + + /** + * @see _.mean + */ + mean(): number; + } + + //_.min + interface LoDashStatic { + /** + * Computes the minimum value of `array`. If `array` is empty or falsey + * `undefined` is returned. + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the minimum value. + */ + min<T>( + collection: List<T> + ): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.min + */ + min(): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.min + */ + min<T>(): T; + } + + //_.minBy + interface LoDashStatic { + /** + * This method is like `_.min` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * the value is ranked. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {*} Returns the minimum value. + * @example + * + * var objects = [{ 'n': 1 }, { 'n': 2 }]; + * + * _.minBy(objects, function(o) { return o.a; }); + * // => { 'n': 1 } + * + * // using the `_.property` iteratee shorthand + * _.minBy(objects, 'n'); + * // => { 'n': 1 } + */ + minBy<T>( + collection: List<T>, + iteratee?: ListIterator<T, any> + ): T; + + /** + * @see _.minBy + */ + minBy<T>( + collection: Dictionary<T>, + iteratee?: DictionaryIterator<T, any> + ): T; + + /** + * @see _.minBy + */ + minBy<T>( + collection: List<T>|Dictionary<T>, + iteratee?: string + ): T; + + /** + * @see _.minBy + */ + minBy<TObject extends {}, T>( + collection: List<T>|Dictionary<T>, + whereValue?: TObject + ): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.minBy + */ + minBy( + iteratee?: ListIterator<T, any> + ): T; + + /** + * @see _.minBy + */ + minBy( + iteratee?: string + ): T; + + /** + * @see _.minBy + */ + minBy<TObject extends {}>( + whereValue?: TObject + ): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.minBy + */ + minBy<T>( + iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>, + thisArg?: any + ): T; + + /** + * @see _.minBy + */ + minBy<T>( + iteratee?: string, + thisArg?: any + ): T; + + /** + * @see _.minBy + */ + minBy<TObject extends {}, T>( + whereValue?: TObject + ): T; + } + + //_.round + interface LoDashStatic { + /** + * Calculates n rounded to precision. + * + * @param n The number to round. + * @param precision The precision to round to. + * @return Returns the rounded number. + */ + round( + n: number, + precision?: number + ): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.round + */ + round(precision?: number): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.round + */ + round(precision?: number): LoDashExplicitWrapper<number>; + } + + //_.sum + interface LoDashStatic { + /** + * Computes the sum of the values in `array`. + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {number} Returns the sum. + * @example + * + * _.sum([4, 2, 8, 6]); + * // => 20 + */ + sum<T>(collection: List<T>): number; + + /** + * @see _.sum + */ + sum(collection: List<number>|Dictionary<number>): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.sum + */ + sum(): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.sum + **/ + sum<TValue>(): number; + + /** + * @see _.sum + */ + sum(): number; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.sum + */ + sum(): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.sum + */ + sum<TValue>(): LoDashExplicitWrapper<number>; + + /** + * @see _.sum + */ + sum(): LoDashExplicitWrapper<number>; + } + + //_.sumBy + interface LoDashStatic { + /** + * This method is like `_.sum` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the value to be summed. + * The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the sum. + * @example + * + * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; + * + * _.sumBy(objects, function(o) { return o.n; }); + * // => 20 + * + * // using the `_.property` iteratee shorthand + * _.sumBy(objects, 'n'); + * // => 20 + */ + sumBy<T>( + collection: List<T>, + iteratee: ListIterator<T, number> + ): number; + + /** + * @see _.sumBy + **/ + sumBy<T>( + collection: Dictionary<T>, + iteratee: DictionaryIterator<T, number> + ): number; + + /** + * @see _.sumBy + */ + sumBy<T>( + collection: List<number>|Dictionary<number>, + iteratee: string + ): number; + + /** + * @see _.sumBy + */ + sumBy<T>(collection: List<T>|Dictionary<T>): number; + + /** + * @see _.sumBy + */ + sumBy(collection: List<number>|Dictionary<number>): number; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.sumBy + */ + sumBy( + iteratee: ListIterator<T, number> + ): number; + + /** + * @see _.sumBy + */ + sumBy(iteratee: string): number; + + /** + * @see _.sumBy + */ + sumBy(): number; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.sumBy + **/ + sumBy<TValue>( + iteratee: ListIterator<TValue, number>|DictionaryIterator<TValue, number> + ): number; + + /** + * @see _.sumBy + */ + sumBy(iteratee: string): number; + + /** + * @see _.sumBy + */ + sumBy(): number; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.sumBy + */ + sumBy( + iteratee: ListIterator<T, number> + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sumBy + */ + sumBy(iteratee: string): LoDashExplicitWrapper<number>; + + /** + * @see _.sumBy + */ + sumBy(): LoDashExplicitWrapper<number>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.sumBy + */ + sumBy<TValue>( + iteratee: ListIterator<TValue, number>|DictionaryIterator<TValue, number> + ): LoDashExplicitWrapper<number>; + + /** + * @see _.sumBy + */ + sumBy(iteratee: string): LoDashExplicitWrapper<number>; + + /** + * @see _.sumBy + */ + sumBy(): LoDashExplicitWrapper<number>; + } + + /********** + * Number * + **********/ + + //_.subtract + interface LoDashStatic { + /** + * Subtract two numbers. + * + * @static + * @memberOf _ + * @category Math + * @param {number} minuend The first number in a subtraction. + * @param {number} subtrahend The second number in a subtraction. + * @returns {number} Returns the difference. + * @example + * + * _.subtract(6, 4); + * // => 2 + */ + subtract( + minuend: number, + subtrahend: number + ): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.subtract + */ + subtract( + subtrahend: number + ): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.subtract + */ + subtract( + subtrahend: number + ): LoDashExplicitWrapper<number>; + } + + //_.clamp + interface LoDashStatic { + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + clamp( + number: number, + lower: number, + upper: number + ): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.clamp + */ + clamp( + lower: number, + upper: number + ): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.clamp + */ + clamp( + lower: number, + upper: number + ): LoDashExplicitWrapper<number>; + } + + //_.inRange + interface LoDashStatic { + /** + * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start + * with start then set to 0. + * + * @param n The number to check. + * @param start The start of the range. + * @param end The end of the range. + * @return Returns true if n is in the range, else false. + */ + inRange( + n: number, + start: number, + end: number + ): boolean; + + + /** + * @see _.inRange + */ + inRange( + n: number, + end: number + ): boolean; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.inRange + */ + inRange( + start: number, + end: number + ): boolean; + + /** + * @see _.inRange + */ + inRange(end: number): boolean; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.inRange + */ + inRange( + start: number, + end: number + ): LoDashExplicitWrapper<boolean>; + + /** + * @see _.inRange + */ + inRange(end: number): LoDashExplicitWrapper<boolean>; + } + + //_.random + interface LoDashStatic { + /** + * Produces a random number between min and max (inclusive). If only one argument is provided a number between + * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point + * number is returned instead of an integer. + * + * @param min The minimum possible value. + * @param max The maximum possible value. + * @param floating Specify returning a floating-point number. + * @return Returns the random number. + */ + random( + min?: number, + max?: number, + floating?: boolean + ): number; + + /** + * @see _.random + */ + random( + min?: number, + floating?: boolean + ): number; + + /** + * @see _.random + */ + random(floating?: boolean): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.random + */ + random( + max?: number, + floating?: boolean + ): number; + + /** + * @see _.random + */ + random(floating?: boolean): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.random + */ + random( + max?: number, + floating?: boolean + ): LoDashExplicitWrapper<number>; + + /** + * @see _.random + */ + random(floating?: boolean): LoDashExplicitWrapper<number>; + } + + /********** + * Object * + **********/ + + //_.assign + interface LoDashStatic { + /** + * Assigns own enumerable properties of source objects to the destination + * object. Source objects are applied from left to right. Subsequent sources + * overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.c = 3; + * } + * + * function Bar() { + * this.e = 5; + * } + * + * Foo.prototype.d = 4; + * Bar.prototype.f = 6; + * + * _.assign({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3, 'e': 5 } + */ + assign<TObject extends {}, TSource extends {}, TResult extends {}>( + object: TObject, + source: TSource + ): TResult; + + /** + * @see assign + */ + assign<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TResult; + + /** + * @see assign + */ + assign<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TResult; + + /** + * @see assign + */ + assign<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, + TResult extends {}> + ( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TResult; + + /** + * @see _.assign + */ + assign<TObject extends {}>(object: TObject): TObject; + + /** + * @see _.assign + */ + assign<TObject extends {}, TResult extends {}>( + object: TObject, ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.assign + */ + assign<TSource extends {}, TResult extends {}>( + source: TSource + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assign + */ + assign<TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assign + */ + assign<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assign + */ + assign<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.assign + */ + assign(): LoDashImplicitObjectWrapper<T>; + + /** + * @see _.assign + */ + assign<TResult extends {}>(...otherArgs: any[]): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.assign + */ + assign<TSource extends {}, TResult extends {}>( + source: TSource + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assign + */ + assign<TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assign + */ + assign<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assign + */ + assign<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.assign + */ + assign(): LoDashExplicitObjectWrapper<T>; + + /** + * @see _.assign + */ + assign<TResult extends {}>(...otherArgs: any[]): LoDashExplicitObjectWrapper<TResult>; + } + + //_.assignWith + interface AssignCustomizer { + (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any; + } + + interface LoDashStatic { + /** + * This method is like `_.assign` except that it accepts `customizer` which + * is invoked to produce the assigned values. If `customizer` returns `undefined` + * assignment is handled by the method instead. The `customizer` is invoked + * with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + assignWith<TObject extends {}, TSource extends {}, TResult extends {}>( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TResult; + + /** + * @see assignWith + */ + assignWith<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TResult; + + /** + * @see assignWith + */ + assignWith<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TResult; + + /** + * @see assignWith + */ + assignWith<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, + TResult extends {}> + ( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TResult; + + /** + * @see _.assignWith + */ + assignWith<TObject extends {}>(object: TObject): TObject; + + /** + * @see _.assignWith + */ + assignWith<TObject extends {}, TResult extends {}>( + object: TObject, ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.assignWith + */ + assignWith<TSource extends {}, TResult extends {}>( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assignWith + */ + assignWith<TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assignWith + */ + assignWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assignWith + */ + assignWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.assignWith + */ + assignWith(): LoDashImplicitObjectWrapper<T>; + + /** + * @see _.assignWith + */ + assignWith<TResult extends {}>(...otherArgs: any[]): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.assignWith + */ + assignWith<TSource extends {}, TResult extends {}>( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assignWith + */ + assignWith<TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assignWith + */ + assignWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assignWith + */ + assignWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.assignWith + */ + assignWith(): LoDashExplicitObjectWrapper<T>; + + /** + * @see _.assignWith + */ + assignWith<TResult extends {}>(...otherArgs: any[]): LoDashExplicitObjectWrapper<TResult>; + } + + //_.assignIn + interface LoDashStatic { + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * function Bar() { + * this.d = 4; + * } + * + * Foo.prototype.c = 3; + * Bar.prototype.e = 5; + * + * _.assignIn({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } + */ + assignIn<TObject extends {}, TSource extends {}, TResult extends {}>( + object: TObject, + source: TSource + ): TResult; + + /** + * @see assignIn + */ + assignIn<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TResult; + + /** + * @see assignIn + */ + assignIn<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TResult; + + /** + * @see assignIn + */ + assignIn<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, + TResult extends {}> + ( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TResult; + + /** + * @see _.assignIn + */ + assignIn<TObject extends {}>(object: TObject): TObject; + + /** + * @see _.assignIn + */ + assignIn<TObject extends {}, TResult extends {}>( + object: TObject, ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.assignIn + */ + assignIn<TSource extends {}, TResult extends {}>( + source: TSource + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assignIn + */ + assignIn<TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assignIn + */ + assignIn<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assignIn + */ + assignIn<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.assignIn + */ + assignIn(): LoDashImplicitObjectWrapper<T>; + + /** + * @see _.assignIn + */ + assignIn<TResult extends {}>(...otherArgs: any[]): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.assignIn + */ + assignIn<TSource extends {}, TResult extends {}>( + source: TSource + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assignIn + */ + assignIn<TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assignIn + */ + assignIn<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assignIn + */ + assignIn<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.assignIn + */ + assignIn(): LoDashExplicitObjectWrapper<T>; + + /** + * @see _.assignIn + */ + assignIn<TResult extends {}>(...otherArgs: any[]): LoDashExplicitObjectWrapper<TResult>; + } + + //_.assignInWith + interface AssignCustomizer { + (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any; + } + + interface LoDashStatic { + /** + * This method is like `_.assignIn` except that it accepts `customizer` which + * is invoked to produce the assigned values. If `customizer` returns `undefined` + * assignment is handled by the method instead. The `customizer` is invoked + * with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + assignInWith<TObject extends {}, TSource extends {}, TResult extends {}>( + object: TObject, + source: TSource, + customizer: AssignCustomizer + ): TResult; + + /** + * @see assignInWith + */ + assignInWith<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): TResult; + + /** + * @see assignInWith + */ + assignInWith<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): TResult; + + /** + * @see assignInWith + */ + assignInWith<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, + TResult extends {}> + ( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): TResult; + + /** + * @see _.assignInWith + */ + assignInWith<TObject extends {}>(object: TObject): TObject; + + /** + * @see _.assignInWith + */ + assignInWith<TObject extends {}, TResult extends {}>( + object: TObject, ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.assignInWith + */ + assignInWith<TSource extends {}, TResult extends {}>( + source: TSource, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assignInWith + */ + assignInWith<TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assignInWith + */ + assignInWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assignInWith + */ + assignInWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.assignInWith + */ + assignInWith(): LoDashImplicitObjectWrapper<T>; + + /** + * @see _.assignInWith + */ + assignInWith<TResult extends {}>(...otherArgs: any[]): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.assignInWith + */ + assignInWith<TSource extends {}, TResult extends {}>( + source: TSource, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assignInWith + */ + assignInWith<TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assignInWith + */ + assignInWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assignInWith + */ + assignInWith<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: AssignCustomizer + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.assignInWith + */ + assignInWith(): LoDashExplicitObjectWrapper<T>; + + /** + * @see _.assignInWith + */ + assignInWith<TResult extends {}>(...otherArgs: any[]): LoDashExplicitObjectWrapper<TResult>; + } + + //_.create + interface LoDashStatic { + /** + * Creates an object that inherits from the given prototype object. If a properties object is provided its own + * enumerable properties are assigned to the created object. + * + * @param prototype The object to inherit from. + * @param properties The properties to assign to the object. + * @return Returns the new object. + */ + create<T extends Object, U extends Object>( + prototype: T, + properties?: U + ): T & U; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.create + */ + create<U extends Object>(properties?: U): LoDashImplicitObjectWrapper<T & U>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.create + */ + create<U extends Object>(properties?: U): LoDashExplicitObjectWrapper<T & U>; + } + + //_.defaults + interface LoDashStatic { + /** + * Assigns own enumerable properties of source object(s) to the destination object for all destination + * properties that resolve to undefined. Once a property is set, additional values of the same property are + * ignored. + * + * Note: This method mutates object. + * + * @param object The destination object. + * @param sources The source objects. + * @return The destination object. + */ + defaults<Obj extends {}, TResult extends {}>( + object: Obj, + ...sources: {}[] + ): TResult; + + /** + * @see _.defaults + */ + defaults<Obj extends {}, S1 extends {}, TResult extends {}>( + object: Obj, + source1: S1, + ...sources: {}[] + ): TResult; + + /** + * @see _.defaults + */ + defaults<Obj extends {}, S1 extends {}, S2 extends {}, TResult extends {}>( + object: Obj, + source1: S1, + source2: S2, + ...sources: {}[] + ): TResult; + + /** + * @see _.defaults + */ + defaults<Obj extends {}, S1 extends {}, S2 extends {}, S3 extends {}, TResult extends {}>( + object: Obj, + source1: S1, + source2: S2, + source3: S3, + ...sources: {}[] + ): TResult; + + /** + * @see _.defaults + */ + defaults<Obj extends {}, S1 extends {}, S2 extends {}, S3 extends {}, S4 extends {}, TResult extends {}>( + object: Obj, + source1: S1, + source2: S2, + source3: S3, + source4: S4, + ...sources: {}[] + ): TResult; + + /** + * @see _.defaults + */ + defaults<TResult extends {}>( + object: {}, + ...sources: {}[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.defaults + */ + defaults<S1 extends {}, TResult extends {}>( + source1: S1, + ...sources: {}[] + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.defaults + */ + defaults<S1 extends {}, S2 extends {}, TResult extends {}>( + source1: S1, + source2: S2, + ...sources: {}[] + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.defaults + */ + defaults<S1 extends {}, S2 extends {}, S3 extends {}, TResult extends {}>( + source1: S1, + source2: S2, + source3: S3, + ...sources: {}[] + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.defaults + */ + defaults<S1 extends {}, S2 extends {}, S3 extends {}, S4 extends {}, TResult extends {}>( + source1: S1, + source2: S2, + source3: S3, + source4: S4, + ...sources: {}[] + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.defaults + */ + defaults(): LoDashImplicitObjectWrapper<T>; + + /** + * @see _.defaults + */ + defaults<TResult>(...sources: {}[]): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.defaults + */ + defaults<S1 extends {}, TResult extends {}>( + source1: S1, + ...sources: {}[] + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.defaults + */ + defaults<S1 extends {}, S2 extends {}, TResult extends {}>( + source1: S1, + source2: S2, + ...sources: {}[] + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.defaults + */ + defaults<S1 extends {}, S2 extends {}, S3 extends {}, TResult extends {}>( + source1: S1, + source2: S2, + source3: S3, + ...sources: {}[] + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.defaults + */ + defaults<S1 extends {}, S2 extends {}, S3 extends {}, S4 extends {}, TResult extends {}>( + source1: S1, + source2: S2, + source3: S3, + source4: S4, + ...sources: {}[] + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.defaults + */ + defaults(): LoDashExplicitObjectWrapper<T>; + + /** + * @see _.defaults + */ + defaults<TResult>(...sources: {}[]): LoDashExplicitObjectWrapper<TResult>; + } + + //_.defaultsDeep + interface LoDashStatic { + /** + * This method is like _.defaults except that it recursively assigns default properties. + * @param object The destination object. + * @param sources The source objects. + * @return Returns object. + **/ + defaultsDeep<T, TResult>( + object: T, + ...sources: any[]): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.defaultsDeep + **/ + defaultsDeep<TResult>(...sources: any[]): LoDashImplicitObjectWrapper<TResult> + } + + //_.extend + interface LoDashStatic { + /** + * @see assign + */ + extend<TObject extends {}, TSource extends {}, TResult extends {}>( + object: TObject, + source: TSource, + customizer?: AssignCustomizer, + thisArg?: any + ): TResult; + + /** + * @see assign + */ + extend<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer?: AssignCustomizer, + thisArg?: any + ): TResult; + + /** + * @see assign + */ + extend<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer?: AssignCustomizer, + thisArg?: any + ): TResult; + + /** + * @see assign + */ + extend<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, + TResult extends {}> + ( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer?: AssignCustomizer, + thisArg?: any + ): TResult; + + /** + * @see _.assign + */ + extend<TObject extends {}>(object: TObject): TObject; + + /** + * @see _.assign + */ + extend<TObject extends {}, TResult extends {}>( + object: TObject, ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.assign + */ + extend<TSource extends {}, TResult extends {}>( + source: TSource, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assign + */ + extend<TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assign + */ + extend<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see assign + */ + extend<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.assign + */ + extend(): LoDashImplicitObjectWrapper<T>; + + /** + * @see _.assign + */ + extend<TResult extends {}>(...otherArgs: any[]): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.assign + */ + extend<TSource extends {}, TResult extends {}>( + source: TSource, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assign + */ + extend<TSource1 extends {}, TSource2 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assign + */ + extend<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see assign + */ + extend<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer?: AssignCustomizer, + thisArg?: any + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.assign + */ + extend(): LoDashExplicitObjectWrapper<T>; + + /** + * @see _.assign + */ + extend<TResult extends {}>(...otherArgs: any[]): LoDashExplicitObjectWrapper<TResult>; + } + + //_.findKey + interface LoDashStatic { + /** + * This method is like _.find except that it returns the key of the first element predicate returns truthy for + * instead of the element itself. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param object The object to search. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the key of the matched element, else undefined. + */ + findKey<TValues, TObject>( + object: TObject, + predicate?: DictionaryIterator<TValues, boolean>, + thisArg?: any + ): string; + + /** + * @see _.findKey + */ + findKey<TObject>( + object: TObject, + predicate?: ObjectIterator<any, boolean>, + thisArg?: any + ): string; + + /** + * @see _.findKey + */ + findKey<TObject>( + object: TObject, + predicate?: string, + thisArg?: any + ): string; + + /** + * @see _.findKey + */ + findKey<TWhere extends Dictionary<any>, TObject>( + object: TObject, + predicate?: TWhere + ): string; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.findKey + */ + findKey<TValues>( + predicate?: DictionaryIterator<TValues, boolean>, + thisArg?: any + ): string; + + /** + * @see _.findKey + */ + findKey( + predicate?: ObjectIterator<any, boolean>, + thisArg?: any + ): string; + + /** + * @see _.findKey + */ + findKey( + predicate?: string, + thisArg?: any + ): string; + + /** + * @see _.findKey + */ + findKey<TWhere extends Dictionary<any>>( + predicate?: TWhere + ): string; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.findKey + */ + findKey<TValues>( + predicate?: DictionaryIterator<TValues, boolean>, + thisArg?: any + ): LoDashExplicitWrapper<string>; + + /** + * @see _.findKey + */ + findKey( + predicate?: ObjectIterator<any, boolean>, + thisArg?: any + ): LoDashExplicitWrapper<string>; + + /** + * @see _.findKey + */ + findKey( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper<string>; + + /** + * @see _.findKey + */ + findKey<TWhere extends Dictionary<any>>( + predicate?: TWhere + ): LoDashExplicitWrapper<string>; + } + + //_.findLastKey + interface LoDashStatic { + /** + * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. + * + * If a property name is provided for predicate the created _.property style callback returns the property + * value of the given element. + * + * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for + * elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns true for elements that + * have the properties of the given object, else false. + * + * @param object The object to search. + * @param predicate The function invoked per iteration. + * @param thisArg The this binding of predicate. + * @return Returns the key of the matched element, else undefined. + */ + findLastKey<TValues, TObject>( + object: TObject, + predicate?: DictionaryIterator<TValues, boolean>, + thisArg?: any + ): string; + + /** + * @see _.findLastKey + */ + findLastKey<TObject>( + object: TObject, + predicate?: ObjectIterator<any, boolean>, + thisArg?: any + ): string; + + /** + * @see _.findLastKey + */ + findLastKey<TObject>( + object: TObject, + predicate?: string, + thisArg?: any + ): string; + + /** + * @see _.findLastKey + */ + findLastKey<TWhere extends Dictionary<any>, TObject>( + object: TObject, + predicate?: TWhere + ): string; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.findLastKey + */ + findLastKey<TValues>( + predicate?: DictionaryIterator<TValues, boolean>, + thisArg?: any + ): string; + + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: ObjectIterator<any, boolean>, + thisArg?: any + ): string; + + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: string, + thisArg?: any + ): string; + + /** + * @see _.findLastKey + */ + findLastKey<TWhere extends Dictionary<any>>( + predicate?: TWhere + ): string; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.findLastKey + */ + findLastKey<TValues>( + predicate?: DictionaryIterator<TValues, boolean>, + thisArg?: any + ): LoDashExplicitWrapper<string>; + + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: ObjectIterator<any, boolean>, + thisArg?: any + ): LoDashExplicitWrapper<string>; + + /** + * @see _.findLastKey + */ + findLastKey( + predicate?: string, + thisArg?: any + ): LoDashExplicitWrapper<string>; + + /** + * @see _.findLastKey + */ + findLastKey<TWhere extends Dictionary<any>>( + predicate?: TWhere + ): LoDashExplicitWrapper<string>; + } + + //_.forIn + interface LoDashStatic { + /** + * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The + * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may + * exit iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forIn<T>( + object: Dictionary<T>, + iteratee?: DictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.forIn + */ + forIn<T extends {}>( + object: T, + iteratee?: ObjectIterator<any, any>, + thisArg?: any + ): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.forIn + */ + forIn<TValue>( + iteratee?: DictionaryIterator<TValue, any>, + thisArg?: any + ): _.LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.forIn + */ + forIn<TValue>( + iteratee?: DictionaryIterator<TValue, any>, + thisArg?: any + ): _.LoDashExplicitObjectWrapper<T>; + } + + //_.forInRight + interface LoDashStatic { + /** + * This method is like _.forIn except that it iterates over properties of object in the opposite order. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forInRight<T>( + object: Dictionary<T>, + iteratee?: DictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.forInRight + */ + forInRight<T extends {}>( + object: T, + iteratee?: ObjectIterator<any, any>, + thisArg?: any + ): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.forInRight + */ + forInRight<TValue>( + iteratee?: DictionaryIterator<TValue, any>, + thisArg?: any + ): _.LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.forInRight + */ + forInRight<TValue>( + iteratee?: DictionaryIterator<TValue, any>, + thisArg?: any + ): _.LoDashExplicitObjectWrapper<T>; + } + + //_.forOwn + interface LoDashStatic { + /** + * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is + * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forOwn<T>( + object: Dictionary<T>, + iteratee?: DictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.forOwn + */ + forOwn<T extends {}>( + object: T, + iteratee?: ObjectIterator<any, any>, + thisArg?: any + ): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.forOwn + */ + forOwn<TValue>( + iteratee?: DictionaryIterator<TValue, any>, + thisArg?: any + ): _.LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.forOwn + */ + forOwn<TValue>( + iteratee?: DictionaryIterator<TValue, any>, + thisArg?: any + ): _.LoDashExplicitObjectWrapper<T>; + } + + //_.forOwnRight + interface LoDashStatic { + /** + * This method is like _.forOwn except that it iterates over properties of object in the opposite order. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns object. + */ + forOwnRight<T>( + object: Dictionary<T>, + iteratee?: DictionaryIterator<T, any>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.forOwnRight + */ + forOwnRight<T extends {}>( + object: T, + iteratee?: ObjectIterator<any, any>, + thisArg?: any + ): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.forOwnRight + */ + forOwnRight<TValue>( + iteratee?: DictionaryIterator<TValue, any>, + thisArg?: any + ): _.LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.forOwnRight + */ + forOwnRight<TValue>( + iteratee?: DictionaryIterator<TValue, any>, + thisArg?: any + ): _.LoDashExplicitObjectWrapper<T>; + } + + //_.functions + interface LoDashStatic { + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + functions<T extends {}>(object: any): string[]; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.functions + */ + functions(): _.LoDashImplicitArrayWrapper<string>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.functions + */ + functions(): _.LoDashExplicitArrayWrapper<string>; + } + + //_.functionsIn + interface LoDashStatic { + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + functionsIn<T extends {}>(object: any): string[]; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.functionsIn + */ + functionsIn(): _.LoDashImplicitArrayWrapper<string>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.functionsIn + */ + functionsIn(): _.LoDashExplicitArrayWrapper<string>; + } + + //_.get + interface LoDashStatic { + /** + * Gets the property value at path of object. If the resolved + * value is undefined the defaultValue is used in its place. + * @param object The object to query. + * @param path The path of the property to get. + * @param defaultValue The value returned if the resolved value is undefined. + * @return Returns the resolved value. + **/ + get<TResult>(object: Object, + path: string|number|boolean|Array<string|number|boolean>, + defaultValue?:TResult + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.get + **/ + get<TResult>(path: string|number|boolean|Array<string|number|boolean>, + defaultValue?: TResult + ): TResult; + } + + //_.has + interface LoDashStatic { + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': { 'c': 3 } } }; + * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b.c'); + * // => true + * + * _.has(object, ['a', 'b', 'c']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + has<T extends {}>( + object: T, + path: StringRepresentable|StringRepresentable[] + ): boolean; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.has + */ + has(path: StringRepresentable|StringRepresentable[]): boolean; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.has + */ + has(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper<boolean>; + } + + //_.hasIn + interface LoDashStatic { + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b.c'); + * // => true + * + * _.hasIn(object, ['a', 'b', 'c']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + hasIn<T extends {}>( + object: T, + path: StringRepresentable|StringRepresentable[] + ): boolean; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.hasIn + */ + hasIn(path: StringRepresentable|StringRepresentable[]): boolean; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.hasIn + */ + hasIn(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper<boolean>; + } + + //_.invert + interface LoDashStatic { + /** + * Creates an object composed of the inverted keys and values of object. If object contains duplicate values, + * subsequent values overwrite property assignments of previous values unless multiValue is true. + * + * @param object The object to invert. + * @param multiValue Allow multiple values per key. + * @return Returns the new inverted object. + */ + invert<T extends {}, TResult extends {}>( + object: T, + multiValue?: boolean + ): TResult; + + /** + * @see _.invert + */ + invert<TResult extends {}>( + object: Object, + multiValue?: boolean + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.invert + */ + invert<TResult extends {}>(multiValue?: boolean): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.invert + */ + invert<TResult extends {}>(multiValue?: boolean): LoDashExplicitObjectWrapper<TResult>; + } + + //_.keys + interface LoDashStatic { + /** + * Creates an array of the own enumerable property names of object. + * + * Note: Non-object values are coerced to objects. See the ES spec for more details. + * + * @param object The object to query. + * @return Returns the array of property names. + */ + keys(object?: any): string[]; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.keys + */ + keys(): LoDashImplicitArrayWrapper<string>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.keys + */ + keys(): LoDashExplicitArrayWrapper<string>; + } + + //_.keysIn + interface LoDashStatic { + /** + * Creates an array of the own and inherited enumerable property names of object. + * + * Note: Non-object values are coerced to objects. + * + * @param object The object to query. + * @return An array of property names. + */ + keysIn(object?: any): string[]; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.keysIn + */ + keysIn(): LoDashImplicitArrayWrapper<string>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.keysIn + */ + keysIn(): LoDashExplicitArrayWrapper<string>; + } + + //_.mapKeys + interface LoDashStatic { + /** + * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated + * by running each own enumerable property of object through iteratee. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the new mapped object. + */ + mapKeys<T, TKey>( + object: List<T>, + iteratee?: ListIterator<T, TKey>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.mapKeys + */ + mapKeys<T, TKey>( + object: Dictionary<T>, + iteratee?: DictionaryIterator<T, TKey>, + thisArg?: any + ): Dictionary<T>; + + /** + * @see _.mapKeys + */ + mapKeys<T, TObject extends {}>( + object: List<T>|Dictionary<T>, + iteratee?: TObject + ): Dictionary<T>; + + /** + * @see _.mapKeys + */ + mapKeys<T>( + object: List<T>|Dictionary<T>, + iteratee?: string, + thisArg?: any + ): Dictionary<T>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.mapKeys + */ + mapKeys<TKey>( + iteratee?: ListIterator<T, TKey>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.mapKeys + */ + mapKeys<TObject extends {}>( + iteratee?: TObject + ): LoDashImplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: string, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<T>>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.mapKeys + */ + mapKeys<TResult, TKey>( + iteratee?: ListIterator<TResult, TKey>|DictionaryIterator<TResult, TKey>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<TResult>>; + + /** + * @see _.mapKeys + */ + mapKeys<TResult, TObject extends {}>( + iteratee?: TObject + ): LoDashImplicitObjectWrapper<Dictionary<TResult>>; + + /** + * @see _.mapKeys + */ + mapKeys<TResult>( + iteratee?: string, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<TResult>>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.mapKeys + */ + mapKeys<TKey>( + iteratee?: ListIterator<T, TKey>, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.mapKeys + */ + mapKeys<TObject extends {}>( + iteratee?: TObject + ): LoDashExplicitObjectWrapper<Dictionary<T>>; + + /** + * @see _.mapKeys + */ + mapKeys( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<T>>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.mapKeys + */ + mapKeys<TResult, TKey>( + iteratee?: ListIterator<TResult, TKey>|DictionaryIterator<TResult, TKey>, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<TResult>>; + + /** + * @see _.mapKeys + */ + mapKeys<TResult, TObject extends {}>( + iteratee?: TObject + ): LoDashExplicitObjectWrapper<Dictionary<TResult>>; + + /** + * @see _.mapKeys + */ + mapKeys<TResult>( + iteratee?: string, + thisArg?: any + ): LoDashExplicitObjectWrapper<Dictionary<TResult>>; + } + + //_.mapValues + interface LoDashStatic { + /** + * Creates an object with the same keys as object and values generated by running each own + * enumerable property of object through iteratee. The iteratee function is bound to thisArg + * and invoked with three arguments: (value, key, object). + * + * If a property name is provided iteratee the created "_.property" style callback returns + * the property value of the given element. + * + * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns + * true for elements that have a matching property value, else false;. + * + * If an object is provided for iteratee the created "_.matches" style callback returns true + * for elements that have the properties of the given object, else false. + * + * @param {Object} object The object to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. + * @param {Object} [thisArg] The `this` binding of `iteratee`. + * @return {Object} Returns the new mapped object. + */ + mapValues<T, TResult>(obj: Dictionary<T>, callback: ObjectIterator<T, TResult>, thisArg?: any): Dictionary<TResult>; + mapValues<T>(obj: Dictionary<T>, where: Dictionary<T>): Dictionary<boolean>; + mapValues<T, TMapped>(obj: T, pluck: string): TMapped; + mapValues<T>(obj: T, callback: ObjectIterator<any, any>, thisArg?: any): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.mapValues + * TValue is the type of the property values of T. + * TResult is the type output by the ObjectIterator function + */ + mapValues<TValue, TResult>(callback: ObjectIterator<TValue, TResult>, thisArg?: any): LoDashImplicitObjectWrapper<Dictionary<TResult>>; + + /** + * @see _.mapValues + * TResult is the type of the property specified by pluck. + * T should be a Dictionary<Dictionary<TResult>> + */ + mapValues<TResult>(pluck: string): LoDashImplicitObjectWrapper<Dictionary<TResult>>; + + /** + * @see _.mapValues + * TResult is the type of the properties on the object specified by pluck. + * T should be a Dictionary<Dictionary<Dictionary<TResult>>> + */ + mapValues<TResult>(pluck: string, where: Dictionary<TResult>): LoDashImplicitArrayWrapper<Dictionary<boolean>>; + + /** + * @see _.mapValues + * TResult is the type of the properties of each object in the values of T + * T should be a Dictionary<Dictionary<TResult>> + */ + mapValues<TResult>(where: Dictionary<TResult>): LoDashImplicitArrayWrapper<boolean>; + } + + //_.merge + interface LoDashStatic { + /** + * Recursively merges own and inherited enumerable properties of source + * objects into the destination object, skipping source properties that resolve + * to `undefined`. Array and plain object properties are merged recursively. + * Other objects and value types are overridden by assignment. Source objects + * are applied from left to right. Subsequent sources overwrite property + * assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var users = { + * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] + * }; + * + * var ages = { + * 'data': [{ 'age': 36 }, { 'age': 40 }] + * }; + * + * _.merge(users, ages); + * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } + */ + merge<TObject, TSource>( + object: TObject, + source: TSource + ): TObject & TSource; + + /** + * @see _.merge + */ + merge<TObject, TSource1, TSource2>( + object: TObject, + source1: TSource1, + source2: TSource2 + ): TObject & TSource1 & TSource2; + + /** + * @see _.merge + */ + merge<TObject, TSource1, TSource2, TSource3>( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.merge + */ + merge<TObject, TSource1, TSource2, TSource3, TSource4>( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.merge + */ + merge<TResult>( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.merge + */ + merge<TSource>( + source: TSource + ): LoDashImplicitObjectWrapper<T & TSource>; + + /** + * @see _.merge + */ + merge<TSource1, TSource2>( + source1: TSource1, + source2: TSource2 + ): LoDashImplicitObjectWrapper<T & TSource1 & TSource2>; + + /** + * @see _.merge + */ + merge<TSource1, TSource2, TSource3>( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashImplicitObjectWrapper<T & TSource1 & TSource2 & TSource3>; + + /** + * @see _.merge + */ + merge<TSource1, TSource2, TSource3, TSource4>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashImplicitObjectWrapper<T & TSource1 & TSource2 & TSource3 & TSource4>; + + /** + * @see _.merge + */ + merge<TResult>( + ...otherArgs: any[] + ): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.merge + */ + merge<TSource>( + source: TSource + ): LoDashExplicitObjectWrapper<T & TSource>; + + /** + * @see _.merge + */ + merge<TSource1, TSource2>( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitObjectWrapper<T & TSource1 & TSource2>; + + /** + * @see _.merge + */ + merge<TSource1, TSource2, TSource3>( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitObjectWrapper<T & TSource1 & TSource2 & TSource3>; + + /** + * @see _.merge + */ + merge<TSource1, TSource2, TSource3, TSource4>( + ): LoDashExplicitObjectWrapper<T & TSource1 & TSource2 & TSource3 & TSource4>; + + /** + * @see _.merge + */ + merge<TResult>( + ...otherArgs: any[] + ): LoDashExplicitObjectWrapper<TResult>; + } + + //_.mergeWith + interface MergeWithCustomizer { + (value: any, srcValue: any, key?: string, object?: Object, source?: Object): any; + } + + interface LoDashStatic { + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined` merging is handled by the + * method instead. The `customizer` is invoked with seven arguments: + * (objValue, srcValue, key, object, source, stack). + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var other = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.merge(object, other, customizer); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } + */ + mergeWith<TObject, TSource>( + object: TObject, + source: TSource, + customizer: MergeWithCustomizer + ): TObject & TSource; + + /** + * @see _.mergeWith + */ + mergeWith<TObject, TSource1, TSource2>( + object: TObject, + source1: TSource1, + source2: TSource2, + customizer: MergeWithCustomizer + ): TObject & TSource1 & TSource2; + + /** + * @see _.mergeWith + */ + mergeWith<TObject, TSource1, TSource2, TSource3>( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: MergeWithCustomizer + ): TObject & TSource1 & TSource2 & TSource3; + + /** + * @see _.mergeWith + */ + mergeWith<TObject, TSource1, TSource2, TSource3, TSource4>( + object: TObject, + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: MergeWithCustomizer + ): TObject & TSource1 & TSource2 & TSource3 & TSource4; + + /** + * @see _.mergeWith + */ + mergeWith<TResult>( + object: any, + ...otherArgs: any[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.mergeWith + */ + mergeWith<TSource>( + source: TSource, + customizer: MergeWithCustomizer + ): LoDashImplicitObjectWrapper<T & TSource>; + + /** + * @see _.mergeWith + */ + mergeWith<TSource1, TSource2>( + source1: TSource1, + source2: TSource2, + customizer: MergeWithCustomizer + ): LoDashImplicitObjectWrapper<T & TSource1 & TSource2>; + + /** + * @see _.mergeWith + */ + mergeWith<TSource1, TSource2, TSource3>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: MergeWithCustomizer + ): LoDashImplicitObjectWrapper<T & TSource1 & TSource2 & TSource3>; + + /** + * @see _.mergeWith + */ + mergeWith<TSource1, TSource2, TSource3, TSource4>( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: MergeWithCustomizer + ): LoDashImplicitObjectWrapper<T & TSource1 & TSource2 & TSource3 & TSource4>; + + /** + * @see _.mergeWith + */ + mergeWith<TResult>( + ...otherArgs: any[] + ): LoDashImplicitObjectWrapper<TResult>; + } + + //_.omit + interface LoDashStatic { + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable properties of `object` that are not omitted. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [props] The property names to omit, specified + * individually or in arrays.. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + + omit<TResult extends {}, T extends {}>( + object: T, + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + + /** + * @see _.omit + */ + omit<TResult extends {}>( + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + + /** + * @see _.omit + */ + omit<TResult extends {}>( + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): LoDashExplicitObjectWrapper<TResult>; + } + + //_.omitBy + interface LoDashStatic { + /** + * The opposite of `_.pickBy`; this method creates an object composed of the + * own and inherited enumerable properties of `object` that `predicate` + * doesn't return truthy for. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + omitBy<TResult extends {}, T extends {}>( + object: T, + predicate: ObjectIterator<any, boolean> + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.omitBy + */ + omitBy<TResult extends {}>( + predicate: ObjectIterator<any, boolean> + ): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.omitBy + */ + omitBy<TResult extends {}>( + predicate: ObjectIterator<any, boolean> + ): LoDashExplicitObjectWrapper<TResult>; + } + + //_.toPairs + interface LoDashStatic { + /** + * Creates a two dimensional array of the key-value pairs for object, e.g. [[key1, value1], [key2, value2]]. + * + * @param object The object to query. + * @return Returns the new array of key-value pairs. + */ + toPairs<T extends {}>(object?: T): any[][]; + + toPairs<T extends {}, TResult>(object?: T): TResult[][]; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.toPairs + */ + toPairs<TResult>(): LoDashImplicitArrayWrapper<TResult[]>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.toPairs + */ + toPairs<TResult>(): LoDashExplicitArrayWrapper<TResult[]>; + } + + //_.pick + interface LoDashStatic { + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [props] The property names to pick, specified + * individually or in arrays. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + pick<TResult extends {}, T extends {}>( + object: T, + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.pick + */ + pick<TResult extends {}>( + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.pick + */ + pick<TResult extends {}>( + ...predicate: (StringRepresentable|StringRepresentable[])[] + ): LoDashExplicitObjectWrapper<TResult>; + } + + //_.pickBy + interface LoDashStatic { + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + pickBy<TResult extends {}, T extends {}>( + object: T, + predicate: ObjectIterator<any, boolean> + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.pickBy + */ + pickBy<TResult extends {}>( + predicate: ObjectIterator<any, boolean> + ): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.pickBy + */ + pickBy<TResult extends {}>( + predicate: ObjectIterator<any, boolean> + ): LoDashExplicitObjectWrapper<TResult>; + } + + //_.result + interface LoDashStatic { + /** + * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding + * of its parent object and its result is returned. + * + * @param object The object to query. + * @param path The path of the property to resolve. + * @param defaultValue The value returned if the resolved value is undefined. + * @return Returns the resolved value. + */ + result<TObject, TResult>( + object: TObject, + path: number|string|boolean|Array<number|string|boolean>, + defaultValue?: TResult + ): TResult; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.result + */ + result<TResult>( + path: number|string|boolean|Array<number|string|boolean>, + defaultValue?: TResult + ): TResult; + } + + //_.set + interface LoDashStatic { + /** + * Sets the property value of path on object. If a portion of path does not exist it’s created. + * + * @param object The object to augment. + * @param path The path of the property to set. + * @param value The value to set. + * @return Returns object. + */ + set<T>( + object: T, + path: StringRepresentable|StringRepresentable[], + value: any + ): T; + + /** + * @see _.set + */ + set<V, T>( + object: T, + path: StringRepresentable|StringRepresentable[], + value: V + ): T; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.set + */ + set<V>( + path: StringRepresentable|StringRepresentable[], + value: V + ): LoDashImplicitObjectWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.set + */ + set<V>( + path: StringRepresentable|StringRepresentable[], + value: V + ): LoDashExplicitObjectWrapper<T>; + } + + //_.transform + interface LoDashStatic { + /** + * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of + * running each of its own enumerable properties through iteratee, with each invocation potentially mutating + * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, + * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. + * + * @param object The object to iterate over. + * @param iteratee The function invoked per iteration. + * @param accumulator The custom accumulator value. + * @param thisArg The this binding of iteratee. + * @return Returns the accumulated value. + */ + transform<T, TResult>( + object: T[], + iteratee?: MemoVoidArrayIterator<T, TResult[]>, + accumulator?: TResult[], + thisArg?: any + ): TResult[]; + + /** + * @see _.transform + */ + transform<T, TResult>( + object: T[], + iteratee?: MemoVoidArrayIterator<T, Dictionary<TResult>>, + accumulator?: Dictionary<TResult>, + thisArg?: any + ): Dictionary<TResult>; + + /** + * @see _.transform + */ + transform<T, TResult>( + object: Dictionary<T>, + iteratee?: MemoVoidDictionaryIterator<T, Dictionary<TResult>>, + accumulator?: Dictionary<TResult>, + thisArg?: any + ): Dictionary<TResult>; + + /** + * @see _.transform + */ + transform<T, TResult>( + object: Dictionary<T>, + iteratee?: MemoVoidDictionaryIterator<T, TResult[]>, + accumulator?: TResult[], + thisArg?: any + ): TResult[]; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.transform + */ + transform<TResult>( + iteratee?: MemoVoidArrayIterator<T, TResult[]>, + accumulator?: TResult[], + thisArg?: any + ): LoDashImplicitArrayWrapper<TResult>; + + /** + * @see _.transform + */ + transform<TResult>( + iteratee?: MemoVoidArrayIterator<T, Dictionary<TResult>>, + accumulator?: Dictionary<TResult>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<TResult>>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.transform + */ + transform<T, TResult>( + iteratee?: MemoVoidDictionaryIterator<T, Dictionary<TResult>>, + accumulator?: Dictionary<TResult>, + thisArg?: any + ): LoDashImplicitObjectWrapper<Dictionary<TResult>>; + + /** + * @see _.transform + */ + transform<T, TResult>( + iteratee?: MemoVoidDictionaryIterator<T, TResult[]>, + accumulator?: TResult[], + thisArg?: any + ): LoDashImplicitArrayWrapper<TResult>; + } + + //_.values + interface LoDashStatic { + /** + * Creates an array of the own enumerable property values of object. + * + * @param object The object to query. + * @return Returns an array of property values. + */ + values<T>(object?: any): T[]; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.values + */ + values<T>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.values + */ + values<T>(): LoDashExplicitArrayWrapper<T>; + } + + //_.valuesIn + interface LoDashStatic { + /** + * Creates an array of the own and inherited enumerable property values of object. + * + * @param object The object to query. + * @return Returns the array of property values. + */ + valuesIn<T>(object?: any): T[]; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.valuesIn + */ + valuesIn<T>(): LoDashImplicitArrayWrapper<T>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.valuesIn + */ + valuesIn<T>(): LoDashExplicitArrayWrapper<T>; + } + + /********** + * String * + **********/ + + //_.camelCase + interface LoDashStatic { + /** + * Converts string to camel case. + * + * @param string The string to convert. + * @return Returns the camel cased string. + */ + camelCase(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.camelCase + */ + camelCase(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.camelCase + */ + camelCase(): LoDashExplicitWrapper<string>; + } + + //_.capitalize + interface LoDashStatic { + capitalize(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.capitalize + */ + capitalize(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.capitalize + */ + capitalize(): LoDashExplicitWrapper<string>; + } + + //_.deburr + interface LoDashStatic { + /** + * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining + * diacritical marks. + * + * @param string The string to deburr. + * @return Returns the deburred string. + */ + deburr(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.deburr + */ + deburr(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.deburr + */ + deburr(): LoDashExplicitWrapper<string>; + } + + //_.endsWith + interface LoDashStatic { + /** + * Checks if string ends with the given target string. + * + * @param string The string to search. + * @param target The string to search for. + * @param position The position to search from. + * @return Returns true if string ends with target, else false. + */ + endsWith( + string?: string, + target?: string, + position?: number + ): boolean; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.endsWith + */ + endsWith( + target?: string, + position?: number + ): boolean; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.endsWith + */ + endsWith( + target?: string, + position?: number + ): LoDashExplicitWrapper<boolean>; + } + + // _.escape + interface LoDashStatic { + /** + * Converts the characters "&", "<", ">", '"', "'", and "`", in string to their corresponding HTML entities. + * + * Note: No other characters are escaped. To escape additional characters use a third-party library like he. + * + * Though the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML + * and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s + * article (under "semi-related fun fact") for more details. + * + * Backticks are escaped because in Internet Explorer < 9, they can break out of attribute values or HTML + * comments. See #59, #102, #108, and #133 of the HTML5 Security Cheatsheet for more details. + * + * When working with HTML you should always quote attribute values to reduce XSS vectors. + * + * @param string The string to escape. + * @return Returns the escaped string. + */ + escape(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.escape + */ + escape(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.escape + */ + escape(): LoDashExplicitWrapper<string>; + } + + // _.escapeRegExp + interface LoDashStatic { + /** + * Escapes the RegExp special characters "\", "/", "^", "$", ".", "|", "?", "*", "+", "(", ")", "[", "]", + * "{" and "}" in string. + * + * @param string The string to escape. + * @return Returns the escaped string. + */ + escapeRegExp(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.escapeRegExp + */ + escapeRegExp(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.escapeRegExp + */ + escapeRegExp(): LoDashExplicitWrapper<string>; + } + + //_.kebabCase + interface LoDashStatic { + /** + * Converts string to kebab case. + * + * @param string The string to convert. + * @return Returns the kebab cased string. + */ + kebabCase(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.kebabCase + */ + kebabCase(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.kebabCase + */ + kebabCase(): LoDashExplicitWrapper<string>; + } + + //_.lowerCase + interface LoDashStatic { + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + lowerCase(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.lowerCase + */ + lowerCase(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.lowerCase + */ + lowerCase(): LoDashExplicitWrapper<string>; + } + + //_.lowerFirst + interface LoDashStatic { + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + lowerFirst(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.lowerFirst + */ + lowerFirst(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.lowerFirst + */ + lowerFirst(): LoDashExplicitWrapper<string>; + } + + //_.pad + interface LoDashStatic { + /** + * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if + * they can’t be evenly divided by length. + * + * @param string The string to pad. + * @param length The padding length. + * @param chars The string used as padding. + * @return Returns the padded string. + */ + pad( + string?: string, + length?: number, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.pad + */ + pad( + length?: number, + chars?: string + ): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.pad + */ + pad( + length?: number, + chars?: string + ): LoDashExplicitWrapper<string>; + } + + //_.padStart + interface LoDashStatic { + /** + * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed + * length. + * + * @param string The string to pad. + * @param length The padding length. + * @param chars The string used as padding. + * @return Returns the padded string. + */ + padStart( + string?: string, + length?: number, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.padStart + */ + padStart( + length?: number, + chars?: string + ): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.padStart + */ + padStart( + length?: number, + chars?: string + ): LoDashExplicitWrapper<string>; + } + + //_.padEnd + interface LoDashStatic { + /** + * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed + * length. + * + * @param string The string to pad. + * @param length The padding length. + * @param chars The string used as padding. + * @return Returns the padded string. + */ + padEnd( + string?: string, + length?: number, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.padEnd + */ + padEnd( + length?: number, + chars?: string + ): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.padEnd + */ + padEnd( + length?: number, + chars?: string + ): LoDashExplicitWrapper<string>; + } + + //_.parseInt + interface LoDashStatic { + /** + * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used + * unless value is a hexadecimal, in which case a radix of 16 is used. + * + * Note: This method aligns with the ES5 implementation of parseInt. + * + * @param string The string to convert. + * @param radix The radix to interpret value by. + * @return Returns the converted integer. + */ + parseInt( + string: string, + radix?: number + ): number; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.parseInt + */ + parseInt(radix?: number): number; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.parseInt + */ + parseInt(radix?: number): LoDashExplicitWrapper<number>; + } + + //_.repeat + interface LoDashStatic { + /** + * Repeats the given string n times. + * + * @param string The string to repeat. + * @param n The number of times to repeat the string. + * @return Returns the repeated string. + */ + repeat( + string?: string, + n?: number + ): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.repeat + */ + repeat(n?: number): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.repeat + */ + repeat(n?: number): LoDashExplicitWrapper<string>; + } + + //_.snakeCase + interface LoDashStatic { + /** + * Converts string to snake case. + * + * @param string The string to convert. + * @return Returns the snake cased string. + */ + snakeCase(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.snakeCase + */ + snakeCase(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.snakeCase + */ + snakeCase(): LoDashExplicitWrapper<string>; + } + + //_.startCase + interface LoDashStatic { + /** + * Converts string to start case. + * + * @param string The string to convert. + * @return Returns the start cased string. + */ + startCase(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.startCase + */ + startCase(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.startCase + */ + startCase(): LoDashExplicitWrapper<string>; + } + + //_.startsWith + interface LoDashStatic { + /** + * Checks if string starts with the given target string. + * + * @param string The string to search. + * @param target The string to search for. + * @param position The position to search from. + * @return Returns true if string starts with target, else false. + */ + startsWith( + string?: string, + target?: string, + position?: number + ): boolean; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.startsWith + */ + startsWith( + target?: string, + position?: number + ): boolean; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.startsWith + */ + startsWith( + target?: string, + position?: number + ): LoDashExplicitWrapper<boolean>; + } + + //_.template + interface TemplateOptions extends TemplateSettings { + /** + * The sourceURL of the template's compiled source. + */ + sourceURL?: string; + } + + interface TemplateExecutor { + (data?: Object): string; + source: string; + } + + interface LoDashStatic { + /** + * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, + * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" + * delimiters. Data properties may be accessed as free variables in the template. If a setting object is + * provided it takes precedence over _.templateSettings values. + * + * Note: In the development build _.template utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier + * debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @param string The template string. + * @param options The options object. + * @param options.escape The HTML "escape" delimiter. + * @param options.evaluate The "evaluate" delimiter. + * @param options.imports An object to import into the template as free variables. + * @param options.interpolate The "interpolate" delimiter. + * @param options.sourceURL The sourceURL of the template's compiled source. + * @param options.variable The data object variable name. + * @return Returns the compiled template function. + */ + template( + string: string, + options?: TemplateOptions + ): TemplateExecutor; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.template + */ + template(options?: TemplateOptions): TemplateExecutor; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.template + */ + template(options?: TemplateOptions): LoDashExplicitObjectWrapper<TemplateExecutor>; + } + + //_.toLower + interface LoDashStatic { + /** + * Converts `string`, as a whole, to lower case. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.toLower('--Foo-Bar'); + * // => '--foo-bar' + * + * _.toLower('fooBar'); + * // => 'foobar' + * + * _.toLower('__FOO_BAR__'); + * // => '__foo_bar__' + */ + toLower(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.toLower + */ + toLower(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.toLower + */ + toLower(): LoDashExplicitWrapper<string>; + } + + //_.toUpper + interface LoDashStatic { + /** + * Converts `string`, as a whole, to upper case. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the upper cased string. + * @example + * + * _.toUpper('--foo-bar'); + * // => '--FOO-BAR' + * + * _.toUpper('fooBar'); + * // => 'FOOBAR' + * + * _.toUpper('__foo_bar__'); + * // => '__FOO_BAR__' + */ + toUpper(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.toUpper + */ + toUpper(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.toUpper + */ + toUpper(): LoDashExplicitWrapper<string>; + } + + //_.trim + interface LoDashStatic { + /** + * Removes leading and trailing whitespace or specified characters from string. + * + * @param string The string to trim. + * @param chars The characters to trim. + * @return Returns the trimmed string. + */ + trim( + string?: string, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.trim + */ + trim(chars?: string): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.trim + */ + trim(chars?: string): LoDashExplicitWrapper<string>; + } + + //_.trimStart + interface LoDashStatic { + /** + * Removes leading whitespace or specified characters from string. + * + * @param string The string to trim. + * @param chars The characters to trim. + * @return Returns the trimmed string. + */ + trimStart( + string?: string, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.trimStart + */ + trimStart(chars?: string): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.trimStart + */ + trimStart(chars?: string): LoDashExplicitWrapper<string>; + } + + //_.trimEnd + interface LoDashStatic { + /** + * Removes trailing whitespace or specified characters from string. + * + * @param string The string to trim. + * @param chars The characters to trim. + * @return Returns the trimmed string. + */ + trimEnd( + string?: string, + chars?: string + ): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.trimEnd + */ + trimEnd(chars?: string): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.trimEnd + */ + trimEnd(chars?: string): LoDashExplicitWrapper<string>; + } + + //_.truncate + interface TruncateOptions { + /** The maximum string length. */ + length?: number; + /** The string to indicate text is omitted. */ + omission?: string; + /** The separator pattern to truncate to. */ + separator?: string|RegExp; + } + + interface LoDashStatic { + /** + * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated + * string are replaced with the omission string which defaults to "…". + * + * @param string The string to truncate. + * @param options The options object or maximum string length. + * @return Returns the truncated string. + */ + truncate( + string?: string, + options?: TruncateOptions|number + ): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.truncate + */ + truncate(options?: TruncateOptions|number): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.truncate + */ + truncate(options?: TruncateOptions|number): LoDashExplicitWrapper<string>; + } + + //_.upperCase + interface LoDashStatic { + /** + * Converts `string`, as space separated words, to upper case. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the upper cased string. + * @example + * + * _.upperCase('--foo-bar'); + * // => 'FOO BAR' + * + * _.upperCase('fooBar'); + * // => 'FOO BAR' + * + * _.upperCase('__foo_bar__'); + * // => 'FOO BAR' + */ + upperCase(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.upperCase + */ + upperCase(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.upperCase + */ + upperCase(): LoDashExplicitWrapper<string>; + } + + //_.upperFirst + interface LoDashStatic { + /** + * Converts the first character of `string` to upper case. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.upperFirst('fred'); + * // => 'Fred' + * + * _.upperFirst('FRED'); + * // => 'FRED' + */ + upperFirst(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.upperFirst + */ + upperFirst(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.upperFirst + */ + upperFirst(): LoDashExplicitWrapper<string>; + } + + //_.unescape + interface LoDashStatic { + /** + * The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and ` + * in string to their corresponding characters. + * + * @param string The string to unescape. + * @return Returns the unescaped string. + */ + unescape(string?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.unescape + */ + unescape(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.unescape + */ + unescape(): LoDashExplicitWrapper<string>; + } + + //_.words + interface LoDashStatic { + /** + * Splits `string` into an array of its words. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to inspect. + * @param {RegExp|string} [pattern] The pattern to match words. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. + * @returns {Array} Returns the words of `string`. + * @example + * + * _.words('fred, barney, & pebbles'); + * // => ['fred', 'barney', 'pebbles'] + * + * _.words('fred, barney, & pebbles', /[^, ]+/g); + * // => ['fred', 'barney', '&', 'pebbles'] + */ + words( + string?: string, + pattern?: string|RegExp + ): string[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.words + */ + words(pattern?: string|RegExp): string[]; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.words + */ + words(pattern?: string|RegExp): LoDashExplicitArrayWrapper<string>; + } + + /*********** + * Utility * + ***********/ + + //_.attempt + interface LoDashStatic { + /** + * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments + * are provided to func when it’s invoked. + * + * @param func The function to attempt. + * @return Returns the func result or error object. + */ + attempt<TResult>(func: (...args: any[]) => TResult): TResult|Error; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.attempt + */ + attempt<TResult>(): TResult|Error; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.attempt + */ + attempt<TResult>(): LoDashExplicitObjectWrapper<TResult|Error>; + } + + //_.constant + interface LoDashStatic { + /** + * Creates a function that returns value. + * + * @param value The value to return from the new function. + * @return Returns the new function. + */ + constant<T>(value: T): () => T; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.constant + */ + constant<TResult>(): LoDashImplicitObjectWrapper<() => TResult>; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.constant + */ + constant<TResult>(): LoDashExplicitObjectWrapper<() => TResult>; + } + + //_.identity + interface LoDashStatic { + /** + * This method returns the first argument provided to it. + * @param value Any value. + * @return Returns value. + */ + identity<T>(value?: T): T; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.identity + */ + identity(): T; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.identity + */ + identity(): T[]; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.identity + */ + identity(): T; + } + + //_.iteratee + interface LoDashStatic { + /** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name the created callback returns the + * property value for a given element. If `func` is an object the created + * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. + * + * @static + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // create custom iteratee shorthands + * _.iteratee = _.wrap(_.iteratee, function(callback, func) { + * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); + * return !p ? callback(func) : function(object) { + * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); + * }; + * }); + * + * _.filter(users, 'age > 36'); + * // => [{ 'user': 'fred', 'age': 40 }] + */ + iteratee<TResult>( + func: Function, + thisArg?: any + ): (...args: any[]) => TResult; + + /** + * @see _.iteratee + */ + iteratee<TResult>( + func: string, + thisArg?: any + ): (object: any) => TResult; + + /** + * @see _.iteratee + */ + iteratee( + func: Object, + thisArg?: any + ): (object: any) => boolean; + + /** + * @see _.iteratee + */ + iteratee<TResult>(): (value: TResult) => TResult; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.iteratee + */ + iteratee<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => TResult>; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.iteratee + */ + iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => boolean>; + + /** + * @see _.iteratee + */ + iteratee<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.iteratee + */ + iteratee<TResult>(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.iteratee + */ + iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => boolean>; + + /** + * @see _.iteratee + */ + iteratee<TResult>(thisArg?: any): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; + } + + //_.matches + interface LoDashStatic { + /** + * Creates a function that performs a deep comparison between a given object and source, returning true if the + * given object has equivalent property values, else false. + * + * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and + * strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own + * or inherited property value see _.matchesProperty. + * + * @param source The object of property values to match. + * @return Returns the new function. + */ + matches<T>(source: T): (value: any) => boolean; + + /** + * @see _.matches + */ + matches<T, V>(source: T): (value: V) => boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.matches + */ + matches<V>(): LoDashImplicitObjectWrapper<(value: V) => boolean>; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.matches + */ + matches<V>(): LoDashExplicitObjectWrapper<(value: V) => boolean>; + } + + //_.matchesProperty + interface LoDashStatic { + /** + * Creates a function that compares the property value of path on a given object to value. + * + * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and + * strings. Objects are compared by their own, not inherited, enumerable properties. + * + * @param path The path of the property to get. + * @param srcValue The value to match. + * @return Returns the new function. + */ + matchesProperty<T>( + path: StringRepresentable|StringRepresentable[], + srcValue: T + ): (value: any) => boolean; + + /** + * @see _.matchesProperty + */ + matchesProperty<T, V>( + path: StringRepresentable|StringRepresentable[], + srcValue: T + ): (value: V) => boolean; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.matchesProperty + */ + matchesProperty<SrcValue>( + srcValue: SrcValue + ): LoDashImplicitObjectWrapper<(value: any) => boolean>; + + /** + * @see _.matchesProperty + */ + matchesProperty<SrcValue, Value>( + srcValue: SrcValue + ): LoDashImplicitObjectWrapper<(value: Value) => boolean>; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.matchesProperty + */ + matchesProperty<SrcValue>( + srcValue: SrcValue + ): LoDashExplicitObjectWrapper<(value: any) => boolean>; + + /** + * @see _.matchesProperty + */ + matchesProperty<SrcValue, Value>( + srcValue: SrcValue + ): LoDashExplicitObjectWrapper<(value: Value) => boolean>; + } + + //_.method + interface LoDashStatic { + /** + * Creates a function that invokes the method at path on a given object. Any additional arguments are provided + * to the invoked method. + * + * @param path The path of the method to invoke. + * @param args The arguments to invoke the method with. + * @return Returns the new function. + */ + method<TObject, TResult>( + path: string|StringRepresentable[], + ...args: any[] + ): (object: TObject) => TResult; + + /** + * @see _.method + */ + method<TResult>( + path: string|StringRepresentable[], + ...args: any[] + ): (object: any) => TResult; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.method + */ + method<TObject, TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>; + + /** + * @see _.method + */ + method<TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.method + */ + method<TObject, TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>; + + /** + * @see _.method + */ + method<TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.method + */ + method<TObject, TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>; + + /** + * @see _.method + */ + method<TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.method + */ + method<TObject, TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>; + + /** + * @see _.method + */ + method<TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>; + } + + //_.methodOf + interface LoDashStatic { + /** + * The opposite of _.method; this method creates a function that invokes the method at a given path on object. + * Any additional arguments are provided to the invoked method. + * + * @param object The object to query. + * @param args The arguments to invoke the method with. + * @return Returns the new function. + */ + methodOf<TObject extends {}, TResult>( + object: TObject, + ...args: any[] + ): (path: StringRepresentable|StringRepresentable[]) => TResult; + + /** + * @see _.methodOf + */ + methodOf<TResult>( + object: {}, + ...args: any[] + ): (path: StringRepresentable|StringRepresentable[]) => TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.methodOf + */ + methodOf<TResult>( + ...args: any[] + ): LoDashImplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.methodOf + */ + methodOf<TResult>( + ...args: any[] + ): LoDashExplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>; + } + + //_.mixin + interface MixinOptions { + chain?: boolean; + } + + interface LoDashStatic { + /** + * Adds all own enumerable function properties of a source object to the destination object. If object is a + * function then methods are added to its prototype as well. + * + * Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying + * the original. + * + * @param object The destination object. + * @param source The object of functions to add. + * @param options The options object. + * @param options.chain Specify whether the functions added are chainable. + * @return Returns object. + */ + mixin<TResult, TObject>( + object: TObject, + source: Dictionary<Function>, + options?: MixinOptions + ): TResult; + + /** + * @see _.mixin + */ + mixin<TResult>( + source: Dictionary<Function>, + options?: MixinOptions + ): TResult; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.mixin + */ + mixin<TResult>( + source: Dictionary<Function>, + options?: MixinOptions + ): LoDashImplicitObjectWrapper<TResult>; + + /** + * @see _.mixin + */ + mixin<TResult>( + options?: MixinOptions + ): LoDashImplicitObjectWrapper<TResult>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.mixin + */ + mixin<TResult>( + source: Dictionary<Function>, + options?: MixinOptions + ): LoDashExplicitObjectWrapper<TResult>; + + /** + * @see _.mixin + */ + mixin<TResult>( + options?: MixinOptions + ): LoDashExplicitObjectWrapper<TResult>; + } + + //_.noConflict + interface LoDashStatic { + /** + * Reverts the _ variable to its previous value and returns a reference to the lodash function. + * + * @return Returns the lodash function. + */ + noConflict(): typeof _; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.noConflict + */ + noConflict(): typeof _; + } + + //_.noop + interface LoDashStatic { + /** + * A no-operation function that returns undefined regardless of the arguments it receives. + * + * @return undefined + */ + noop(...args: any[]): void; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.noop + */ + noop(...args: any[]): void; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.noop + */ + noop(...args: any[]): _.LoDashExplicitWrapper<void>; + } + + //_.property + interface LoDashStatic { + /** + * Creates a function that returns the property value at path on a given object. + * + * @param path The path of the property to get. + * @return Returns the new function. + */ + property<TObj, TResult>(path: StringRepresentable|StringRepresentable[]): (obj: TObj) => TResult; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.property + */ + property<TObj, TResult>(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>; + } + + interface LoDashImplicitArrayWrapper<T> { + /** + * @see _.property + */ + property<TObj, TResult>(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.property + */ + property<TObj, TResult>(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>; + } + + interface LoDashExplicitArrayWrapper<T> { + /** + * @see _.property + */ + property<TObj, TResult>(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>; + } + + //_.propertyOf + interface LoDashStatic { + /** + * The opposite of _.property; this method creates a function that returns the property value at a given path + * on object. + * + * @param object The object to query. + * @return Returns the new function. + */ + propertyOf<T extends {}>(object: T): (path: string|string[]) => any; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.propertyOf + */ + propertyOf(): LoDashImplicitObjectWrapper<(path: string|string[]) => any>; + } + + interface LoDashExplicitObjectWrapper<T> { + /** + * @see _.propertyOf + */ + propertyOf(): LoDashExplicitObjectWrapper<(path: string|string[]) => any>; + } + + //_.range + interface LoDashStatic { + /** + * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. + * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length + * range is created unless a negative step is specified. + * + * @param start The start of the range. + * @param end The end of the range. + * @param step The value to increment or decrement by. + * @return Returns a new range array. + */ + range( + start: number, + end: number, + step?: number + ): number[]; + + /** + * @see _.range + */ + range( + end: number, + step?: number + ): number[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashImplicitArrayWrapper<number>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashExplicitArrayWrapper<number>; + } + + //_.rangeRight + interface LoDashStatic { + /** + * This method is like `_.range` except that it populates values in + * descending order. + * + * @static + * @memberOf _ + * @category Util + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns the new array of numbers. + * @example + * + * _.rangeRight(4); + * // => [3, 2, 1, 0] + * + * _.rangeRight(-4); + * // => [-3, -2, -1, 0] + * + * _.rangeRight(1, 5); + * // => [4, 3, 2, 1] + * + * _.rangeRight(0, 20, 5); + * // => [15, 10, 5, 0] + * + * _.rangeRight(0, -4, -1); + * // => [-3, -2, -1, 0] + * + * _.rangeRight(1, 4, 0); + * // => [1, 1, 1] + * + * _.rangeRight(0); + * // => [] + */ + rangeRight( + start: number, + end: number, + step?: number + ): number[]; + + /** + * @see _.rangeRight + */ + rangeRight( + end: number, + step?: number + ): number[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.rangeRight + */ + rangeRight( + end?: number, + step?: number + ): LoDashImplicitArrayWrapper<number>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.rangeRight + */ + rangeRight( + end?: number, + step?: number + ): LoDashExplicitArrayWrapper<number>; + } + + //_.runInContext + interface LoDashStatic { + /** + * Create a new pristine lodash function using the given context object. + * + * @param context The context object. + * @return Returns a new lodash function. + */ + runInContext(context?: Object): typeof _; + } + + interface LoDashImplicitObjectWrapper<T> { + /** + * @see _.runInContext + */ + runInContext(): typeof _; + } + + //_.times + interface LoDashStatic { + /** + * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee is + * bound to thisArg and invoked with one argument; (index). + * + * @param n The number of times to invoke iteratee. + * @param iteratee The function invoked per iteration. + * @param thisArg The this binding of iteratee. + * @return Returns the array of results. + */ + times<TResult>( + n: number, + iteratee: (num: number) => TResult, + thisArg?: any + ): TResult[]; + + /** + * @see _.times + */ + times(n: number): number[]; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.times + */ + times<TResult>( + iteratee: (num: number) => TResult, + thisArgs?: any + ): LoDashImplicitArrayWrapper<TResult>; + + /** + * @see _.times + */ + times(): LoDashImplicitArrayWrapper<number>; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.times + */ + times<TResult>( + iteratee: (num: number) => TResult, + thisArgs?: any + ): LoDashExplicitArrayWrapper<TResult>; + + /** + * @see _.times + */ + times(): LoDashExplicitArrayWrapper<number>; + } + + //_.toPath + interface LoDashStatic { + /** + * Converts `value` to a property path array. + * + * @static + * @memberOf _ + * @category Util + * @param {*} value The value to convert. + * @returns {Array} Returns the new property path array. + * @example + * + * _.toPath('a.b.c'); + * // => ['a', 'b', 'c'] + * + * _.toPath('a[0].b.c'); + * // => ['a', '0', 'b', 'c'] + * + * var path = ['a', 'b', 'c'], + * newPath = _.toPath(path); + * + * console.log(newPath); + * // => ['a', 'b', 'c'] + * + * console.log(path === newPath); + * // => false + */ + toPath(value: any): string[]; + } + + interface LoDashImplicitWrapperBase<T, TWrapper> { + /** + * @see _.toPath + */ + toPath(): LoDashImplicitWrapper<string[]>; + } + + interface LoDashExplicitWrapperBase<T, TWrapper> { + /** + * @see _.toPath + */ + toPath(): LoDashExplicitWrapper<string[]>; + } + + //_.uniqueId + interface LoDashStatic { + /** + * Generates a unique ID. If prefix is provided the ID is appended to it. + * + * @param prefix The value to prefix the ID with. + * @return Returns the unique ID. + */ + uniqueId(prefix?: string): string; + } + + interface LoDashImplicitWrapper<T> { + /** + * @see _.uniqueId + */ + uniqueId(): string; + } + + interface LoDashExplicitWrapper<T> { + /** + * @see _.uniqueId + */ + uniqueId(): LoDashExplicitWrapper<string>; + } + + interface ListIterator<T, TResult> { + (value: T, index: number, collection: List<T>): TResult; + } + + interface DictionaryIterator<T, TResult> { + (value: T, key?: string, collection?: Dictionary<T>): TResult; + } + + interface NumericDictionaryIterator<T, TResult> { + (value: T, key?: number, collection?: Dictionary<T>): TResult; + } + + interface ObjectIterator<T, TResult> { + (element: T, key?: string, collection?: any): TResult; + } + + interface StringIterator<TResult> { + (char: string, index?: number, string?: string): TResult; + } + + interface MemoVoidIterator<T, TResult> { + (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): void; + } + interface MemoIterator<T, TResult> { + (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): TResult; + } + + interface MemoVoidArrayIterator<T, TResult> { + (acc: TResult, curr: T, index?: number, arr?: T[]): void; + } + interface MemoVoidDictionaryIterator<T, TResult> { + (acc: TResult, curr: T, key?: string, dict?: Dictionary<T>): void; + } + + //interface Collection<T> {} + + // Common interface between Arrays and jQuery objects + interface List<T> { + [index: number]: T; + length: number; + } + + interface Dictionary<T> { + [index: string]: T; + } + + interface NumericDictionary<T> { + [index: number]: T; + } + + interface StringRepresentable { + toString(): string; + } + + interface Cancelable { + cancel(): void; + } +} + +declare module "lodash" { + export = _; +} diff --git a/lib/decl/mithril.d.ts b/lib/decl/mithril.d.ts new file mode 100644 index 000000000..c87102260 --- /dev/null +++ b/lib/decl/mithril.d.ts @@ -0,0 +1,926 @@ +// Mithril type definitions for Typescript + +/** +* This is the module containing all the types/declarations/etc. for Mithril +*/ +declare module _mithril { + interface MithrilStatic { + /** + * Creates a virtual element for use with m.render, m.mount, etc. + * + * @param selector A simple CSS selector. May include SVG tags. Nested + * selectors are not supported. + * @param attributes Attributes to add. Any DOM attribute may be used + * as an attribute, although innerHTML and the like may be overwritten + * silently. + * @param children Child elements, components, and text to add. + * @return A virtual element. + * + * @see m.render + * @see m.mount + * @see m.component + */ + <T extends MithrilController>( + selector: string, + attributes: MithrilAttributes, + ...children: Array<string | + MithrilVirtualElement<T> | + MithrilComponent<T>> + ): MithrilVirtualElement<T>; + + /** + * Initializes a component for use with m.render, m.mount, etc. + * + * @param component A component. + * @param args Arguments to optionally pass to the component. + * @return A component. + * + * @see m.render + * @see m.mount + * @see m + */ + <T extends MithrilController>( + component: MithrilComponent<T>, + ...args: any[] + ): MithrilComponent<T>; + + /** + * Creates a virtual element for use with m.render, m.mount, etc. + * + * @param selector A simple CSS selector. Nested selectors are not + * supported. + * @param children Child elements, components, and text to add. + * @return A virtual element. + * + * @see m.render + * @see m.mount + * @see m.component + */ + <T extends MithrilController>( + selector: string, + ...children: Array<string | + MithrilVirtualElement<T> | + MithrilComponent<T>> + ): MithrilVirtualElement<T>; + + /** + * Initializes a component for use with m.render, m.mount, etc. + * Shorthand for m.component. + * + * @param selector A component. + * @param args Arguments to optionally pass to the component. + * @return A component. + * + * @see m.render + * @see m.mount + * @see m.component + */ + <T extends MithrilController>( + component: MithrilComponent<T>, + ...args: any[] + ): MithrilComponent<T>; + + /** + * Creates a getter-setter function that wraps a Mithril promise. Useful + * for uniform data access, m.withAttr, etc. + * + * @param promise A thennable to initialize the property with. It may + * optionally be a Mithril promise. + * @return A getter-setter function wrapping the promise. + * + * @see m.withAttr + */ + prop<T>(promise: Thennable<T>) : MithrilPromiseProperty<T>; + + /** + * Creates a getter-setter function that wraps a simple value. Useful + * for uniform data access, m.withAttr, etc. + * + * @param value A value to initialize the property with + * @return A getter-setter function wrapping the value. + * + * @see m.withAttr + */ + prop<T>(value: T): MithrilBasicProperty<T>; + + /** + * Creates a getter-setter function that wraps a simple value. Useful + * for uniform data access, m.withAttr, etc. + * + * @return A getter-setter function wrapping the value. + * + * @see m.withAttr + */ + prop<T>(): MithrilBasicProperty<T>; + + /** + * Returns a event handler that can be bound to an element, firing with + * the specified property. + * + * @param property The property to get from the event. + * @param callback The handler to use the value from the event. + * @return A function suitable for listening to an event. + */ + withAttr( + property: string, + callback: (value: any) => void, + callbackThis: any + ): (e: Event) => any; + + /** + * Returns a event handler that can be bound to an element, firing with + * the specified property. + * + * @param attributeName Name of the element's attribute to bind to. + * @param property The property to bind. + * @return A function suitable for listening to an event. + */ + withAttr<T>( + attributeName: string, + property: MithrilBasicProperty<T> + ) : (e: Event) => any; + + /** + * @deprecated Use m.mount instead + */ + module<T extends MithrilController>( + rootElement: Node, + component: MithrilComponent<T> + ): T; + + /** + * Mounts a component to a base DOM node. + * + * @param rootElement The base node. + * @param component The component to mount. + * @return An instance of the top-level component's controller + */ + mount<T extends MithrilController>( + rootElement: Node, + component: MithrilComponent<T> + ): T; + + /** + * Initializes a component for use with m.render, m.mount, etc. + * + * @param selector A component. + * @param args Arguments to optionally pass to the component. + * @return A component. + * + * @see m.render + * @see m.mount + * @see m + */ + component<T extends MithrilController>( + component: MithrilComponent<T>, + ...args: any[] + ): MithrilComponent<T>; + + /** + * Trust this string of HTML. + * + * @param html The HTML to trust + * @return A String object instance with an added internal flag to mark + * it as trusted. + */ + trust(html: string): MithrilTrustedString; + + /** + * Render a virtual DOM tree. + * + * @param rootElement The base element/node to render the tree from. + * @param children One or more child nodes to add to the tree. + * @param forceRecreation If true, overwrite the entire tree without + * diffing against it. + */ + render<T extends MithrilController>( + rootElement: Element, + children: MithrilVirtualElement<T>|MithrilVirtualElement<T>[], + forceRecreation?: boolean + ): void; + + redraw: { + /** + * Force a redraw the active component. It redraws asynchronously by + * default to allow for simultaneous events to run before redrawing, + * such as the event combination keypress + input frequently used for + * input. + * + * @param force If true, redraw synchronously. + */ + (force?: boolean): void; + + strategy: { + /** + * Gets the current redraw strategy, which returns one of the + * following: + * + * "all" - recreates the DOM tree from scratch + * "diff" - recreates the DOM tree from scratch + * "none" - leaves the DOM tree intact + * + * This is useful for event handlers, which may want to cancel + * the next redraw if the event doesn't update the UI. + * + * @return The current strategy + */ + (): string; + + /** + * Sets the current redraw strategy. The parameter must be one of + * the following values: + * + * "all" - recreates the DOM tree from scratch + * "diff" - recreates the DOM tree from scratch + * "none" - leaves the DOM tree intact + * + * This is useful for event handlers, which may want to cancel + * the next redraw if the event doesn't update the UI. + * + * @param value The value to set + * @return The new strategy + */ + (value: string): string; + + /** + * @private + * Implementation detail - it's a MithrilBasicProperty instance + */ + toJSON(): string; + } + } + + route: { + /** + * Enable routing, mounting a controller based on the route. It + * automatically mounts the components for you, starting with the one + * specified by the default route. + * + * @param rootElement The element to mount the active controller to. + * @param defaultRoute The route to start with. + * @param routes A key-value mapping of pathname to controller. + */ + <T extends MithrilController>( + rootElement: Element, + defaultRoute: string, + routes: MithrilRoutes + ): void; + + /** + * This allows m.route to be used as the `config` attribute for a + * virtual element, particularly useful for cases like this: + * + * ```ts + * // Note that the '#' is not required in `href`, thanks to the + * `config` setting. + * m("a[href='/dashboard/alicesmith']", {config: m.route}); + * ``` + */ + <T extends MithrilController>( + element: Element, + isInitialized: boolean, + context?: MithrilContext, + vdom?: MithrilVirtualElement<T> + ): void; + + /** + * Programmatically redirect to another route. + * + * @param path The route to go to. + * @param params Parameters to pass as a query string. + * @param shouldReplaceHistory Whether to replace the current history + * instead of adding a new one. + */ + (path: string, params?: any, shouldReplaceHistory?: boolean): void; + + /** + * Gets the current route. + * + * @return The current route. + */ + (): string; + + /** + * Gets a route parameter. + * + * @param key The key to get. + * @return The value associated with the parameter key. + */ + param(key: string): string; + + /** + * The current routing mode. This may be changed before calling + * m.route to change the part of the URL used to perform the routing. + * + * The value can be set to one of the following, defaulting to + * "hash": + * + * "search" - Uses the query string. This allows for named anchors to + * work on the page, but changes cause IE8 and lower to refresh the + * page. + * + * "hash" - Uses the hash. This is the only routing mode that does + * not cause page refreshes on any browser, but it does not support + * named anchors. + * + * "pathname" - Uses the URL pathname. This requires server-side + * setup to support bookmarking and page refreshes. It always causes + * page refreshes on IE8 and lower. Note that this requires that the + * application to be run from the root of the URL. + */ + mode: string; + + /** + * Serialize an object into a query string. + * + * @param data The data to serialize. + * @return The serialized string. + */ + buildQueryString(data: Object): String + + /** + * Parse a query string into an object. + * + * @param data The data to parse. + * @return The parsed object data. + */ + parseQueryString(data: String): Object + } + + /** + * Send a request to a server to server. Note that the `url` option is + * required. + * + * @param options The options to use + * @return A promise to the returned data for "GET" requests, or a void + * promise for any other request type. + * + * @see MithrilXHROptions for the available options. + */ + request<T>(options: MithrilXHROptions<T>): MithrilPromise<T>; + + deferred: { + /** + * Create a Mithril deferred object. It behaves synchronously if + * possible, an intentional deviation from Promises/A+. Note that + * deferreds are completely separate from the redrawing system, and + * never trigger a redraw on their own. + * + * @return A new Mithril deferred instance. + * + * @see m.deferred.onerror for the error callback called for Error + * subclasses + */ + <T>(): MithrilDeferred<T>; + + /** + * A callback for all uncaught native Error subclasses in deferreds. + * This defaults to synchronously rethrowing all errors, a deviation + * from Promises/A+, but the behavior is configurable. To restore + * Promises/A+-compatible behavior. simply set this to a no-op. + */ + onerror(e: Error): void; + } + + /** + * Takes a list of promises or thennables and returns a Mithril promise + * that resolves once all in the list are resolved, or rejects if any of + * them reject. + * + * @param promises A list of promises to try to resolve. + * @return A promise that resolves to all the promises if all resolve, or + * rejects with the error contained in the first rejection. + */ + sync<T>(promises: Thennable<T>[]): MithrilPromise<T[]>; + + /** + * Use this and endComputation if your views aren't redrawing after + * calls to third-party libraries. For integrating asynchronous code, + * this should be called before any asynchronous work is done. For + * synchronous code, this should be called at the beginning of the + * problematic segment. Note that these calls must be balanced, much like + * braces and parentheses. This is mostly used internally. Prefer + * m.redraw where possible, especially when making repeated calls. + * + * @see endComputation + * @see m.render + */ + startComputation(): void; + + /** + * Use startComputation and this if your views aren't redrawing after + * calls to third-party libraries. For integrating asynchronous code, + * this should be called after all asynchronous work completes. For + * synchronous code, this should be called at the end of the problematic + * segment. Note that these calls must be balanced, much like braces and + * parentheses. This is mostly used internally. Prefer m.redraw where + * possible, especially when making repeated calls. + * + * @see startComputation + * @see m.render + */ + endComputation(): void; + + /** + * This overwrites the internal version of window used by Mithril. + * It's mostly useful for testing, and is also used internally by + * Mithril to test itself. By default Mithril uses `window` for the + * dependency. + * + * @param mockWindow The mock to use for the window. + * @return The mock that was passed in. + */ + deps(mockWindow: Window): Window; + } + + interface MithrilTrustedString extends String { + /** @private Implementation detail. Don't depend on it. */ + $trusted: boolean; + } + + /** + * The interface for a virtual element. It's best to consider this immutable + * for most use cases. + * + * @see m + */ + interface MithrilVirtualElement<T extends MithrilController> { + /** + * A key to optionally associate with this element. + */ + key?: number; + + /** + * The tag name of this element. + */ + tag?: string; + + /** + * The attributes of this element. + */ + attrs?: MithrilAttributes; + + /** + * The children of this element. + */ + children?: Array<string|MithrilVirtualElement<T>|MithrilComponent<T>>; + } + + /** + * An event passed by Mithril to unload event handlers. + */ + interface MithrilEvent { + /** + * Prevent the default behavior of scrolling the page and updating the + * URL on next route change. + */ + preventDefault(): void; + } + + /** + * A context object for configuration functions. + * + * @see MithrilElementConfig + */ + interface MithrilContext { + /** + * A function to call when the node is unloaded. Useful for cleanup. + */ + onunload?(): any; + + /** + * Set true if the backing DOM node needs to be retained between route + * changes if possible. Set false if this node needs to be recreated + * every single time, regardless of how "different" it is. + */ + retain?: boolean; + } + + /** + * This represents a callback function for a virtual element's config + * attribute. It's a low-level function useful for extra cleanup after + * removal from the tree, storing instances of third-party classes that + * need to be associated with the DOM, etc. + * + * @see MithrilAttributes + * @see MithrilContext + */ + interface MithrilElementConfig { + /** + * A callback function for a virtual element's config attribute. + * + * @param element The associated DOM element. + * @param isInitialized Whether this is the first call for the virtual + * element or not. + * @param context The associated context for this element. + * @param vdom The associated virtual element. + */ + <T extends MithrilController>( + element: Element, + isInitialized: boolean, + context: MithrilContext, + vdom: MithrilVirtualElement<T> + ): void; + } + + /** + * This represents the attributes available for configuring virtual elements, + * beyond the applicable DOM attributes. + * + * @see m + */ + interface MithrilAttributes { + /** + * The class name(s) for this virtual element, as a space-separated list. + */ + className?: string; + + /** + * The class name(s) for this virtual element, as a space-separated list. + */ + class?: string; + + /** + * A custom, low-level configuration in case this element needs special + * cleanup after removal from the tree. + * + * @see MithrilElementConfig + */ + config?: MithrilElementConfig; + + /** + * Any other virtual element properties including attributes and + * event handlers + */ + [property: string]: any; + } + + /** + * The basis of a Mithril controller instance. + */ + interface MithrilController { + /** + * An optional handler to call when the associated virtual element is + * destroyed. + * + * @param evt An associated event. + */ + onunload?(evt: MithrilEvent): any; + } + + /** + * This represents a controller function. + * + * @see MithrilControllerConstructor + */ + interface MithrilControllerFunction<T extends MithrilController> { + (opts?: any): T; + } + + /** + * This represents a controller constructor. + * + * @see MithrilControllerFunction + */ + interface MithrilControllerConstructor<T extends MithrilController> { + new(): T; + } + + /** + * This represents a view factory. + */ + interface MithrilView<T extends MithrilController> { + /** + * Creates a view out of virtual elements. + */ + (ctrl: T): MithrilVirtualElement<T>; + } + + /** + * This represents a Mithril component. + * + * @see m + * @see m.component + */ + interface MithrilComponent<T extends MithrilController> { + /** + * The component's controller. + * + * @see m.component + */ + controller: MithrilControllerFunction<T> | + MithrilControllerConstructor<T>; + + /** + * Creates a view out of virtual elements. + * + * @see m.component + */ + view(ctrl?: T, opts?: any): MithrilVirtualElement<T>; + } + + /** + * This is the base interface for property getter-setters + * + * @see m.prop + */ + interface MithrilProperty<T> { + /** + * Gets the contained value. + * + * @return The contained value. + */ + (): T; + + /** + * Sets the contained value. + * + * @param value The new value to set. + * @return The newly set value. + */ + (value: T): T; + } + + /** + * This represents a non-promise getter-setter functions. + * + * @see m.prop which returns objects that implement this interface. + */ + interface MithrilBasicProperty<T> extends MithrilProperty<T> { + /** + * Makes this serializable to JSON. + */ + toJSON(): T; + } + + /** + * This represents a promise getter-setter function. + * + * @see m.prop which returns objects that implement this interface. + */ + interface MithrilPromiseProperty<T> extends MithrilPromise<T>, + MithrilProperty<MithrilPromise<T>> { + /** + * Gets the contained promise. + * + * @return The contained value. + */ + (): MithrilPromise<T>; + + /** + * Sets the contained promise. + * + * @param value The new value to set. + * @return The newly set value. + */ + (value: MithrilPromise<T>): MithrilPromise<T>; + + /** + * Sets the contained wrapped value. + * + * @param value The new value to set. + * @return The newly set value. + */ + (value: T): MithrilPromise<T>; + } + + /** + * This represents a key-value mapping linking routes to components. + */ + interface MithrilRoutes { + /** + * The key represents the route. The value represents the corresponding + * component. + */ + [key: string]: MithrilComponent<MithrilController>; + } + + /** + * This represents a Mithril deferred object. + */ + interface MithrilDeferred<T> { + /** + * Resolve this deferred's promise with a value. + * + * @param value The value to resolve the promise with. + */ + resolve(value?: T): void; + + /** + * Reject this deferred with an error. + * + * @param value The reason for rejecting the promise. + */ + reject(reason?: any): void; + + /** + * The backing promise. + * + * @see MithrilPromise + */ + promise: MithrilPromise<T>; + } + + /** + * This represents a thennable success callback. + */ + interface MithrilSuccessCallback<T, U> { + (value: T): U | Thennable<U>; + } + + /** + * This represents a thennable error callback. + */ + interface MithrilErrorCallback<T> { + (value: Error): T | Thennable<T>; + } + + /** + * This represents a thennable. + */ + interface Thennable<T> { + then<U>(success: (value: T) => U): Thennable<U>; + then<U,V>(success: (value: T) => U, error: (value: Error) => V): Thennable<U>|Thennable<V>; + catch?: <U>(error: (value: Error) => U) => Thennable<U>; + } + + /** + * This represents a Mithril promise object. + */ + interface MithrilPromise<T> extends Thennable<T>, MithrilProperty<MithrilPromise<T>> { + /** + * Chain this promise with a simple success callback, propogating + * rejections. + * + * @param success The callback to call when the promise is resolved. + * @return The chained promise. + */ + then<U>(success: MithrilSuccessCallback<T,U>): MithrilPromise<U>; + + /** + * Chain this promise with a success callback and error callback, without + * propogating rejections. + * + * @param success The callback to call when the promise is resolved. + * @param error The callback to call when the promise is rejected. + * @return The chained promise. + */ + then<U, V>( + success: MithrilSuccessCallback<T, U>, + error: MithrilErrorCallback<V> + ): MithrilPromise<U> | MithrilPromise<V>; + + /** + * Chain this promise with a single error callback, without propogating + * rejections. + * + * @param error The callback to call when the promise is rejected. + * @return The chained promise. + */ + catch<U>(error: MithrilErrorCallback<U>): MithrilPromise<T> | + MithrilPromise<U>; + } + + /** + * This represents the available options for configuring m.request. + * + * @see m.request + */ + interface MithrilXHROptions<T> { + /** + * This represents the HTTP method used, one of the following: + * + * - "GET" (default) + * - "POST" + * - "PUT" + * - "DELETE" + * - "HEAD" + * - "OPTIONS" + */ + method?: string; + + /** + * The URL to send the request to. + */ + url: string; + + /** + * The username for HTTP authentication. + */ + user?: string; + + /** + * The password for HTTP authentication. + */ + password?: string; + + /** + * The data to be sent. It's automatically serialized in the right format + * depending on the method (with exception of HTML5 FormData), and put in + * the appropriate section of the request. + */ + data?: any; + + /** + * Whether to run it in the background, i.e. true if it doesn't affect + * template rendering. + */ + background?: boolean; + + /** + * Set an initial value while the request is working, to populate the + * promise getter-setter. + */ + initialValue?: T; + + /** + * An optional preprocessor function to unwrap a successful response, in + * case the response contains metadata wrapping the data. + * + * @param data The data to unwrap. + * @return The unwrapped result. + */ + unwrapSuccess?(data: any): T; + + /** + * An optional preprocessor function to unwrap an unsuccessful response, + * in case the response contains metadata wrapping the data. + * + * @param data The data to unwrap. + * @return The unwrapped result. + */ + unwrapError?(data: any): T; + + /** + * An optional function to serialize the data. This defaults to + * `JSON.stringify`. + * + * @param dataToSerialize The data to serialize. + * @return The serialized form as a string. + */ + serialize?(dataToSerialize: any): string; + + /** + * An optional function to deserialize the data. This defaults to + * `JSON.parse`. + * + * @param dataToSerialize The data to parse. + * @return The parsed form. + */ + deserialize?(dataToDeserialize: string): any; + + /** + * An optional function to extract the data from a raw XMLHttpRequest, + * useful if the relevant data is in a response header or the status + * field. + * + * @param xhr The associated XMLHttpRequest. + * @param options The options passed to this request. + * @return string The serialized format. + */ + extract?(xhr: XMLHttpRequest, options: MithrilXHROptions<T>): string; + + /** + * The parsed data, or its children if it's an array, will be passed to + * this class constructor if it's given, to parse it into classes. + * + * @param data The data to parse. + * @return The new instance for the list. + */ + type?: new (data: Object) => any; + + /** + * An optional function to run between `open` and `send`, useful for + * adding request headers or using XHR2 features such as the `upload` + * property. It is even possible to override the XHR altogether with a + * similar object, such as an XDomainRequest instance. + * + * @param xhr The associated XMLHttpRequest. + * @param options The options passed to this request. + * @return The new XMLHttpRequest, or nothing if the same one is kept. + */ + config?(xhr: XMLHttpRequest, options: MithrilXHROptions<T>): any; + + /** + * For JSONP requests, this must be the string "jsonp". Otherwise, it's + * ignored. + */ + dataType?: string; + + /** + * For JSONP requests, this is the query string key for the JSONP + * request. This is useful for APIs that don't use common conventions, + * such as `www.example.com/?jsonpCallback=doSomething`. It defaults to + * `callback` for JSONP requests, and is ignored for any other kind of + * request. + */ + callbackKey?: string; + } +} + +declare var Mithril: _mithril.MithrilStatic; +declare var m: _mithril.MithrilStatic; + +declare module "mithril" { + export = m; +} diff --git a/lib/decl/node.d.ts b/lib/decl/node.d.ts new file mode 100644 index 000000000..8df3d16a7 --- /dev/null +++ b/lib/decl/node.d.ts @@ -0,0 +1,2178 @@ +// Type definitions for Node.js v4.x +// Project: http://nodejs.org/ +// Definitions by: Microsoft TypeScript <http://typescriptlang.org>, DefinitelyTyped <https://github.com/borisyankov/DefinitelyTyped> +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/************************************************ +* * +* Node.js v4.x API * +* * +************************************************/ + +interface Error { + stack?: string; +} + + +// compat for TypeScript 1.5.3 +// if you use with --target es3 or --target es5 and use below definitions, +// use the lib.es6.d.ts that is bundled with TypeScript 1.5.3. +interface MapConstructor {} +interface WeakMapConstructor {} +interface SetConstructor {} +interface WeakSetConstructor {} + +/************************************************ +* * +* GLOBAL * +* * +************************************************/ +declare var process: NodeJS.Process; +declare var global: NodeJS.Global; + +declare var __filename: string; +declare var __dirname: string; + +declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare function clearTimeout(timeoutId: NodeJS.Timer): void; +declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare function clearInterval(intervalId: NodeJS.Timer): void; +declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; +declare function clearImmediate(immediateId: any): void; + +interface NodeRequireFunction { + (id: string): any; +} + +interface NodeRequire extends NodeRequireFunction { + resolve(id:string): string; + cache: any; + extensions: any; + main: any; +} + +declare var require: NodeRequire; + +interface NodeModule { + exports: any; + require: NodeRequireFunction; + id: string; + filename: string; + loaded: boolean; + parent: any; + children: any[]; +} + +declare var module: NodeModule; + +// Same as module.exports +declare var exports: any; +declare var SlowBuffer: { + new (str: string, encoding?: string): Buffer; + new (size: number): Buffer; + new (size: Uint8Array): Buffer; + new (array: any[]): Buffer; + prototype: Buffer; + isBuffer(obj: any): boolean; + byteLength(string: string, encoding?: string): number; + concat(list: Buffer[], totalLength?: number): Buffer; +}; + + +// Buffer class +interface Buffer extends NodeBuffer {} + +/** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + */ +declare var Buffer: { + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + new (str: string, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + new (size: number): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + new (array: Uint8Array): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + new (array: any[]): Buffer; + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + new (buffer: Buffer): Buffer; + prototype: Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + compare(buf1: Buffer, buf2: Buffer): number; +}; + +/************************************************ +* * +* GLOBAL INTERFACES * +* * +************************************************/ +declare module NodeJS { + export interface ErrnoException extends Error { + errno?: number; + code?: string; + path?: string; + syscall?: string; + stack?: string; + } + + export interface EventEmitter { + addListener(event: string, listener: Function): EventEmitter; + on(event: string, listener: Function): EventEmitter; + once(event: string, listener: Function): EventEmitter; + removeListener(event: string, listener: Function): EventEmitter; + removeAllListeners(event?: string): EventEmitter; + setMaxListeners(n: number): EventEmitter; + getMaxListeners(): number; + listeners(event: string): Function[]; + emit(event: string, ...args: any[]): boolean; + listenerCount(type: string): number; + } + + export interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string|Buffer; + setEncoding(encoding: string): void; + pause(): void; + resume(): void; + pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T; + unpipe<T extends WritableStream>(destination?: T): void; + unshift(chunk: string): void; + unshift(chunk: Buffer): void; + wrap(oldStream: ReadableStream): ReadableStream; + } + + export interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Buffer|string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + } + + export interface ReadWriteStream extends ReadableStream, WritableStream {} + + export interface Process extends EventEmitter { + stdout: WritableStream; + stderr: WritableStream; + stdin: ReadableStream; + argv: string[]; + execPath: string; + abort(): void; + chdir(directory: string): void; + cwd(): string; + env: any; + exit(code?: number): void; + getgid(): number; + setgid(id: number): void; + setgid(id: string): void; + getuid(): number; + setuid(id: number): void; + setuid(id: string): void; + version: string; + versions: { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + openssl: string; + }; + config: { + target_defaults: { + cflags: any[]; + default_configuration: string; + defines: string[]; + include_dirs: string[]; + libraries: string[]; + }; + variables: { + clang: number; + host_arch: string; + node_install_npm: boolean; + node_install_waf: boolean; + node_prefix: string; + node_shared_openssl: boolean; + node_shared_v8: boolean; + node_shared_zlib: boolean; + node_use_dtrace: boolean; + node_use_etw: boolean; + node_use_openssl: boolean; + target_arch: string; + v8_no_strict_aliasing: number; + v8_use_snapshot: boolean; + visibility: string; + }; + }; + kill(pid:number, signal?: string|number): void; + pid: number; + title: string; + arch: string; + platform: string; + memoryUsage(): { rss: number; heapTotal: number; heapUsed: number; }; + nextTick(callback: Function): void; + umask(mask?: number): number; + uptime(): number; + hrtime(time?:number[]): number[]; + + // Worker + send?(message: any, sendHandle?: any): void; + } + + export interface Global { + Array: typeof Array; + ArrayBuffer: typeof ArrayBuffer; + Boolean: typeof Boolean; + Buffer: typeof Buffer; + DataView: typeof DataView; + Date: typeof Date; + Error: typeof Error; + EvalError: typeof EvalError; + Float32Array: typeof Float32Array; + Float64Array: typeof Float64Array; + Function: typeof Function; + GLOBAL: Global; + Infinity: typeof Infinity; + Int16Array: typeof Int16Array; + Int32Array: typeof Int32Array; + Int8Array: typeof Int8Array; + Intl: typeof Intl; + JSON: typeof JSON; + Map: MapConstructor; + Math: typeof Math; + NaN: typeof NaN; + Number: typeof Number; + Object: typeof Object; + Promise: Function; + RangeError: typeof RangeError; + ReferenceError: typeof ReferenceError; + RegExp: typeof RegExp; + Set: SetConstructor; + String: typeof String; + Symbol: Function; + SyntaxError: typeof SyntaxError; + TypeError: typeof TypeError; + URIError: typeof URIError; + Uint16Array: typeof Uint16Array; + Uint32Array: typeof Uint32Array; + Uint8Array: typeof Uint8Array; + Uint8ClampedArray: Function; + WeakMap: WeakMapConstructor; + WeakSet: WeakSetConstructor; + clearImmediate: (immediateId: any) => void; + clearInterval: (intervalId: NodeJS.Timer) => void; + clearTimeout: (timeoutId: NodeJS.Timer) => void; + console: typeof console; + decodeURI: typeof decodeURI; + decodeURIComponent: typeof decodeURIComponent; + encodeURI: typeof encodeURI; + encodeURIComponent: typeof encodeURIComponent; + escape: (str: string) => string; + eval: typeof eval; + global: Global; + isFinite: typeof isFinite; + isNaN: typeof isNaN; + parseFloat: typeof parseFloat; + parseInt: typeof parseInt; + process: Process; + root: Global; + setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any; + setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; + setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; + undefined: typeof undefined; + unescape: (str: string) => string; + gc: () => void; + v8debug?: any; + } + + export interface Timer { + ref() : void; + unref() : void; + } +} + +/** + * @deprecated + */ +interface NodeBuffer { + [index: number]: number; + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): any; + length: number; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAsset?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): Buffer; + indexOf(value: string | number | Buffer, byteOffset?: number): number; +} + +/************************************************ +* * +* MODULES * +* * +************************************************/ +declare module "buffer" { + export var INSPECT_MAX_BYTES: number; +} + +declare module "querystring" { + export interface StringifyOptions { + encodeURIComponent?: Function; + } + + export interface ParseOptions { + maxKeys?: number; + decodeURIComponent?: Function; + } + + export function stringify<T>(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string; + export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): any; + export function parse<T extends {}>(str: string, sep?: string, eq?: string, options?: ParseOptions): T; + export function escape(str: string): string; + export function unescape(str: string): string; +} + +declare module "events" { + export class EventEmitter implements NodeJS.EventEmitter { + static EventEmitter: EventEmitter; + static listenerCount(emitter: EventEmitter, event: string): number; // deprecated + static defaultMaxListeners: number; + + addListener(event: string, listener: Function): EventEmitter; + on(event: string, listener: Function): EventEmitter; + once(event: string, listener: Function): EventEmitter; + removeListener(event: string, listener: Function): EventEmitter; + removeAllListeners(event?: string): EventEmitter; + setMaxListeners(n: number): EventEmitter; + getMaxListeners(): number; + listeners(event: string): Function[]; + emit(event: string, ...args: any[]): boolean; + listenerCount(type: string): number; + } +} + +declare module "http" { + import * as events from "events"; + import * as net from "net"; + import * as stream from "stream"; + + export interface RequestOptions { + protocol?: string; + host?: string; + hostname?: string; + family?: number; + port?: number; + localAddress?: string; + socketPath?: string; + method?: string; + path?: string; + headers?: { [key: string]: any }; + auth?: string; + agent?: Agent|boolean; + } + + export interface Server extends events.EventEmitter { + listen(port: number, hostname?: string, backlog?: number, callback?: Function): Server; + listen(port: number, hostname?: string, callback?: Function): Server; + listen(path: string, callback?: Function): Server; + listen(handle: any, listeningListener?: Function): Server; + close(cb?: any): Server; + address(): { port: number; family: string; address: string; }; + maxHeadersCount: number; + } + /** + * @deprecated Use IncomingMessage + */ + export interface ServerRequest extends IncomingMessage { + connection: net.Socket; + } + export interface ServerResponse extends events.EventEmitter, stream.Writable { + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + + writeContinue(): void; + writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void; + writeHead(statusCode: number, headers?: any): void; + statusCode: number; + statusMessage: string; + headersSent: boolean; + setHeader(name: string, value: string): void; + sendDate: boolean; + getHeader(name: string): string; + removeHeader(name: string): void; + write(chunk: any, encoding?: string): any; + addTrailers(headers: any): void; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + } + export interface ClientRequest extends events.EventEmitter, stream.Writable { + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + + write(chunk: any, encoding?: string): void; + abort(): void; + setTimeout(timeout: number, callback?: Function): void; + setNoDelay(noDelay?: boolean): void; + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + } + export interface IncomingMessage extends events.EventEmitter, stream.Readable { + httpVersion: string; + headers: any; + rawHeaders: string[]; + trailers: any; + rawTrailers: any; + setTimeout(msecs: number, callback: Function): NodeJS.Timer; + /** + * Only valid for request obtained from http.Server. + */ + method?: string; + /** + * Only valid for request obtained from http.Server. + */ + url?: string; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusCode?: number; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusMessage?: string; + socket: net.Socket; + } + /** + * @deprecated Use IncomingMessage + */ + export interface ClientResponse extends IncomingMessage { } + + export interface AgentOptions { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number; + } + + export class Agent { + maxSockets: number; + sockets: any; + requests: any; + + constructor(opts?: AgentOptions); + + /** + * Destroy any sockets that are currently in use by the agent. + * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, + * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, + * sockets may hang open for quite a long time before the server terminates them. + */ + destroy(): void; + } + + export var METHODS: string[]; + + export var STATUS_CODES: { + [errorCode: number]: string; + [errorCode: string]: string; + }; + export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server; + export function createClient(port?: number, host?: string): any; + export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; + export var globalAgent: Agent; +} + +declare module "cluster" { + import * as child from "child_process"; + import * as events from "events"; + + export interface ClusterSettings { + exec?: string; + args?: string[]; + silent?: boolean; + } + + export class Worker extends events.EventEmitter { + id: string; + process: child.ChildProcess; + suicide: boolean; + send(message: any, sendHandle?: any): void; + kill(signal?: string): void; + destroy(signal?: string): void; + disconnect(): void; + } + + export var settings: ClusterSettings; + export var isMaster: boolean; + export var isWorker: boolean; + export function setupMaster(settings?: ClusterSettings): void; + export function fork(env?: any): Worker; + export function disconnect(callback?: Function): void; + export var worker: Worker; + export var workers: Worker[]; + + // Event emitter + export function addListener(event: string, listener: Function): void; + export function on(event: "disconnect", listener: (worker: Worker) => void): void; + export function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): void; + export function on(event: "fork", listener: (worker: Worker) => void): void; + export function on(event: "listening", listener: (worker: Worker, address: any) => void): void; + export function on(event: "message", listener: (worker: Worker, message: any) => void): void; + export function on(event: "online", listener: (worker: Worker) => void): void; + export function on(event: "setup", listener: (settings: any) => void): void; + export function on(event: string, listener: Function): any; + export function once(event: string, listener: Function): void; + export function removeListener(event: string, listener: Function): void; + export function removeAllListeners(event?: string): void; + export function setMaxListeners(n: number): void; + export function listeners(event: string): Function[]; + export function emit(event: string, ...args: any[]): boolean; +} + +declare module "zlib" { + import * as stream from "stream"; + export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; } + + export interface Gzip extends stream.Transform { } + export interface Gunzip extends stream.Transform { } + export interface Deflate extends stream.Transform { } + export interface Inflate extends stream.Transform { } + export interface DeflateRaw extends stream.Transform { } + export interface InflateRaw extends stream.Transform { } + export interface Unzip extends stream.Transform { } + + export function createGzip(options?: ZlibOptions): Gzip; + export function createGunzip(options?: ZlibOptions): Gunzip; + export function createDeflate(options?: ZlibOptions): Deflate; + export function createInflate(options?: ZlibOptions): Inflate; + export function createDeflateRaw(options?: ZlibOptions): DeflateRaw; + export function createInflateRaw(options?: ZlibOptions): InflateRaw; + export function createUnzip(options?: ZlibOptions): Unzip; + + export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function deflateSync(buf: Buffer, options?: ZlibOptions): any; + export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function deflateRawSync(buf: Buffer, options?: ZlibOptions): any; + export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function gzipSync(buf: Buffer, options?: ZlibOptions): any; + export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function gunzipSync(buf: Buffer, options?: ZlibOptions): any; + export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function inflateSync(buf: Buffer, options?: ZlibOptions): any; + export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function inflateRawSync(buf: Buffer, options?: ZlibOptions): any; + export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function unzipSync(buf: Buffer, options?: ZlibOptions): any; + + // Constants + export var Z_NO_FLUSH: number; + export var Z_PARTIAL_FLUSH: number; + export var Z_SYNC_FLUSH: number; + export var Z_FULL_FLUSH: number; + export var Z_FINISH: number; + export var Z_BLOCK: number; + export var Z_TREES: number; + export var Z_OK: number; + export var Z_STREAM_END: number; + export var Z_NEED_DICT: number; + export var Z_ERRNO: number; + export var Z_STREAM_ERROR: number; + export var Z_DATA_ERROR: number; + export var Z_MEM_ERROR: number; + export var Z_BUF_ERROR: number; + export var Z_VERSION_ERROR: number; + export var Z_NO_COMPRESSION: number; + export var Z_BEST_SPEED: number; + export var Z_BEST_COMPRESSION: number; + export var Z_DEFAULT_COMPRESSION: number; + export var Z_FILTERED: number; + export var Z_HUFFMAN_ONLY: number; + export var Z_RLE: number; + export var Z_FIXED: number; + export var Z_DEFAULT_STRATEGY: number; + export var Z_BINARY: number; + export var Z_TEXT: number; + export var Z_ASCII: number; + export var Z_UNKNOWN: number; + export var Z_DEFLATED: number; + export var Z_NULL: number; +} + +declare module "os" { + export interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + }; + } + + export interface NetworkInterfaceInfo { + address: string; + netmask: string; + family: string; + mac: string; + internal: boolean; + } + + export function tmpdir(): string; + export function homedir(): string; + export function endianness(): string; + export function hostname(): string; + export function type(): string; + export function platform(): string; + export function arch(): string; + export function release(): string; + export function uptime(): number; + export function loadavg(): number[]; + export function totalmem(): number; + export function freemem(): number; + export function cpus(): CpuInfo[]; + export function networkInterfaces(): {[index: string]: NetworkInterfaceInfo[]}; + export var EOL: string; +} + +declare module "https" { + import * as tls from "tls"; + import * as events from "events"; + import * as http from "http"; + + export interface ServerOptions { + pfx?: any; + key?: any; + passphrase?: string; + cert?: any; + ca?: any; + crl?: any; + ciphers?: string; + honorCipherOrder?: boolean; + requestCert?: boolean; + rejectUnauthorized?: boolean; + NPNProtocols?: any; + SNICallback?: (servername: string) => any; + } + + export interface RequestOptions extends http.RequestOptions{ + pfx?: any; + key?: any; + passphrase?: string; + cert?: any; + ca?: any; + ciphers?: string; + rejectUnauthorized?: boolean; + secureProtocol?: string; + } + + export interface Agent { + maxSockets: number; + sockets: any; + requests: any; + } + export var Agent: { + new (options?: RequestOptions): Agent; + }; + export interface Server extends tls.Server { } + export function createServer(options: ServerOptions, requestListener?: Function): Server; + export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; + export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; + export var globalAgent: Agent; +} + +declare module "punycode" { + export function decode(string: string): string; + export function encode(string: string): string; + export function toUnicode(domain: string): string; + export function toASCII(domain: string): string; + export var ucs2: ucs2; + interface ucs2 { + decode(string: string): number[]; + encode(codePoints: number[]): string; + } + export var version: any; +} + +declare module "repl" { + import * as stream from "stream"; + import * as events from "events"; + + export interface ReplOptions { + prompt?: string; + input?: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + terminal?: boolean; + eval?: Function; + useColors?: boolean; + useGlobal?: boolean; + ignoreUndefined?: boolean; + writer?: Function; + } + export function start(options: ReplOptions): events.EventEmitter; +} + +declare module "readline" { + import * as events from "events"; + import * as stream from "stream"; + + export interface Key { + sequence?: string; + name?: string; + ctrl?: boolean; + meta?: boolean; + shift?: boolean; + } + + export interface ReadLine extends events.EventEmitter { + setPrompt(prompt: string): void; + prompt(preserveCursor?: boolean): void; + question(query: string, callback: (answer: string) => void): void; + pause(): ReadLine; + resume(): ReadLine; + close(): void; + write(data: string|Buffer, key?: Key): void; + } + + export interface Completer { + (line: string): CompleterResult; + (line: string, callback: (err: any, result: CompleterResult) => void): any; + } + + export interface CompleterResult { + completions: string[]; + line: string; + } + + export interface ReadLineOptions { + input: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + completer?: Completer; + terminal?: boolean; + historySize?: number; + } + + export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer, terminal?: boolean): ReadLine; + export function createInterface(options: ReadLineOptions): ReadLine; + + export function cursorTo(stream: NodeJS.WritableStream, x: number, y: number): void; + export function moveCursor(stream: NodeJS.WritableStream, dx: number|string, dy: number|string): void; + export function clearLine(stream: NodeJS.WritableStream, dir: number): void; + export function clearScreenDown(stream: NodeJS.WritableStream): void; +} + +declare module "vm" { + export interface Context { } + export interface Script { + runInThisContext(): void; + runInNewContext(sandbox?: Context): void; + } + export function runInThisContext(code: string, filename?: string): void; + export function runInNewContext(code: string, sandbox?: Context, filename?: string): void; + export function runInContext(code: string, context: Context, filename?: string): void; + export function createContext(initSandbox?: Context): Context; + export function createScript(code: string, filename?: string): Script; +} + +declare module "child_process" { + import * as events from "events"; + import * as stream from "stream"; + + export interface ChildProcess extends events.EventEmitter { + stdin: stream.Writable; + stdout: stream.Readable; + stderr: stream.Readable; + pid: number; + kill(signal?: string): void; + send(message: any, sendHandle?: any): void; + disconnect(): void; + unref(): void; + } + + export function spawn(command: string, args?: string[], options?: { + cwd?: string; + stdio?: any; + custom?: any; + env?: any; + detached?: boolean; + }): ChildProcess; + export function exec(command: string, options: { + cwd?: string; + stdio?: any; + customFds?: any; + env?: any; + encoding?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function exec(command: string, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, + callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], + callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], options?: { + cwd?: string; + stdio?: any; + customFds?: any; + env?: any; + encoding?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function fork(modulePath: string, args?: string[], options?: { + cwd?: string; + env?: any; + execPath?: string; + execArgv?: string[]; + silent?: boolean; + uid?: number; + gid?: number; + }): ChildProcess; + export function spawnSync(command: string, args?: string[], options?: { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + encoding?: string; + }): { + pid: number; + output: string[]; + stdout: string | Buffer; + stderr: string | Buffer; + status: number; + signal: string; + error: Error; + }; + export function execSync(command: string, options?: { + cwd?: string; + input?: string|Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + encoding?: string; + }): string | Buffer; + export function execFileSync(command: string, args?: string[], options?: { + cwd?: string; + input?: string|Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + encoding?: string; + }): string | Buffer; +} + +declare module "url" { + export interface Url { + href?: string; + protocol?: string; + auth?: string; + hostname?: string; + port?: string; + host?: string; + pathname?: string; + search?: string; + query?: any; // string | Object + slashes?: boolean; + hash?: string; + path?: string; + } + + export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url; + export function format(url: Url): string; + export function resolve(from: string, to: string): string; +} + +declare module "dns" { + export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string; + export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string; + export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; + export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[]; +} + +declare module "net" { + import * as stream from "stream"; + + export interface Socket extends stream.Duplex { + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + + connect(port: number, host?: string, connectionListener?: Function): void; + connect(path: string, connectionListener?: Function): void; + bufferSize: number; + setEncoding(encoding?: string): void; + write(data: any, encoding?: string, callback?: Function): void; + destroy(): void; + pause(): void; + resume(): void; + setTimeout(timeout: number, callback?: Function): void; + setNoDelay(noDelay?: boolean): void; + setKeepAlive(enable?: boolean, initialDelay?: number): void; + address(): { port: number; family: string; address: string; }; + unref(): void; + ref(): void; + + remoteAddress: string; + remoteFamily: string; + remotePort: number; + localAddress: string; + localPort: number; + bytesRead: number; + bytesWritten: number; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + } + + export var Socket: { + new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket; + }; + + export interface Server extends Socket { + listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server; + listen(path: string, listeningListener?: Function): Server; + listen(handle: any, listeningListener?: Function): Server; + close(callback?: Function): Server; + address(): { port: number; family: string; address: string; }; + maxConnections: number; + connections: number; + } + export function createServer(connectionListener?: (socket: Socket) =>void ): Server; + export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) =>void ): Server; + export function connect(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function connect(port: number, host?: string, connectionListener?: Function): Socket; + export function connect(path: string, connectionListener?: Function): Socket; + export function createConnection(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; + export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; + export function createConnection(path: string, connectionListener?: Function): Socket; + export function isIP(input: string): number; + export function isIPv4(input: string): boolean; + export function isIPv6(input: string): boolean; +} + +declare module "dgram" { + import * as events from "events"; + + interface RemoteInfo { + address: string; + port: number; + size: number; + } + + interface AddressInfo { + address: string; + family: string; + port: number; + } + + export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + + interface Socket extends events.EventEmitter { + send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; + bind(port: number, address?: string, callback?: () => void): void; + close(): void; + address(): AddressInfo; + setBroadcast(flag: boolean): void; + setMulticastTTL(ttl: number): void; + setMulticastLoopback(flag: boolean): void; + addMembership(multicastAddress: string, multicastInterface?: string): void; + dropMembership(multicastAddress: string, multicastInterface?: string): void; + } +} + +declare module "fs" { + import * as stream from "stream"; + import * as events from "events"; + + interface Stats { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: number; + ino: number; + mode: number; + nlink: number; + uid: number; + gid: number; + rdev: number; + size: number; + blksize: number; + blocks: number; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } + + interface FSWatcher extends events.EventEmitter { + close(): void; + } + + export interface ReadStream extends stream.Readable { + close(): void; + } + export interface WriteStream extends stream.Writable { + close(): void; + bytesWritten: number; + } + + /** + * Asynchronous rename. + * @param oldPath + * @param newPath + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + /** + * Synchronous rename + * @param oldPath + * @param newPath + */ + export function renameSync(oldPath: string, newPath: string): void; + export function truncate(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function truncate(path: string, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function truncateSync(path: string, len?: number): void; + export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function ftruncateSync(fd: number, len?: number): void; + export function chown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chownSync(path: string, uid: number, gid: number): void; + export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fchownSync(fd: number, uid: number, gid: number): void; + export function lchown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchownSync(path: string, uid: number, gid: number): void; + export function chmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function chmodSync(path: string, mode: number): void; + export function chmodSync(path: string, mode: string): void; + export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fchmodSync(fd: number, mode: number): void; + export function fchmodSync(fd: number, mode: string): void; + export function lchmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function lchmodSync(path: string, mode: number): void; + export function lchmodSync(path: string, mode: string): void; + export function stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function lstat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; + export function statSync(path: string): Stats; + export function lstatSync(path: string): Stats; + export function fstatSync(fd: number): Stats; + export function link(srcpath: string, dstpath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function linkSync(srcpath: string, dstpath: string): void; + export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; + export function readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; + export function readlinkSync(path: string): string; + export function realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; + export function realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void; + export function realpathSync(path: string, cache?: { [path: string]: string }): string; + /* + * Asynchronous unlink - deletes the file specified in {path} + * + * @param path + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function unlink(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + /* + * Synchronous unlink - deletes the file specified in {path} + * + * @param path + */ + export function unlinkSync(path: string): void; + /* + * Asynchronous rmdir - removes the directory specified in {path} + * + * @param path + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function rmdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + /* + * Synchronous rmdir - removes the directory specified in {path} + * + * @param path + */ + export function rmdirSync(path: string): void; + /* + * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + /* + * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param mode + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdir(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + /* + * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param mode + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdir(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; + /* + * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param mode + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdirSync(path: string, mode?: number): void; + /* + * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. + * + * @param path + * @param mode + * @param callback No arguments other than a possible exception are given to the completion callback. + */ + export function mkdirSync(path: string, mode?: string): void; + export function readdir(path: string, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void; + export function readdirSync(path: string): string[]; + export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function closeSync(fd: number): void; + export function open(path: string, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + export function open(path: string, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + export function open(path: string, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; + export function openSync(path: string, flags: string, mode?: number): number; + export function openSync(path: string, flags: string, mode?: string): number; + export function utimes(path: string, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function utimes(path: string, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function utimesSync(path: string, atime: number, mtime: number): void; + export function utimesSync(path: string, atime: Date, mtime: Date): void; + export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function futimesSync(fd: number, atime: number, mtime: number): void; + export function futimesSync(fd: number, atime: Date, mtime: Date): void; + export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; + export function fsyncSync(fd: number): void; + export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; + export function write(fd: number, buffer: Buffer, offset: number, length: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; + export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; + export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void; + export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; + /* + * Asynchronous readFile - Asynchronously reads the entire contents of a file. + * + * @param fileName + * @param encoding + * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. + */ + export function readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + /* + * Asynchronous readFile - Asynchronously reads the entire contents of a file. + * + * @param fileName + * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer. + * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. + */ + export function readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + /* + * Asynchronous readFile - Asynchronously reads the entire contents of a file. + * + * @param fileName + * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer. + * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. + */ + export function readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + /* + * Asynchronous readFile - Asynchronously reads the entire contents of a file. + * + * @param fileName + * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. + */ + export function readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + /* + * Synchronous readFile - Synchronously reads the entire contents of a file. + * + * @param fileName + * @param encoding + */ + export function readFileSync(filename: string, encoding: string): string; + /* + * Synchronous readFile - Synchronously reads the entire contents of a file. + * + * @param fileName + * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer. + */ + export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string; + /* + * Synchronous readFile - Synchronously reads the entire contents of a file. + * + * @param fileName + * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer. + */ + export function readFileSync(filename: string, options?: { flag?: string; }): Buffer; + export function writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; + export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; + export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; + export function appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; + export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; + export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void; + export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void; + export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void; + export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher; + export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; + export function exists(path: string, callback?: (exists: boolean) => void): void; + export function existsSync(path: string): boolean; + /** Constant for fs.access(). File is visible to the calling process. */ + export var F_OK: number; + /** Constant for fs.access(). File can be read by the calling process. */ + export var R_OK: number; + /** Constant for fs.access(). File can be written by the calling process. */ + export var W_OK: number; + /** Constant for fs.access(). File can be executed by the calling process. */ + export var X_OK: number; + /** Tests a user's permissions for the file specified by path. */ + export function access(path: string, callback: (err: NodeJS.ErrnoException) => void): void; + export function access(path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void): void; + /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */ + export function accessSync(path: string, mode ?: number): void; + export function createReadStream(path: string, options?: { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + }): ReadStream; + export function createWriteStream(path: string, options?: { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + }): WriteStream; +} + +declare module "path" { + + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + export interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param p string path to normalize. + */ + export function normalize(p: string): string; + /** + * Join all arguments together and normalize the resulting path. + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. + * + * @param paths string paths to join. + */ + export function join(...paths: any[]): string; + /** + * Join all arguments together and normalize the resulting path. + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. + * + * @param paths string paths to join. + */ + export function join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} paramter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param pathSegments string paths to join. Non-string arguments are ignored. + */ + export function resolve(...pathSegments: any[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * @param path path to test. + */ + export function isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to}. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + * + * @param from + * @param to + */ + export function relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param p the path to evaluate. + */ + export function dirname(p: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param p the path to evaluate. + * @param ext optionally, an extension to remove from the result. + */ + export function basename(p: string, ext?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string + * + * @param p the path to evaluate. + */ + export function extname(p: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + export var sep: string; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + export var delimiter: string; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param pathString path to evaluate. + */ + export function parse(pathString: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathString path to evaluate. + */ + export function format(pathObject: ParsedPath): string; + + export module posix { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; + } + + export module win32 { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; + } +} + +declare module "string_decoder" { + export interface NodeStringDecoder { + write(buffer: Buffer): string; + detectIncompleteChar(buffer: Buffer): number; + } + export var StringDecoder: { + new (encoding: string): NodeStringDecoder; + }; +} + +declare module "tls" { + import * as crypto from "crypto"; + import * as net from "net"; + import * as stream from "stream"; + + var CLIENT_RENEG_LIMIT: number; + var CLIENT_RENEG_WINDOW: number; + + export interface TlsOptions { + host?: string; + port?: number; + pfx?: any; //string or buffer + key?: any; //string or buffer + passphrase?: string; + cert?: any; + ca?: any; //string or buffer + crl?: any; //string or string array + ciphers?: string; + honorCipherOrder?: any; + requestCert?: boolean; + rejectUnauthorized?: boolean; + NPNProtocols?: any; //array or Buffer; + SNICallback?: (servername: string) => any; + } + + export interface ConnectionOptions { + host?: string; + port?: number; + socket?: net.Socket; + pfx?: any; //string | Buffer + key?: any; //string | Buffer + passphrase?: string; + cert?: any; //string | Buffer + ca?: any; //Array of string | Buffer + rejectUnauthorized?: boolean; + NPNProtocols?: any; //Array of string | Buffer + servername?: string; + } + + export interface Server extends net.Server { + // Extended base methods + listen(port: number, host?: string, backlog?: number, listeningListener?: Function): Server; + listen(path: string, listeningListener?: Function): Server; + listen(handle: any, listeningListener?: Function): Server; + + listen(port: number, host?: string, callback?: Function): Server; + close(): Server; + address(): { port: number; family: string; address: string; }; + addContext(hostName: string, credentials: { + key: string; + cert: string; + ca: string; + }): void; + maxConnections: number; + connections: number; + } + + export interface ClearTextStream extends stream.Duplex { + authorized: boolean; + authorizationError: Error; + getPeerCertificate(): any; + getCipher: { + name: string; + version: string; + }; + address: { + port: number; + family: string; + address: string; + }; + remoteAddress: string; + remotePort: number; + } + + export interface SecurePair { + encrypted: any; + cleartext: any; + } + + export interface SecureContextOptions { + pfx?: any; //string | buffer + key?: any; //string | buffer + passphrase?: string; + cert?: any; // string | buffer + ca?: any; // string | buffer + crl?: any; // string | string[] + ciphers?: string; + honorCipherOrder?: boolean; + } + + export interface SecureContext { + context: any; + } + + export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server; + export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream; + export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; + export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; + export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; + export function createSecureContext(details: SecureContextOptions): SecureContext; +} + +declare module "crypto" { + export interface CredentialDetails { + pfx: string; + key: string; + passphrase: string; + cert: string; + ca: any; //string | string array + crl: any; //string | string array + ciphers: string; + } + export interface Credentials { context?: any; } + export function createCredentials(details: CredentialDetails): Credentials; + export function createHash(algorithm: string): Hash; + export function createHmac(algorithm: string, key: string): Hmac; + export function createHmac(algorithm: string, key: Buffer): Hmac; + export interface Hash { + update(data: any, input_encoding?: string): Hash; + digest(encoding: 'buffer'): Buffer; + digest(encoding: string): any; + digest(): Buffer; + } + export interface Hmac extends NodeJS.ReadWriteStream { + update(data: any, input_encoding?: string): Hmac; + digest(encoding: 'buffer'): Buffer; + digest(encoding: string): any; + digest(): Buffer; + } + export function createCipher(algorithm: string, password: any): Cipher; + export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; + export interface Cipher { + update(data: Buffer): Buffer; + update(data: string, input_encoding?: string, output_encoding?: string): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding: boolean): void; + } + export function createDecipher(algorithm: string, password: any): Decipher; + export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; + export interface Decipher { + update(data: Buffer): Buffer; + update(data: string, input_encoding?: string, output_encoding?: string): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding: boolean): void; + } + export function createSign(algorithm: string): Signer; + export interface Signer extends NodeJS.WritableStream { + update(data: any): void; + sign(private_key: string, output_format: string): string; + } + export function createVerify(algorith: string): Verify; + export interface Verify extends NodeJS.WritableStream { + update(data: any): void; + verify(object: string, signature: string, signature_format?: string): boolean; + } + export function createDiffieHellman(prime_length: number): DiffieHellman; + export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman; + export interface DiffieHellman { + generateKeys(encoding?: string): string; + computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string; + getPrime(encoding?: string): string; + getGenerator(encoding: string): string; + getPublicKey(encoding?: string): string; + getPrivateKey(encoding?: string): string; + setPublicKey(public_key: string, encoding?: string): void; + setPrivateKey(public_key: string, encoding?: string): void; + } + export function getDiffieHellman(group_name: string): DiffieHellman; + export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number) : Buffer; + export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string) : Buffer; + export function randomBytes(size: number): Buffer; + export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; + export function pseudoRandomBytes(size: number): Buffer; + export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; +} + +declare module "stream" { + import * as events from "events"; + + export class Stream extends events.EventEmitter { + pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T; + } + + export interface ReadableOptions { + highWaterMark?: number; + encoding?: string; + objectMode?: boolean; + } + + export class Readable extends events.EventEmitter implements NodeJS.ReadableStream { + readable: boolean; + constructor(opts?: ReadableOptions); + _read(size: number): void; + read(size?: number): any; + setEncoding(encoding: string): void; + pause(): void; + resume(): void; + pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T; + unpipe<T extends NodeJS.WritableStream>(destination?: T): void; + unshift(chunk: any): void; + wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; + push(chunk: any, encoding?: string): boolean; + } + + export interface WritableOptions { + highWaterMark?: number; + decodeStrings?: boolean; + objectMode?: boolean; + } + + export class Writable extends events.EventEmitter implements NodeJS.WritableStream { + writable: boolean; + constructor(opts?: WritableOptions); + _write(chunk: any, encoding: string, callback: Function): void; + write(chunk: any, cb?: Function): boolean; + write(chunk: any, encoding?: string, cb?: Function): boolean; + end(): void; + end(chunk: any, cb?: Function): void; + end(chunk: any, encoding?: string, cb?: Function): void; + } + + export interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean; + } + + // Note: Duplex extends both Readable and Writable. + export class Duplex extends Readable implements NodeJS.ReadWriteStream { + writable: boolean; + constructor(opts?: DuplexOptions); + _write(chunk: any, encoding: string, callback: Function): void; + write(chunk: any, cb?: Function): boolean; + write(chunk: any, encoding?: string, cb?: Function): boolean; + end(): void; + end(chunk: any, cb?: Function): void; + end(chunk: any, encoding?: string, cb?: Function): void; + } + + export interface TransformOptions extends ReadableOptions, WritableOptions {} + + // Note: Transform lacks the _read and _write methods of Readable/Writable. + export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream { + readable: boolean; + writable: boolean; + constructor(opts?: TransformOptions); + _transform(chunk: any, encoding: string, callback: Function): void; + _flush(callback: Function): void; + read(size?: number): any; + setEncoding(encoding: string): void; + pause(): void; + resume(): void; + pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T; + unpipe<T extends NodeJS.WritableStream>(destination?: T): void; + unshift(chunk: any): void; + wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; + push(chunk: any, encoding?: string): boolean; + write(chunk: any, cb?: Function): boolean; + write(chunk: any, encoding?: string, cb?: Function): boolean; + end(): void; + end(chunk: any, cb?: Function): void; + end(chunk: any, encoding?: string, cb?: Function): void; + } + + export class PassThrough extends Transform {} +} + +declare module "util" { + export interface InspectOptions { + showHidden?: boolean; + depth?: number; + colors?: boolean; + customInspect?: boolean; + } + + export function format(format: any, ...param: any[]): string; + export function debug(string: string): void; + export function error(...param: any[]): void; + export function puts(...param: any[]): void; + export function print(...param: any[]): void; + export function log(string: string): void; + export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): string; + export function inspect(object: any, options: InspectOptions): string; + export function isArray(object: any): boolean; + export function isRegExp(object: any): boolean; + export function isDate(object: any): boolean; + export function isError(object: any): boolean; + export function inherits(constructor: any, superConstructor: any): void; + export function debuglog(key:string): (msg:string,...param: any[])=>void; +} + +declare module "assert" { + function internal (value: any, message?: string): void; + module internal { + export class AssertionError implements Error { + name: string; + message: string; + actual: any; + expected: any; + operator: string; + generatedMessage: boolean; + + constructor(options?: {message?: string; actual?: any; expected?: any; + operator?: string; stackStartFunction?: Function}); + } + + export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; + export function ok(value: any, message?: string): void; + export function equal(actual: any, expected: any, message?: string): void; + export function notEqual(actual: any, expected: any, message?: string): void; + export function deepEqual(actual: any, expected: any, message?: string): void; + export function notDeepEqual(acutal: any, expected: any, message?: string): void; + export function strictEqual(actual: any, expected: any, message?: string): void; + export function notStrictEqual(actual: any, expected: any, message?: string): void; + export function deepStrictEqual(actual: any, expected: any, message?: string): void; + export function notDeepStrictEqual(actual: any, expected: any, message?: string): void; + export var throws: { + (block: Function, message?: string): void; + (block: Function, error: Function, message?: string): void; + (block: Function, error: RegExp, message?: string): void; + (block: Function, error: (err: any) => boolean, message?: string): void; + }; + + export var doesNotThrow: { + (block: Function, message?: string): void; + (block: Function, error: Function, message?: string): void; + (block: Function, error: RegExp, message?: string): void; + (block: Function, error: (err: any) => boolean, message?: string): void; + }; + + export function ifError(value: any): void; + } + + export = internal; +} + +declare module "tty" { + import * as net from "net"; + + export function isatty(fd: number): boolean; + export interface ReadStream extends net.Socket { + isRaw: boolean; + setRawMode(mode: boolean): void; + isTTY: boolean; + } + export interface WriteStream extends net.Socket { + columns: number; + rows: number; + isTTY: boolean; + } +} + +declare module "domain" { + import * as events from "events"; + + export class Domain extends events.EventEmitter { + run(fn: Function): void; + add(emitter: events.EventEmitter): void; + remove(emitter: events.EventEmitter): void; + bind(cb: (err: Error, data: any) => any): any; + intercept(cb: (data: any) => any): any; + dispose(): void; + + addListener(event: string, listener: Function): Domain; + on(event: string, listener: Function): Domain; + once(event: string, listener: Function): Domain; + removeListener(event: string, listener: Function): Domain; + removeAllListeners(event?: string): Domain; + } + + export function create(): Domain; +} + +declare module "constants" { + export var E2BIG: number; + export var EACCES: number; + export var EADDRINUSE: number; + export var EADDRNOTAVAIL: number; + export var EAFNOSUPPORT: number; + export var EAGAIN: number; + export var EALREADY: number; + export var EBADF: number; + export var EBADMSG: number; + export var EBUSY: number; + export var ECANCELED: number; + export var ECHILD: number; + export var ECONNABORTED: number; + export var ECONNREFUSED: number; + export var ECONNRESET: number; + export var EDEADLK: number; + export var EDESTADDRREQ: number; + export var EDOM: number; + export var EEXIST: number; + export var EFAULT: number; + export var EFBIG: number; + export var EHOSTUNREACH: number; + export var EIDRM: number; + export var EILSEQ: number; + export var EINPROGRESS: number; + export var EINTR: number; + export var EINVAL: number; + export var EIO: number; + export var EISCONN: number; + export var EISDIR: number; + export var ELOOP: number; + export var EMFILE: number; + export var EMLINK: number; + export var EMSGSIZE: number; + export var ENAMETOOLONG: number; + export var ENETDOWN: number; + export var ENETRESET: number; + export var ENETUNREACH: number; + export var ENFILE: number; + export var ENOBUFS: number; + export var ENODATA: number; + export var ENODEV: number; + export var ENOENT: number; + export var ENOEXEC: number; + export var ENOLCK: number; + export var ENOLINK: number; + export var ENOMEM: number; + export var ENOMSG: number; + export var ENOPROTOOPT: number; + export var ENOSPC: number; + export var ENOSR: number; + export var ENOSTR: number; + export var ENOSYS: number; + export var ENOTCONN: number; + export var ENOTDIR: number; + export var ENOTEMPTY: number; + export var ENOTSOCK: number; + export var ENOTSUP: number; + export var ENOTTY: number; + export var ENXIO: number; + export var EOPNOTSUPP: number; + export var EOVERFLOW: number; + export var EPERM: number; + export var EPIPE: number; + export var EPROTO: number; + export var EPROTONOSUPPORT: number; + export var EPROTOTYPE: number; + export var ERANGE: number; + export var EROFS: number; + export var ESPIPE: number; + export var ESRCH: number; + export var ETIME: number; + export var ETIMEDOUT: number; + export var ETXTBSY: number; + export var EWOULDBLOCK: number; + export var EXDEV: number; + export var WSAEINTR: number; + export var WSAEBADF: number; + export var WSAEACCES: number; + export var WSAEFAULT: number; + export var WSAEINVAL: number; + export var WSAEMFILE: number; + export var WSAEWOULDBLOCK: number; + export var WSAEINPROGRESS: number; + export var WSAEALREADY: number; + export var WSAENOTSOCK: number; + export var WSAEDESTADDRREQ: number; + export var WSAEMSGSIZE: number; + export var WSAEPROTOTYPE: number; + export var WSAENOPROTOOPT: number; + export var WSAEPROTONOSUPPORT: number; + export var WSAESOCKTNOSUPPORT: number; + export var WSAEOPNOTSUPP: number; + export var WSAEPFNOSUPPORT: number; + export var WSAEAFNOSUPPORT: number; + export var WSAEADDRINUSE: number; + export var WSAEADDRNOTAVAIL: number; + export var WSAENETDOWN: number; + export var WSAENETUNREACH: number; + export var WSAENETRESET: number; + export var WSAECONNABORTED: number; + export var WSAECONNRESET: number; + export var WSAENOBUFS: number; + export var WSAEISCONN: number; + export var WSAENOTCONN: number; + export var WSAESHUTDOWN: number; + export var WSAETOOMANYREFS: number; + export var WSAETIMEDOUT: number; + export var WSAECONNREFUSED: number; + export var WSAELOOP: number; + export var WSAENAMETOOLONG: number; + export var WSAEHOSTDOWN: number; + export var WSAEHOSTUNREACH: number; + export var WSAENOTEMPTY: number; + export var WSAEPROCLIM: number; + export var WSAEUSERS: number; + export var WSAEDQUOT: number; + export var WSAESTALE: number; + export var WSAEREMOTE: number; + export var WSASYSNOTREADY: number; + export var WSAVERNOTSUPPORTED: number; + export var WSANOTINITIALISED: number; + export var WSAEDISCON: number; + export var WSAENOMORE: number; + export var WSAECANCELLED: number; + export var WSAEINVALIDPROCTABLE: number; + export var WSAEINVALIDPROVIDER: number; + export var WSAEPROVIDERFAILEDINIT: number; + export var WSASYSCALLFAILURE: number; + export var WSASERVICE_NOT_FOUND: number; + export var WSATYPE_NOT_FOUND: number; + export var WSA_E_NO_MORE: number; + export var WSA_E_CANCELLED: number; + export var WSAEREFUSED: number; + export var SIGHUP: number; + export var SIGINT: number; + export var SIGILL: number; + export var SIGABRT: number; + export var SIGFPE: number; + export var SIGKILL: number; + export var SIGSEGV: number; + export var SIGTERM: number; + export var SIGBREAK: number; + export var SIGWINCH: number; + export var SSL_OP_ALL: number; + export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + export var SSL_OP_CIPHER_SERVER_PREFERENCE: number; + export var SSL_OP_CISCO_ANYCONNECT: number; + export var SSL_OP_COOKIE_EXCHANGE: number; + export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + export var SSL_OP_EPHEMERAL_RSA: number; + export var SSL_OP_LEGACY_SERVER_CONNECT: number; + export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; + export var SSL_OP_MICROSOFT_SESS_ID_BUG: number; + export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number; + export var SSL_OP_NETSCAPE_CA_DN_BUG: number; + export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number; + export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NO_COMPRESSION: number; + export var SSL_OP_NO_QUERY_MTU: number; + export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + export var SSL_OP_NO_SSLv2: number; + export var SSL_OP_NO_SSLv3: number; + export var SSL_OP_NO_TICKET: number; + export var SSL_OP_NO_TLSv1: number; + export var SSL_OP_NO_TLSv1_1: number; + export var SSL_OP_NO_TLSv1_2: number; + export var SSL_OP_PKCS1_CHECK_1: number; + export var SSL_OP_PKCS1_CHECK_2: number; + export var SSL_OP_SINGLE_DH_USE: number; + export var SSL_OP_SINGLE_ECDH_USE: number; + export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; + export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; + export var SSL_OP_TLS_BLOCK_PADDING_BUG: number; + export var SSL_OP_TLS_D5_BUG: number; + export var SSL_OP_TLS_ROLLBACK_BUG: number; + export var ENGINE_METHOD_DSA: number; + export var ENGINE_METHOD_DH: number; + export var ENGINE_METHOD_RAND: number; + export var ENGINE_METHOD_ECDH: number; + export var ENGINE_METHOD_ECDSA: number; + export var ENGINE_METHOD_CIPHERS: number; + export var ENGINE_METHOD_DIGESTS: number; + export var ENGINE_METHOD_STORE: number; + export var ENGINE_METHOD_PKEY_METHS: number; + export var ENGINE_METHOD_PKEY_ASN1_METHS: number; + export var ENGINE_METHOD_ALL: number; + export var ENGINE_METHOD_NONE: number; + export var DH_CHECK_P_NOT_SAFE_PRIME: number; + export var DH_CHECK_P_NOT_PRIME: number; + export var DH_UNABLE_TO_CHECK_GENERATOR: number; + export var DH_NOT_SUITABLE_GENERATOR: number; + export var NPN_ENABLED: number; + export var RSA_PKCS1_PADDING: number; + export var RSA_SSLV23_PADDING: number; + export var RSA_NO_PADDING: number; + export var RSA_PKCS1_OAEP_PADDING: number; + export var RSA_X931_PADDING: number; + export var RSA_PKCS1_PSS_PADDING: number; + export var POINT_CONVERSION_COMPRESSED: number; + export var POINT_CONVERSION_UNCOMPRESSED: number; + export var POINT_CONVERSION_HYBRID: number; + export var O_RDONLY: number; + export var O_WRONLY: number; + export var O_RDWR: number; + export var S_IFMT: number; + export var S_IFREG: number; + export var S_IFDIR: number; + export var S_IFCHR: number; + export var S_IFLNK: number; + export var O_CREAT: number; + export var O_EXCL: number; + export var O_TRUNC: number; + export var O_APPEND: number; + export var F_OK: number; + export var R_OK: number; + export var W_OK: number; + export var X_OK: number; + export var UV_UDP_REUSEADDR: number; +} diff --git a/lib/decl/systemjs/systemjs.d.ts b/lib/decl/systemjs/systemjs.d.ts new file mode 100644 index 000000000..1d826aebb --- /dev/null +++ b/lib/decl/systemjs/systemjs.d.ts @@ -0,0 +1,20 @@ +interface System { + import(name: string): Promise<any>; + defined: any; + amdDefine: () => void; + amdRequire: () => void; + baseURL: string; + paths: { [key: string]: string }; + meta: { [key: string]: Object }; + config: any; + newModule(obj: Object): any; + normalizeSync(name: string): string; + set(moduleName: string, module: any) +} + + +declare var System: System; + +declare module "systemjs" { + export = System; +}
\ No newline at end of file diff --git a/lib/decl/urijs/URIjs.d.ts b/lib/decl/urijs/URIjs.d.ts new file mode 100644 index 000000000..23d79218b --- /dev/null +++ b/lib/decl/urijs/URIjs.d.ts @@ -0,0 +1,236 @@ +// Type definitions for URI.js 1.15.1 +// Project: https://github.com/medialize/URI.js +// Definitions by: RodneyJT <https://github.com/RodneyJT>, Brian Surowiec <https://github.com/xt0rted> +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// <reference path="../jquery/jquery.d.ts" /> + +declare module uri { + + interface URI { + absoluteTo(path: string): URI; + absoluteTo(path: URI): URI; + addFragment(fragment: string): URI; + addQuery(qry: string): URI; + addQuery(qry: Object): URI; + addSearch(qry: string): URI; + addSearch(key: string, value:any): URI; + addSearch(qry: Object): URI; + authority(): string; + authority(authority: string): URI; + + clone(): URI; + + directory(): string; + directory(dir: boolean): string; + directory(dir: string): URI; + domain(): string; + domain(domain: boolean): string; + domain(domain: string): URI; + + duplicateQueryParameters(val: boolean): URI; + + equals(): boolean; + equals(url: string): boolean; + + filename(): string; + filename(file: boolean): string; + filename(file: string): URI; + fragment(): string; + fragment(fragment: string): URI; + fragmentPrefix(prefix: string): URI; + + hash(): string; + hash(hash: string): URI; + host(): string; + host(host: string): URI; + hostname(): string; + hostname(hostname: string): URI; + href(): string; + href(url: string): void; + + is(qry: string): boolean; + iso8859(): URI; + + normalize(): URI; + normalizeFragment(): URI; + normalizeHash(): URI; + normalizeHostname(): URI; + normalizePath(): URI; + normalizePathname(): URI; + normalizePort(): URI; + normalizeProtocol(): URI; + normalizeQuery(): URI; + normalizeSearch(): URI; + + password(): string; + password(pw: string): URI; + path(): string; + path(path: boolean): string; + path(path: string): URI; + pathname(): string; + pathname(path: boolean): string; + pathname(path: string): URI; + port(): string; + port(port: string): URI; + protocol(): string; + protocol(protocol: string): URI; + + query(): string; + query(qry: string): URI; + query(qry: boolean): Object; + query(qry: Object): URI; + + readable(): string; + relativeTo(path: string): URI; + removeQuery(qry: string): URI; + removeQuery(qry: Object): URI; + removeSearch(qry: string): URI; + removeSearch(qry: Object): URI; + resource(): string; + resource(resource: string): URI; + + scheme(): string; + scheme(protocol: string): URI; + search(): string; + search(qry: string): URI; + search(qry: boolean): any; + search(qry: Object): URI; + segment(): string[]; + segment(segments: string[]): URI; + segment(position: number): string; + segment(position: number, level: string): URI; + segment(segment: string): URI; + setQuery(key: string, value: string): URI; + setQuery(qry: Object): URI; + setSearch(key: string, value: string): URI; + setSearch(qry: Object): URI; + subdomain(): string; + subdomain(subdomain: string): URI; + suffix(): string; + suffix(suffix: boolean): string; + suffix(suffix: string): URI; + + tld(): string; + tld(tld: boolean): string; + tld(tld: string): URI; + + unicode(): URI; + userinfo(): string; + userinfo(userinfo: string): URI; + username(): string; + username(uname: string): URI; + + valueOf(): string; + } + + interface URIOptions { + protocol?: string; + username?: string; + password?: string; + hostname?: string; + port?: string; + path?: string; + query?: string; + fragment?: string; + } + + interface URIStatic { + (): URI; + (value: string | URIOptions | HTMLElement): URI; + + new (): URI; + new (value: string | URIOptions | HTMLElement): URI; + + addQuery(data: Object, prop: string, value: string): Object; + addQuery(data: Object, qryObj: Object): Object; + + build(parts: { + protocol: string; + username: string; + password: string; + hostname: string; + port: string; + path: string; + query: string; + fragment: string; + }): string; + buildAuthority(parts: { + username?: string; + password?: string; + hostname?: string; + port?: string; + }): string; + buildHost(parts: { + hostname?: string; + port?: string; + }): string; + buildQuery(qry: Object): string; + buildQuery(qry: Object, duplicates: boolean): string; + buildUserinfo(parts: { + username?: string; + password?: string; + }): string; + + commonPath(path1: string, path2: string): string; + + decode(str: string): string; + decodeQuery(qry: string): string; + + encode(str: string): string; + encodeQuery(qry: string): string; + encodeReserved(str: string): string; + expand(template: string, vals: Object): URI; + + iso8859(): void; + + parse(url: string): { + protocol: string; + username: string; + password: string; + hostname: string; + port: string; + path: string; + query: string; + fragment: string; + }; + parseAuthority(url: string, parts: { + username?: string; + password?: string; + hostname?: string; + port?: string; + }): string; + parseHost(url: string, parts: { + hostname?: string; + port?: string; + }): string; + parseQuery(url: string): Object; + parseUserinfo(url: string, parts: { + username?: string; + password?: string; + }): string; + + removeQuery(data: Object, prop: string, value: string): Object; + removeQuery(data: Object, props: string[]): Object; + removeQuery(data: Object, props: Object): Object; + + unicode(): void; + + withinString(source: string, func: (url: string) => string): string; + } + +} + +interface JQuery { + uri(): uri.URI; +} + +declare var URI: uri.URIStatic; + +declare module 'URI' { + export = URI; +} + +declare module 'urijs' { + export = URI; +} diff --git a/lib/decl/webrtc/MediaStream.d.ts b/lib/decl/webrtc/MediaStream.d.ts new file mode 100644 index 000000000..a2306b621 --- /dev/null +++ b/lib/decl/webrtc/MediaStream.d.ts @@ -0,0 +1,199 @@ +// Type definitions for WebRTC
+// Project: http://dev.w3.org/2011/webrtc/
+// Definitions by: Ken Smith <https://github.com/smithkl42/>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+// Taken from http://dev.w3.org/2011/webrtc/editor/getusermedia.html
+// version: W3C Editor's Draft 29 June 2015
+
+interface ConstrainBooleanParameters {
+ exact?: boolean;
+ ideal?: boolean;
+}
+
+interface NumberRange {
+ max?: number;
+ min?: number;
+}
+
+interface ConstrainNumberRange extends NumberRange {
+ exact?: number;
+ ideal?: number;
+}
+
+interface ConstrainStringParameters {
+ exact?: string | string[];
+ ideal?: string | string[];
+}
+
+interface MediaStreamConstraints {
+ video?: boolean | MediaTrackConstraints;
+ audio?: boolean | MediaTrackConstraints;
+}
+
+declare module W3C {
+ type LongRange = NumberRange;
+ type DoubleRange = NumberRange;
+ type ConstrainBoolean = boolean | ConstrainBooleanParameters;
+ type ConstrainNumber = number | ConstrainNumberRange;
+ type ConstrainLong = ConstrainNumber;
+ type ConstrainDouble = ConstrainNumber;
+ type ConstrainString = string | string[] | ConstrainStringParameters;
+}
+
+interface MediaTrackConstraints extends MediaTrackConstraintSet {
+ advanced?: MediaTrackConstraintSet[];
+}
+
+interface MediaTrackConstraintSet {
+ width?: W3C.ConstrainLong;
+ height?: W3C.ConstrainLong;
+ aspectRatio?: W3C.ConstrainDouble;
+ frameRate?: W3C.ConstrainDouble;
+ facingMode?: W3C.ConstrainString;
+ volume?: W3C.ConstrainDouble;
+ sampleRate?: W3C.ConstrainLong;
+ sampleSize?: W3C.ConstrainLong;
+ echoCancellation?: W3C.ConstrainBoolean;
+ latency?: W3C.ConstrainDouble;
+ deviceId?: W3C.ConstrainString;
+ groupId?: W3C.ConstrainString;
+}
+
+interface MediaTrackSupportedConstraints {
+ width?: boolean;
+ height?: boolean;
+ aspectRatio?: boolean;
+ frameRate?: boolean;
+ facingMode?: boolean;
+ volume?: boolean;
+ sampleRate?: boolean;
+ sampleSize?: boolean;
+ echoCancellation?: boolean;
+ latency?: boolean;
+ deviceId?: boolean;
+ groupId?: boolean;
+}
+
+interface MediaStream extends EventTarget {
+ id: string;
+ active: boolean;
+
+ onactive: EventListener;
+ oninactive: EventListener;
+ onaddtrack: (event: MediaStreamTrackEvent) => any;
+ onremovetrack: (event: MediaStreamTrackEvent) => any;
+
+ clone(): MediaStream;
+ stop(): void;
+
+ getAudioTracks(): MediaStreamTrack[];
+ getVideoTracks(): MediaStreamTrack[];
+ getTracks(): MediaStreamTrack[];
+
+ getTrackById(trackId: string): MediaStreamTrack;
+
+ addTrack(track: MediaStreamTrack): void;
+ removeTrack(track: MediaStreamTrack): void;
+}
+
+interface MediaStreamTrackEvent extends Event {
+ track: MediaStreamTrack;
+}
+
+declare enum MediaStreamTrackState {
+ "live",
+ "ended"
+}
+
+interface MediaStreamTrack extends EventTarget {
+ id: string;
+ kind: string;
+ label: string;
+ enabled: boolean;
+ muted: boolean;
+ remote: boolean;
+ readyState: MediaStreamTrackState;
+
+ onmute: EventListener;
+ onunmute: EventListener;
+ onended: EventListener;
+ onoverconstrained: EventListener;
+
+ clone(): MediaStreamTrack;
+
+ stop(): void;
+
+ getCapabilities(): MediaTrackCapabilities;
+ getConstraints(): MediaTrackConstraints;
+ getSettings(): MediaTrackSettings;
+ applyConstraints(constraints: MediaTrackConstraints): Promise<void>;
+}
+
+interface MediaTrackCapabilities {
+ width: number | W3C.LongRange;
+ height: number | W3C.LongRange;
+ aspectRatio: number | W3C.DoubleRange;
+ frameRate: number | W3C.DoubleRange;
+ facingMode: string;
+ volume: number | W3C.DoubleRange;
+ sampleRate: number | W3C.LongRange;
+ sampleSize: number | W3C.LongRange;
+ echoCancellation: boolean[];
+ latency: number | W3C.DoubleRange;
+ deviceId: string;
+ groupId: string;
+}
+
+interface MediaTrackSettings {
+ width: number;
+ height: number;
+ aspectRatio: number;
+ frameRate: number;
+ facingMode: string;
+ volume: number;
+ sampleRate: number;
+ sampleSize: number;
+ echoCancellation: boolean;
+ latency: number;
+ deviceId: string;
+ groupId: string;
+}
+
+interface MediaStreamError {
+ name: string;
+ message: string;
+ constraintName: string;
+}
+
+interface NavigatorGetUserMedia {
+ (constraints: MediaStreamConstraints,
+ successCallback: (stream: MediaStream) => void,
+ errorCallback: (error: MediaStreamError) => void): void;
+}
+
+interface Navigator {
+ getUserMedia: NavigatorGetUserMedia;
+
+ webkitGetUserMedia: NavigatorGetUserMedia;
+
+ mozGetUserMedia: NavigatorGetUserMedia;
+
+ msGetUserMedia: NavigatorGetUserMedia;
+
+ mediaDevices: MediaDevices;
+}
+
+interface MediaDevices {
+ getSupportedConstraints(): MediaTrackSupportedConstraints;
+
+ getUserMedia(constraints: MediaStreamConstraints): Promise<MediaStream>;
+ enumerateDevices(): Promise<MediaDeviceInfo[]>;
+}
+
+interface MediaDeviceInfo {
+ label: string;
+ id: string;
+ kind: string;
+ facing: string;
+}
|