2016-12-15 07:03:00 +01:00
|
|
|
/*! *****************************************************************************
|
|
|
|
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.
|
|
|
|
***************************************************************************** */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <reference no-default-lib="true"/>
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////
|
2017-08-01 00:54:41 +02:00
|
|
|
/// Worker APIs
|
2016-12-15 07:03:00 +01:00
|
|
|
/////////////////////////////
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface AddEventListenerOptions extends EventListenerOptions {
|
|
|
|
once?: boolean;
|
|
|
|
passive?: boolean;
|
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface Algorithm {
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface BlobPropertyBag {
|
|
|
|
type?: string;
|
|
|
|
}
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface CacheQueryOptions {
|
2017-08-01 00:54:41 +02:00
|
|
|
cacheName?: string;
|
2017-02-15 23:44:31 +01:00
|
|
|
ignoreMethod?: boolean;
|
2017-08-01 00:54:41 +02:00
|
|
|
ignoreSearch?: boolean;
|
2017-02-15 23:44:31 +01:00
|
|
|
ignoreVary?: boolean;
|
|
|
|
}
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface ClientQueryOptions {
|
|
|
|
includeUncontrolled?: boolean;
|
|
|
|
type?: ClientTypes;
|
|
|
|
}
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface CloseEventInit extends EventInit {
|
|
|
|
code?: number;
|
|
|
|
reason?: string;
|
2017-08-01 00:54:41 +02:00
|
|
|
wasClean?: boolean;
|
2017-02-15 23:44:31 +01:00
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface DOMMatrix2DInit {
|
|
|
|
a?: number;
|
|
|
|
b?: number;
|
|
|
|
c?: number;
|
|
|
|
d?: number;
|
|
|
|
e?: number;
|
|
|
|
f?: number;
|
|
|
|
m11?: number;
|
|
|
|
m12?: number;
|
|
|
|
m21?: number;
|
|
|
|
m22?: number;
|
|
|
|
m41?: number;
|
|
|
|
m42?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DOMMatrixInit extends DOMMatrix2DInit {
|
|
|
|
is2D?: boolean;
|
|
|
|
m13?: number;
|
|
|
|
m14?: number;
|
|
|
|
m23?: number;
|
|
|
|
m24?: number;
|
|
|
|
m31?: number;
|
|
|
|
m32?: number;
|
|
|
|
m33?: number;
|
|
|
|
m34?: number;
|
|
|
|
m43?: number;
|
|
|
|
m44?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DOMPointInit {
|
|
|
|
w?: number;
|
|
|
|
x?: number;
|
|
|
|
y?: number;
|
|
|
|
z?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DOMQuadInit {
|
|
|
|
p1?: DOMPointInit;
|
|
|
|
p2?: DOMPointInit;
|
|
|
|
p3?: DOMPointInit;
|
|
|
|
p4?: DOMPointInit;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DOMRectInit {
|
|
|
|
height?: number;
|
|
|
|
width?: number;
|
|
|
|
x?: number;
|
|
|
|
y?: number;
|
|
|
|
}
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface ErrorEventInit extends EventInit {
|
|
|
|
colno?: number;
|
|
|
|
error?: any;
|
|
|
|
filename?: string;
|
|
|
|
lineno?: number;
|
|
|
|
message?: string;
|
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface EventInit {
|
|
|
|
bubbles?: boolean;
|
|
|
|
cancelable?: boolean;
|
2018-06-11 05:05:12 +02:00
|
|
|
composed?: boolean;
|
2018-03-29 02:46:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface EventListenerOptions {
|
|
|
|
capture?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ExtendableEventInit extends EventInit {
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ExtendableMessageEventInit extends ExtendableEventInit {
|
|
|
|
data?: any;
|
|
|
|
lastEventId?: string;
|
|
|
|
origin?: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
ports?: MessagePort[];
|
|
|
|
source?: Client | ServiceWorker | MessagePort;
|
2018-03-29 02:46:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface FetchEventInit extends ExtendableEventInit {
|
|
|
|
clientId?: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
preloadResponse: Promise<any>;
|
2018-03-29 02:46:57 +02:00
|
|
|
request: Request;
|
2018-06-11 05:05:12 +02:00
|
|
|
resultingClientId?: string;
|
2018-03-29 02:46:57 +02:00
|
|
|
targetClientId?: string;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface FilePropertyBag extends BlobPropertyBag {
|
|
|
|
lastModified?: number;
|
|
|
|
}
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface GetNotificationOptions {
|
|
|
|
tag?: string;
|
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface IDBIndexParameters {
|
|
|
|
multiEntry?: boolean;
|
|
|
|
unique?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IDBObjectStoreParameters {
|
|
|
|
autoIncrement?: boolean;
|
2017-12-02 20:16:59 +01:00
|
|
|
keyPath?: string | string[];
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface IDBVersionChangeEventInit extends EventInit {
|
|
|
|
newVersion?: number | null;
|
|
|
|
oldVersion?: number;
|
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface KeyAlgorithm {
|
2018-03-29 02:46:57 +02:00
|
|
|
name: string;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface MessageEventInit extends EventInit {
|
|
|
|
channel?: string;
|
|
|
|
data?: any;
|
2018-03-29 02:46:57 +02:00
|
|
|
lastEventId?: string;
|
2017-02-15 23:44:31 +01:00
|
|
|
origin?: string;
|
|
|
|
ports?: MessagePort[];
|
2018-03-29 02:46:57 +02:00
|
|
|
source?: object | null;
|
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface NavigationPreloadState {
|
|
|
|
enabled?: boolean;
|
|
|
|
headerValue?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface NotificationAction {
|
|
|
|
action: string;
|
|
|
|
icon?: string;
|
|
|
|
title: string;
|
|
|
|
}
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface NotificationEventInit extends ExtendableEventInit {
|
|
|
|
action?: string;
|
|
|
|
notification: Notification;
|
2017-02-15 23:44:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
interface NotificationOptions {
|
2018-06-11 05:05:12 +02:00
|
|
|
actions?: NotificationAction[];
|
|
|
|
badge?: string;
|
2017-08-01 00:54:41 +02:00
|
|
|
body?: string;
|
2018-03-29 02:46:57 +02:00
|
|
|
data?: any;
|
2017-04-26 23:38:47 +02:00
|
|
|
dir?: NotificationDirection;
|
2017-08-01 00:54:41 +02:00
|
|
|
icon?: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
image?: string;
|
2017-02-15 23:44:31 +01:00
|
|
|
lang?: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
renotify?: boolean;
|
|
|
|
requireInteraction?: boolean;
|
|
|
|
silent?: boolean;
|
2017-02-15 23:44:31 +01:00
|
|
|
tag?: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
timestamp?: number;
|
|
|
|
vibrate?: VibratePattern;
|
2017-02-15 23:44:31 +01:00
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface PerformanceObserverInit {
|
|
|
|
buffered?: boolean;
|
|
|
|
entryTypes: string[];
|
2017-04-26 23:38:47 +02:00
|
|
|
}
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface ProgressEventInit extends EventInit {
|
|
|
|
lengthComputable?: boolean;
|
|
|
|
loaded?: number;
|
|
|
|
total?: number;
|
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface PromiseRejectionEventInit extends EventInit {
|
|
|
|
promise: Promise<any>;
|
|
|
|
reason?: any;
|
|
|
|
}
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface PushEventInit extends ExtendableEventInit {
|
2018-06-11 05:05:12 +02:00
|
|
|
data?: PushMessageDataInit;
|
2018-03-29 02:46:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
interface PushSubscriptionChangeInit extends ExtendableEventInit {
|
|
|
|
newSubscription?: PushSubscription;
|
|
|
|
oldSubscription?: PushSubscription;
|
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface PushSubscriptionJSON {
|
|
|
|
endpoint?: string;
|
|
|
|
expirationTime?: number | null;
|
|
|
|
keys?: Record<string, string>;
|
|
|
|
}
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface PushSubscriptionOptionsInit {
|
2018-06-11 05:05:12 +02:00
|
|
|
applicationServerKey?: BufferSource | string;
|
2017-08-01 00:54:41 +02:00
|
|
|
userVisibleOnly?: boolean;
|
2017-02-15 23:44:31 +01:00
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface RegistrationOptions {
|
|
|
|
scope?: string;
|
|
|
|
type?: WorkerType;
|
|
|
|
updateViaCache?: ServiceWorkerUpdateViaCache;
|
|
|
|
}
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface RequestInit {
|
2018-06-11 05:05:12 +02:00
|
|
|
body?: BodyInit | null;
|
2017-04-26 23:38:47 +02:00
|
|
|
cache?: RequestCache;
|
2017-08-01 00:54:41 +02:00
|
|
|
credentials?: RequestCredentials;
|
2017-12-02 20:16:59 +01:00
|
|
|
headers?: HeadersInit;
|
2017-02-15 23:44:31 +01:00
|
|
|
integrity?: string;
|
|
|
|
keepalive?: boolean;
|
2017-08-01 00:54:41 +02:00
|
|
|
method?: string;
|
|
|
|
mode?: RequestMode;
|
|
|
|
redirect?: RequestRedirect;
|
|
|
|
referrer?: string;
|
|
|
|
referrerPolicy?: ReferrerPolicy;
|
2018-06-11 05:05:12 +02:00
|
|
|
signal?: object | null;
|
2017-02-15 23:44:31 +01:00
|
|
|
window?: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ResponseInit {
|
2017-12-02 20:16:59 +01:00
|
|
|
headers?: HeadersInit;
|
2017-02-15 23:44:31 +01:00
|
|
|
status?: number;
|
|
|
|
statusText?: string;
|
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface StorageEstimate {
|
|
|
|
quota?: number;
|
|
|
|
usage?: number;
|
|
|
|
}
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface SyncEventInit extends ExtendableEventInit {
|
|
|
|
lastChance?: boolean;
|
2018-03-29 02:46:57 +02:00
|
|
|
tag: string;
|
2017-02-15 23:44:31 +01:00
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface TextDecodeOptions {
|
|
|
|
stream?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface TextDecoderOptions {
|
|
|
|
fatal?: boolean;
|
|
|
|
ignoreBOM?: boolean;
|
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface EventListener {
|
|
|
|
(evt: Event): void;
|
|
|
|
}
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface AbstractWorkerEventMap {
|
|
|
|
"error": ErrorEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface AbstractWorker {
|
|
|
|
onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null;
|
|
|
|
addEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof AbstractWorkerEventMap>(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface AesCfbParams extends Algorithm {
|
|
|
|
iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface AesCmacParams extends Algorithm {
|
|
|
|
length: number;
|
|
|
|
}
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface Blob {
|
|
|
|
readonly size: number;
|
|
|
|
readonly type: string;
|
|
|
|
slice(start?: number, end?: number, contentType?: string): Blob;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var Blob: {
|
|
|
|
prototype: Blob;
|
2018-06-11 05:05:12 +02:00
|
|
|
new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface Body {
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly body: ReadableStream | null;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly bodyUsed: boolean;
|
|
|
|
arrayBuffer(): Promise<ArrayBuffer>;
|
|
|
|
blob(): Promise<Blob>;
|
|
|
|
formData(): Promise<FormData>;
|
|
|
|
json(): Promise<any>;
|
|
|
|
text(): Promise<string>;
|
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface BroadcastChannelEventMap {
|
|
|
|
"message": MessageEvent;
|
|
|
|
"messageerror": MessageEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface BroadcastChannel extends EventTarget {
|
|
|
|
/**
|
|
|
|
* Returns the channel name (as passed to the constructor).
|
|
|
|
*/
|
|
|
|
readonly name: string;
|
|
|
|
onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;
|
|
|
|
onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null;
|
|
|
|
/**
|
|
|
|
* Closes the BroadcastChannel object, opening it up to garbage collection.
|
|
|
|
*/
|
|
|
|
close(): void;
|
|
|
|
/**
|
|
|
|
* Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.
|
|
|
|
*/
|
|
|
|
postMessage(message: any): void;
|
|
|
|
addEventListener<K extends keyof BroadcastChannelEventMap>(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof BroadcastChannelEventMap>(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var BroadcastChannel: {
|
|
|
|
prototype: BroadcastChannel;
|
|
|
|
new(name: string): BroadcastChannel;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface BroadcastChannelEventMap {
|
|
|
|
message: MessageEvent;
|
|
|
|
messageerror: MessageEvent;
|
|
|
|
}
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface Cache {
|
2018-06-11 05:05:12 +02:00
|
|
|
add(request: RequestInfo): Promise<void>;
|
|
|
|
addAll(requests: RequestInfo[]): Promise<void>;
|
|
|
|
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
|
|
|
|
keys(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>;
|
|
|
|
match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>;
|
|
|
|
matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>;
|
|
|
|
put(request: RequestInfo, response: Response): Promise<void>;
|
2017-02-15 23:44:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var Cache: {
|
|
|
|
prototype: Cache;
|
|
|
|
new(): Cache;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
|
|
|
interface CacheStorage {
|
|
|
|
delete(cacheName: string): Promise<boolean>;
|
|
|
|
has(cacheName: string): Promise<boolean>;
|
2017-09-26 22:51:27 +02:00
|
|
|
keys(): Promise<string[]>;
|
2018-06-11 05:05:12 +02:00
|
|
|
match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>;
|
2017-02-15 23:44:31 +01:00
|
|
|
open(cacheName: string): Promise<Cache>;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var CacheStorage: {
|
|
|
|
prototype: CacheStorage;
|
|
|
|
new(): CacheStorage;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface Client {
|
|
|
|
readonly id: string;
|
|
|
|
readonly type: ClientTypes;
|
|
|
|
readonly url: string;
|
|
|
|
postMessage(message: any, transfer?: any[]): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var Client: {
|
|
|
|
prototype: Client;
|
|
|
|
new(): Client;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface Clients {
|
|
|
|
claim(): Promise<void>;
|
|
|
|
get(id: string): Promise<any>;
|
2018-06-11 05:05:12 +02:00
|
|
|
matchAll(options?: ClientQueryOptions): Promise<ReadonlyArray<Client>>;
|
2018-03-29 02:46:57 +02:00
|
|
|
openWindow(url: string): Promise<WindowClient | null>;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var Clients: {
|
|
|
|
prototype: Clients;
|
|
|
|
new(): Clients;
|
|
|
|
};
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface CloseEvent extends Event {
|
|
|
|
readonly code: number;
|
|
|
|
readonly reason: string;
|
|
|
|
readonly wasClean: boolean;
|
2018-03-29 02:46:57 +02:00
|
|
|
/** @deprecated */
|
2016-12-15 07:03:00 +01:00
|
|
|
initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var CloseEvent: {
|
|
|
|
prototype: CloseEvent;
|
2018-03-29 02:46:57 +02:00
|
|
|
new(type: string, eventInitDict?: CloseEventInit): CloseEvent;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface ConcatParams extends Algorithm {
|
|
|
|
algorithmId: Uint8Array;
|
|
|
|
hash?: string | Algorithm;
|
|
|
|
partyUInfo: Uint8Array;
|
|
|
|
partyVInfo: Uint8Array;
|
|
|
|
privateInfo?: Uint8Array;
|
|
|
|
publicInfo?: Uint8Array;
|
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface Console {
|
2018-03-29 02:46:57 +02:00
|
|
|
memory: any;
|
|
|
|
assert(condition?: boolean, message?: string, ...data: any[]): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
clear(): void;
|
2018-03-29 02:46:57 +02:00
|
|
|
count(label?: string): void;
|
2017-02-15 23:44:31 +01:00
|
|
|
debug(message?: any, ...optionalParams: any[]): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
dir(value?: any, ...optionalParams: any[]): void;
|
|
|
|
dirxml(value: any): void;
|
|
|
|
error(message?: any, ...optionalParams: any[]): void;
|
|
|
|
exception(message?: string, ...optionalParams: any[]): void;
|
2017-08-01 00:54:41 +02:00
|
|
|
group(groupTitle?: string, ...optionalParams: any[]): void;
|
|
|
|
groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
groupEnd(): void;
|
|
|
|
info(message?: any, ...optionalParams: any[]): void;
|
|
|
|
log(message?: any, ...optionalParams: any[]): void;
|
2018-03-29 02:46:57 +02:00
|
|
|
markTimeline(label?: string): void;
|
|
|
|
msIsIndependentlyComposed(element: object): boolean;
|
2016-12-15 07:03:00 +01:00
|
|
|
profile(reportName?: string): void;
|
|
|
|
profileEnd(): void;
|
2018-03-29 02:46:57 +02:00
|
|
|
select(element: object): void;
|
|
|
|
table(...tabularData: any[]): void;
|
|
|
|
time(label?: string): void;
|
|
|
|
timeEnd(label?: string): void;
|
|
|
|
timeStamp(label?: string): void;
|
|
|
|
timeline(label?: string): void;
|
|
|
|
timelineEnd(label?: string): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
trace(message?: any, ...optionalParams: any[]): void;
|
|
|
|
warn(message?: any, ...optionalParams: any[]): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var Console: {
|
|
|
|
prototype: Console;
|
|
|
|
new(): Console;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface CryptoKey {
|
|
|
|
readonly algorithm: KeyAlgorithm;
|
|
|
|
readonly extractable: boolean;
|
|
|
|
readonly type: string;
|
|
|
|
readonly usages: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var CryptoKey: {
|
|
|
|
prototype: CryptoKey;
|
|
|
|
new(): CryptoKey;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface DOMException {
|
|
|
|
readonly code: number;
|
|
|
|
readonly message: string;
|
|
|
|
readonly name: string;
|
|
|
|
readonly ABORT_ERR: number;
|
|
|
|
readonly DATA_CLONE_ERR: number;
|
|
|
|
readonly DOMSTRING_SIZE_ERR: number;
|
|
|
|
readonly HIERARCHY_REQUEST_ERR: number;
|
|
|
|
readonly INDEX_SIZE_ERR: number;
|
|
|
|
readonly INUSE_ATTRIBUTE_ERR: number;
|
|
|
|
readonly INVALID_ACCESS_ERR: number;
|
|
|
|
readonly INVALID_CHARACTER_ERR: number;
|
|
|
|
readonly INVALID_MODIFICATION_ERR: number;
|
|
|
|
readonly INVALID_NODE_TYPE_ERR: number;
|
|
|
|
readonly INVALID_STATE_ERR: number;
|
|
|
|
readonly NAMESPACE_ERR: number;
|
|
|
|
readonly NETWORK_ERR: number;
|
2017-08-01 00:54:41 +02:00
|
|
|
readonly NOT_FOUND_ERR: number;
|
|
|
|
readonly NOT_SUPPORTED_ERR: number;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly NO_DATA_ALLOWED_ERR: number;
|
|
|
|
readonly NO_MODIFICATION_ALLOWED_ERR: number;
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly QUOTA_EXCEEDED_ERR: number;
|
|
|
|
readonly SECURITY_ERR: number;
|
|
|
|
readonly SYNTAX_ERR: number;
|
|
|
|
readonly TIMEOUT_ERR: number;
|
|
|
|
readonly TYPE_MISMATCH_ERR: number;
|
|
|
|
readonly URL_MISMATCH_ERR: number;
|
|
|
|
readonly VALIDATION_ERR: number;
|
|
|
|
readonly WRONG_DOCUMENT_ERR: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var DOMException: {
|
|
|
|
prototype: DOMException;
|
2017-09-26 22:51:27 +02:00
|
|
|
new(message?: string, name?: string): DOMException;
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly ABORT_ERR: number;
|
|
|
|
readonly DATA_CLONE_ERR: number;
|
|
|
|
readonly DOMSTRING_SIZE_ERR: number;
|
|
|
|
readonly HIERARCHY_REQUEST_ERR: number;
|
|
|
|
readonly INDEX_SIZE_ERR: number;
|
|
|
|
readonly INUSE_ATTRIBUTE_ERR: number;
|
|
|
|
readonly INVALID_ACCESS_ERR: number;
|
|
|
|
readonly INVALID_CHARACTER_ERR: number;
|
|
|
|
readonly INVALID_MODIFICATION_ERR: number;
|
|
|
|
readonly INVALID_NODE_TYPE_ERR: number;
|
|
|
|
readonly INVALID_STATE_ERR: number;
|
|
|
|
readonly NAMESPACE_ERR: number;
|
|
|
|
readonly NETWORK_ERR: number;
|
2017-08-01 00:54:41 +02:00
|
|
|
readonly NOT_FOUND_ERR: number;
|
|
|
|
readonly NOT_SUPPORTED_ERR: number;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly NO_DATA_ALLOWED_ERR: number;
|
|
|
|
readonly NO_MODIFICATION_ALLOWED_ERR: number;
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly QUOTA_EXCEEDED_ERR: number;
|
|
|
|
readonly SECURITY_ERR: number;
|
|
|
|
readonly SYNTAX_ERR: number;
|
|
|
|
readonly TIMEOUT_ERR: number;
|
|
|
|
readonly TYPE_MISMATCH_ERR: number;
|
|
|
|
readonly URL_MISMATCH_ERR: number;
|
|
|
|
readonly VALIDATION_ERR: number;
|
|
|
|
readonly WRONG_DOCUMENT_ERR: number;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface DOMMatrix extends DOMMatrixReadOnly {
|
|
|
|
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;
|
|
|
|
invertSelf(): DOMMatrix;
|
|
|
|
multiplySelf(other?: DOMMatrixInit): DOMMatrix;
|
|
|
|
preMultiplySelf(other?: DOMMatrixInit): DOMMatrix;
|
|
|
|
rotateAxisAngleSelf(x?: number, y?: number, z?: number, angle?: number): DOMMatrix;
|
|
|
|
rotateFromVectorSelf(x?: number, y?: number): DOMMatrix;
|
|
|
|
rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;
|
|
|
|
scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
|
|
|
|
scaleSelf(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
|
|
|
|
skewXSelf(sx?: number): DOMMatrix;
|
|
|
|
skewYSelf(sy?: number): DOMMatrix;
|
|
|
|
translateSelf(tx?: number, ty?: number, tz?: number): DOMMatrix;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var DOMMatrix: {
|
|
|
|
prototype: DOMMatrix;
|
|
|
|
new(init?: string | number[]): DOMMatrix;
|
|
|
|
fromFloat32Array(array32: Float32Array): DOMMatrix;
|
|
|
|
fromFloat64Array(array64: Float64Array): DOMMatrix;
|
|
|
|
fromMatrix(other?: DOMMatrixInit): DOMMatrix;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface DOMMatrixReadOnly {
|
|
|
|
readonly a: number;
|
|
|
|
readonly b: number;
|
|
|
|
readonly c: number;
|
|
|
|
readonly d: number;
|
|
|
|
readonly e: number;
|
|
|
|
readonly f: number;
|
|
|
|
readonly is2D: boolean;
|
|
|
|
readonly isIdentity: boolean;
|
|
|
|
readonly m11: number;
|
|
|
|
readonly m12: number;
|
|
|
|
readonly m13: number;
|
|
|
|
readonly m14: number;
|
|
|
|
readonly m21: number;
|
|
|
|
readonly m22: number;
|
|
|
|
readonly m23: number;
|
|
|
|
readonly m24: number;
|
|
|
|
readonly m31: number;
|
|
|
|
readonly m32: number;
|
|
|
|
readonly m33: number;
|
|
|
|
readonly m34: number;
|
|
|
|
readonly m41: number;
|
|
|
|
readonly m42: number;
|
|
|
|
readonly m43: number;
|
|
|
|
readonly m44: number;
|
|
|
|
flipX(): DOMMatrix;
|
|
|
|
flipY(): DOMMatrix;
|
|
|
|
inverse(): DOMMatrix;
|
|
|
|
multiply(other?: DOMMatrixInit): DOMMatrix;
|
|
|
|
rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;
|
|
|
|
rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrix;
|
|
|
|
rotateFromVector(x?: number, y?: number): DOMMatrix;
|
|
|
|
scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
|
|
|
|
scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
|
|
|
|
skewX(sx?: number): DOMMatrix;
|
|
|
|
skewY(sy?: number): DOMMatrix;
|
|
|
|
toFloat32Array(): Float32Array;
|
|
|
|
toFloat64Array(): Float64Array;
|
|
|
|
toJSON(): any;
|
|
|
|
transformPoint(point?: DOMPointInit): DOMPoint;
|
|
|
|
translate(tx?: number, ty?: number, tz?: number): DOMMatrix;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var DOMMatrixReadOnly: {
|
|
|
|
prototype: DOMMatrixReadOnly;
|
|
|
|
new(init?: string | number[]): DOMMatrixReadOnly;
|
|
|
|
fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly;
|
|
|
|
fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly;
|
|
|
|
fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface DOMPoint extends DOMPointReadOnly {
|
|
|
|
w: number;
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var DOMPoint: {
|
|
|
|
prototype: DOMPoint;
|
|
|
|
new(x?: number, y?: number, z?: number, w?: number): DOMPoint;
|
|
|
|
fromPoint(other?: DOMPointInit): DOMPoint;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface DOMPointReadOnly {
|
|
|
|
readonly w: number;
|
|
|
|
readonly x: number;
|
|
|
|
readonly y: number;
|
|
|
|
readonly z: number;
|
|
|
|
matrixTransform(matrix?: DOMMatrixInit): DOMPoint;
|
|
|
|
toJSON(): any;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var DOMPointReadOnly: {
|
|
|
|
prototype: DOMPointReadOnly;
|
|
|
|
new(x?: number, y?: number, z?: number, w?: number): DOMPointReadOnly;
|
|
|
|
fromPoint(other?: DOMPointInit): DOMPointReadOnly;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface DOMQuad {
|
|
|
|
readonly p1: DOMPoint;
|
|
|
|
readonly p2: DOMPoint;
|
|
|
|
readonly p3: DOMPoint;
|
|
|
|
readonly p4: DOMPoint;
|
|
|
|
getBounds(): DOMRect;
|
|
|
|
toJSON(): any;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var DOMQuad: {
|
|
|
|
prototype: DOMQuad;
|
|
|
|
new(p1?: DOMPointInit, p2?: DOMPointInit, p3?: DOMPointInit, p4?: DOMPointInit): DOMQuad;
|
|
|
|
fromQuad(other?: DOMQuadInit): DOMQuad;
|
|
|
|
fromRect(other?: DOMRectInit): DOMQuad;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface DOMRect extends DOMRectReadOnly {
|
|
|
|
height: number;
|
|
|
|
width: number;
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var DOMRect: {
|
|
|
|
prototype: DOMRect;
|
|
|
|
new(x?: number, y?: number, width?: number, height?: number): DOMRect;
|
|
|
|
fromRect(other?: DOMRectInit): DOMRect;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface DOMRectReadOnly {
|
|
|
|
readonly bottom: number;
|
|
|
|
readonly height: number;
|
|
|
|
readonly left: number;
|
|
|
|
readonly right: number;
|
|
|
|
readonly top: number;
|
|
|
|
readonly width: number;
|
|
|
|
readonly x: number;
|
|
|
|
readonly y: number;
|
|
|
|
toJSON(): any;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var DOMRectReadOnly: {
|
|
|
|
prototype: DOMRectReadOnly;
|
|
|
|
new(x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly;
|
|
|
|
fromRect(other?: DOMRectInit): DOMRectReadOnly;
|
|
|
|
};
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface DOMStringList {
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the number of strings in strings.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly length: number;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns true if strings contains string, and false
|
|
|
|
* otherwise.
|
|
|
|
*/
|
|
|
|
contains(string: string): boolean;
|
|
|
|
/**
|
|
|
|
* Returns the string with index index from strings.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
item(index: number): string | null;
|
|
|
|
[index: number]: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var DOMStringList: {
|
|
|
|
prototype: DOMStringList;
|
|
|
|
new(): DOMStringList;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface DedicatedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {
|
|
|
|
"message": MessageEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DedicatedWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
|
onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
|
|
|
|
close(): void;
|
|
|
|
postMessage(message: any, transfer?: any[]): void;
|
|
|
|
addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var DedicatedWorkerGlobalScope: {
|
|
|
|
prototype: DedicatedWorkerGlobalScope;
|
|
|
|
new(): DedicatedWorkerGlobalScope;
|
|
|
|
};
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface DhImportKeyParams extends Algorithm {
|
|
|
|
generator: Uint8Array;
|
|
|
|
prime: Uint8Array;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DhKeyAlgorithm extends KeyAlgorithm {
|
|
|
|
generator: Uint8Array;
|
|
|
|
prime: Uint8Array;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DhKeyDeriveParams extends Algorithm {
|
|
|
|
public: CryptoKey;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DhKeyGenParams extends Algorithm {
|
|
|
|
generator: Uint8Array;
|
|
|
|
prime: Uint8Array;
|
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface ErrorEvent extends Event {
|
|
|
|
readonly colno: number;
|
|
|
|
readonly error: any;
|
|
|
|
readonly filename: string;
|
|
|
|
readonly lineno: number;
|
|
|
|
readonly message: string;
|
|
|
|
initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var ErrorEvent: {
|
|
|
|
prototype: ErrorEvent;
|
2018-03-29 02:46:57 +02:00
|
|
|
new(typeArg: string, eventInitDict?: ErrorEventInit): ErrorEvent;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface Event {
|
|
|
|
readonly bubbles: boolean;
|
2017-08-01 00:54:41 +02:00
|
|
|
cancelBubble: boolean;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly cancelable: boolean;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly composed: boolean;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly currentTarget: EventTarget | null;
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly defaultPrevented: boolean;
|
|
|
|
readonly eventPhase: number;
|
|
|
|
readonly isTrusted: boolean;
|
|
|
|
returnValue: boolean;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly srcElement: object | null;
|
|
|
|
readonly target: EventTarget | null;
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly timeStamp: number;
|
|
|
|
readonly type: string;
|
2018-03-29 02:46:57 +02:00
|
|
|
deepPath(): EventTarget[];
|
|
|
|
initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
preventDefault(): void;
|
|
|
|
stopImmediatePropagation(): void;
|
|
|
|
stopPropagation(): void;
|
|
|
|
readonly AT_TARGET: number;
|
|
|
|
readonly BUBBLING_PHASE: number;
|
|
|
|
readonly CAPTURING_PHASE: number;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly NONE: number;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var Event: {
|
|
|
|
prototype: Event;
|
2017-02-15 23:44:31 +01:00
|
|
|
new(typeArg: string, eventInitDict?: EventInit): Event;
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly AT_TARGET: number;
|
|
|
|
readonly BUBBLING_PHASE: number;
|
|
|
|
readonly CAPTURING_PHASE: number;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly NONE: number;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface EventListenerObject {
|
|
|
|
handleEvent(evt: Event): void;
|
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface EventSource extends EventTarget {
|
|
|
|
readonly CLOSED: number;
|
|
|
|
readonly CONNECTING: number;
|
|
|
|
readonly OPEN: number;
|
|
|
|
onerror: (evt: MessageEvent) => any;
|
|
|
|
onmessage: (evt: MessageEvent) => any;
|
|
|
|
onopen: (evt: MessageEvent) => any;
|
|
|
|
readonly readyState: number;
|
|
|
|
readonly url: string;
|
|
|
|
readonly withCredentials: boolean;
|
|
|
|
close(): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var EventSource: {
|
|
|
|
prototype: EventSource;
|
|
|
|
new(url: string, eventSourceInitDict?: EventSourceInit): EventSource;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface EventSourceInit {
|
|
|
|
readonly withCredentials: boolean;
|
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface EventTarget {
|
2018-03-29 02:46:57 +02:00
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
dispatchEvent(evt: Event): boolean;
|
2018-03-29 02:46:57 +02:00
|
|
|
removeEventListener(type: string, listener?: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var EventTarget: {
|
|
|
|
prototype: EventTarget;
|
|
|
|
new(): EventTarget;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface ExtendableEvent extends Event {
|
|
|
|
waitUntil(f: Promise<any>): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var ExtendableEvent: {
|
|
|
|
prototype: ExtendableEvent;
|
|
|
|
new(type: string, eventInitDict?: ExtendableEventInit): ExtendableEvent;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface ExtendableMessageEvent extends ExtendableEvent {
|
|
|
|
readonly data: any;
|
|
|
|
readonly lastEventId: string;
|
|
|
|
readonly origin: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly ports: ReadonlyArray<MessagePort>;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly source: Client | ServiceWorker | MessagePort | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var ExtendableMessageEvent: {
|
|
|
|
prototype: ExtendableMessageEvent;
|
|
|
|
new(type: string, eventInitDict?: ExtendableMessageEventInit): ExtendableMessageEvent;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface FetchEvent extends ExtendableEvent {
|
|
|
|
readonly clientId: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly preloadResponse: Promise<any>;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly request: Request;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly resultingClientId: string;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly targetClientId: string;
|
|
|
|
respondWith(r: Promise<Response>): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var FetchEvent: {
|
|
|
|
prototype: FetchEvent;
|
|
|
|
new(type: string, eventInitDict: FetchEventInit): FetchEvent;
|
|
|
|
};
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface File extends Blob {
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly lastModified: number;
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var File: {
|
|
|
|
prototype: File;
|
2018-06-11 05:05:12 +02:00
|
|
|
new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface FileList {
|
|
|
|
readonly length: number;
|
2018-03-29 02:46:57 +02:00
|
|
|
item(index: number): File | null;
|
2016-12-15 07:03:00 +01:00
|
|
|
[index: number]: File;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var FileList: {
|
|
|
|
prototype: FileList;
|
|
|
|
new(): FileList;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface FileReaderEventMap {
|
|
|
|
"abort": ProgressEvent;
|
|
|
|
"error": ProgressEvent;
|
|
|
|
"load": ProgressEvent;
|
|
|
|
"loadend": ProgressEvent;
|
|
|
|
"loadstart": ProgressEvent;
|
|
|
|
"progress": ProgressEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface FileReader extends EventTarget {
|
|
|
|
readonly error: DOMException | null;
|
2018-06-11 05:05:12 +02:00
|
|
|
onabort: ((this: FileReader, ev: ProgressEvent) => any) | null;
|
|
|
|
onerror: ((this: FileReader, ev: ProgressEvent) => any) | null;
|
|
|
|
onload: ((this: FileReader, ev: ProgressEvent) => any) | null;
|
|
|
|
onloadend: ((this: FileReader, ev: ProgressEvent) => any) | null;
|
|
|
|
onloadstart: ((this: FileReader, ev: ProgressEvent) => any) | null;
|
|
|
|
onprogress: ((this: FileReader, ev: ProgressEvent) => any) | null;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly readyState: number;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly result: string | ArrayBuffer | null;
|
2018-03-29 02:46:57 +02:00
|
|
|
abort(): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
readAsArrayBuffer(blob: Blob): void;
|
|
|
|
readAsBinaryString(blob: Blob): void;
|
|
|
|
readAsDataURL(blob: Blob): void;
|
2018-03-29 02:46:57 +02:00
|
|
|
readAsText(blob: Blob, label?: string): void;
|
|
|
|
readonly DONE: number;
|
|
|
|
readonly EMPTY: number;
|
|
|
|
readonly LOADING: number;
|
|
|
|
addEventListener<K extends keyof FileReaderEventMap>(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
2018-03-29 02:46:57 +02:00
|
|
|
removeEventListener<K extends keyof FileReaderEventMap>(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
2017-12-02 20:16:59 +01:00
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var FileReader: {
|
|
|
|
prototype: FileReader;
|
|
|
|
new(): FileReader;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly DONE: number;
|
|
|
|
readonly EMPTY: number;
|
|
|
|
readonly LOADING: number;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface FileReaderSync {
|
2018-06-11 05:05:12 +02:00
|
|
|
readAsArrayBuffer(blob: Blob): ArrayBuffer;
|
|
|
|
readAsBinaryString(blob: Blob): string;
|
2018-03-29 02:46:57 +02:00
|
|
|
readAsDataURL(blob: Blob): string;
|
2018-06-11 05:05:12 +02:00
|
|
|
readAsText(blob: Blob, label?: string): string;
|
2018-03-29 02:46:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var FileReaderSync: {
|
|
|
|
prototype: FileReaderSync;
|
|
|
|
new(): FileReaderSync;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
interface FormData {
|
|
|
|
append(name: string, value: string | Blob, fileName?: string): void;
|
2018-03-29 02:46:57 +02:00
|
|
|
delete(name: string): void;
|
|
|
|
get(name: string): FormDataEntryValue | null;
|
|
|
|
getAll(name: string): FormDataEntryValue[];
|
|
|
|
has(name: string): boolean;
|
|
|
|
set(name: string, value: string | Blob, fileName?: string): void;
|
2018-06-11 05:05:12 +02:00
|
|
|
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
2017-08-01 00:54:41 +02:00
|
|
|
declare var FormData: {
|
|
|
|
prototype: FormData;
|
2018-06-11 05:05:12 +02:00
|
|
|
new(form?: object): FormData;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface GlobalFetch {
|
|
|
|
fetch(input?: Request | string, init?: RequestInit): Promise<Response>;
|
|
|
|
}
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface Headers {
|
|
|
|
append(name: string, value: string): void;
|
|
|
|
delete(name: string): void;
|
|
|
|
get(name: string): string | null;
|
|
|
|
has(name: string): boolean;
|
|
|
|
set(name: string, value: string): void;
|
2018-06-11 05:05:12 +02:00
|
|
|
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void;
|
2017-02-15 23:44:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var Headers: {
|
|
|
|
prototype: Headers;
|
2017-12-02 20:16:59 +01:00
|
|
|
new(init?: HeadersInit): Headers;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface HkdfCtrParams extends Algorithm {
|
|
|
|
context: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
|
|
|
|
hash: string | Algorithm;
|
|
|
|
label: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IDBArrayKey extends Array<IDBValidKey> {
|
2018-03-29 02:46:57 +02:00
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface IDBCursor {
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the direction ("next", "nextunique", "prev" or "prevunique")
|
|
|
|
* of the cursor.
|
|
|
|
*/
|
2017-04-26 23:38:47 +02:00
|
|
|
readonly direction: IDBCursorDirection;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the key of the cursor.
|
|
|
|
* Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished.
|
|
|
|
*/
|
|
|
|
readonly key: IDBValidKey | IDBKeyRange;
|
|
|
|
/**
|
|
|
|
* Returns the effective key of the cursor.
|
|
|
|
* Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished.
|
|
|
|
*/
|
|
|
|
readonly primaryKey: IDBValidKey | IDBKeyRange;
|
|
|
|
/**
|
|
|
|
* Returns the IDBObjectStore or IDBIndex the cursor was opened from.
|
|
|
|
*/
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly source: IDBObjectStore | IDBIndex;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Advances the cursor through the next count records in
|
|
|
|
* range.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
advance(count: number): void;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Advances the cursor to the next record in range matching or
|
|
|
|
* after key.
|
|
|
|
*/
|
|
|
|
continue(key?: IDBValidKey | IDBKeyRange): void;
|
|
|
|
/**
|
|
|
|
* Advances the cursor to the next record in range matching
|
|
|
|
* or after key and primaryKey. Throws an "InvalidAccessError" DOMException if the source is not an index.
|
|
|
|
*/
|
|
|
|
continuePrimaryKey(key: IDBValidKey | IDBKeyRange, primaryKey: IDBValidKey | IDBKeyRange): void;
|
|
|
|
/**
|
|
|
|
* Delete the record pointed at by the cursor with a new value.
|
|
|
|
* If successful, request's result will be undefined.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
delete(): IDBRequest;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Updated the record pointed at by the cursor with a new value.
|
|
|
|
* Throws a "DataError" DOMException if the effective object store uses in-line keys and the key would have changed.
|
|
|
|
* If successful, request's result will be the record's key.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
update(value: any): IDBRequest;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var IDBCursor: {
|
|
|
|
prototype: IDBCursor;
|
|
|
|
new(): IDBCursor;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface IDBCursorWithValue extends IDBCursor {
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the cursor's current value.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly value: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var IDBCursorWithValue: {
|
|
|
|
prototype: IDBCursorWithValue;
|
|
|
|
new(): IDBCursorWithValue;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2016-12-15 22:46:39 +01:00
|
|
|
interface IDBDatabaseEventMap {
|
|
|
|
"abort": Event;
|
2018-06-11 05:05:12 +02:00
|
|
|
"close": Event;
|
2017-02-15 23:44:31 +01:00
|
|
|
"error": Event;
|
2018-06-11 05:05:12 +02:00
|
|
|
"versionchange": IDBVersionChangeEvent;
|
2016-12-15 22:46:39 +01:00
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface IDBDatabase extends EventTarget {
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the name of the database.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly name: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns a list of the names of object stores in the database.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly objectStoreNames: DOMStringList;
|
2018-03-29 02:46:57 +02:00
|
|
|
onabort: ((this: IDBDatabase, ev: Event) => any) | null;
|
2018-06-11 05:05:12 +02:00
|
|
|
onclose: ((this: IDBDatabase, ev: Event) => any) | null;
|
2018-03-29 02:46:57 +02:00
|
|
|
onerror: ((this: IDBDatabase, ev: Event) => any) | null;
|
2018-06-11 05:05:12 +02:00
|
|
|
onversionchange: ((this: IDBDatabase, ev: IDBVersionChangeEvent) => any) | null;
|
|
|
|
/**
|
|
|
|
* Returns the version of the database.
|
|
|
|
*/
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly version: number;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Closes the connection once all running transactions have finished.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
close(): void;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Creates a new object store with the given name and options and returns a new IDBObjectStore.
|
|
|
|
* Throws a "InvalidStateError" DOMException if not called within an upgrade transaction.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Deletes the object store with the given name.
|
|
|
|
* Throws a "InvalidStateError" DOMException if not called within an upgrade transaction.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
deleteObjectStore(name: string): void;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns a new transaction with the given mode ("readonly" or "readwrite")
|
|
|
|
* and scope which can be a single object store name or an array of names.
|
|
|
|
*/
|
2017-08-01 00:54:41 +02:00
|
|
|
transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var IDBDatabase: {
|
|
|
|
prototype: IDBDatabase;
|
|
|
|
new(): IDBDatabase;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface IDBFactory {
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if
|
|
|
|
* the keys are equal.
|
|
|
|
* Throws a "DataError" DOMException if either input is not a valid key.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
cmp(first: any, second: any): number;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Attempts to delete the named database. If the
|
|
|
|
* database already exists and there are open connections that don't close in response to a versionchange event, the request will be blocked until all they close. If the request
|
|
|
|
* is successful request's result will be null.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
deleteDatabase(name: string): IDBOpenDBRequest;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Attempts to open a connection to the named database with the specified version. If the database already exists
|
|
|
|
* with a lower version and there are open connections that don't close in response to a versionchange event, the request will be blocked until all they close, then an upgrade
|
|
|
|
* will occur. If the database already exists with a higher
|
|
|
|
* version the request will fail. If the request is
|
|
|
|
* successful request's result will
|
|
|
|
* be the connection.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
open(name: string, version?: number): IDBOpenDBRequest;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var IDBFactory: {
|
|
|
|
prototype: IDBFactory;
|
|
|
|
new(): IDBFactory;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface IDBIndex {
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly keyPath: string | string[];
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly multiEntry: boolean;
|
|
|
|
/**
|
|
|
|
* Updates the name of the store to newName.
|
|
|
|
* Throws an "InvalidStateError" DOMException if not called within an upgrade
|
|
|
|
* transaction.
|
|
|
|
*/
|
|
|
|
name: string;
|
|
|
|
/**
|
|
|
|
* Returns the IDBObjectStore the index belongs to.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly objectStore: IDBObjectStore;
|
|
|
|
readonly unique: boolean;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Retrieves the number of records matching the given key or key range in query.
|
|
|
|
* If successful, request's result will be the
|
|
|
|
* count.
|
|
|
|
*/
|
|
|
|
count(key?: IDBValidKey | IDBKeyRange): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Retrieves the value of the first record matching the
|
|
|
|
* given key or key range in query.
|
|
|
|
* If successful, request's result will be the value, or undefined if there was no matching record.
|
|
|
|
*/
|
|
|
|
get(key: IDBValidKey | IDBKeyRange): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Retrieves the values of the records matching the given key or key range in query (up to count if given).
|
|
|
|
* If successful, request's result will be an Array of the values.
|
|
|
|
*/
|
|
|
|
getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Retrieves the keys of records matching the given key or key range in query (up to count if given).
|
|
|
|
* If successful, request's result will be an Array of the keys.
|
|
|
|
*/
|
|
|
|
getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Retrieves the key of the first record matching the
|
|
|
|
* given key or key range in query.
|
|
|
|
* If successful, request's result will be the key, or undefined if there was no matching record.
|
|
|
|
*/
|
|
|
|
getKey(key: IDBValidKey | IDBKeyRange): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Opens a cursor over the records matching query,
|
|
|
|
* ordered by direction. If query is null, all records in index are matched.
|
|
|
|
* If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records.
|
|
|
|
*/
|
|
|
|
openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched.
|
|
|
|
* If successful, request's result will be an IDBCursor, or null if there were no matching records.
|
|
|
|
*/
|
|
|
|
openKeyCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var IDBIndex: {
|
|
|
|
prototype: IDBIndex;
|
|
|
|
new(): IDBIndex;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface IDBKeyRange {
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns lower bound, or undefined if none.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly lower: any;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns true if the lower open flag is set, and false otherwise.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly lowerOpen: boolean;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns upper bound, or undefined if none.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly upper: any;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns true if the upper open flag is set, and false otherwise.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly upperOpen: boolean;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns true if key is included in the range, and false otherwise.
|
|
|
|
*/
|
|
|
|
includes(key: any): boolean;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var IDBKeyRange: {
|
|
|
|
prototype: IDBKeyRange;
|
|
|
|
new(): IDBKeyRange;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns a new IDBKeyRange spanning from lower to upper.
|
|
|
|
* If lowerOpen is true, lower is not included in the range.
|
|
|
|
* If upperOpen is true, upper is not included in the range.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns a new IDBKeyRange starting at key with no
|
|
|
|
* upper bound. If open is true, key is not included in the
|
|
|
|
* range.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
lowerBound(lower: any, open?: boolean): IDBKeyRange;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns a new IDBKeyRange spanning only key.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
only(value: any): IDBKeyRange;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns a new IDBKeyRange with no lower bound and ending at key. If open is true, key is not included in the range.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
upperBound(upper: any, open?: boolean): IDBKeyRange;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface IDBObjectStore {
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns true if the store has a key generator, and false otherwise.
|
|
|
|
*/
|
|
|
|
readonly autoIncrement: boolean;
|
|
|
|
/**
|
|
|
|
* Returns a list of the names of indexes in the store.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly indexNames: DOMStringList;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the key path of the store, or null if none.
|
|
|
|
*/
|
|
|
|
readonly keyPath: string | string[];
|
|
|
|
/**
|
|
|
|
* Updates the name of the store to newName.
|
|
|
|
* Throws "InvalidStateError" DOMException if not called within an upgrade
|
|
|
|
* transaction.
|
|
|
|
*/
|
|
|
|
name: string;
|
|
|
|
/**
|
|
|
|
* Returns the associated transaction.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly transaction: IDBTransaction;
|
2018-06-11 05:05:12 +02:00
|
|
|
add(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Deletes all records in store.
|
|
|
|
* If successful, request's result will
|
|
|
|
* be undefined.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
clear(): IDBRequest;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Retrieves the number of records matching the
|
|
|
|
* given key or key range in query.
|
|
|
|
* If successful, request's result will be the count.
|
|
|
|
*/
|
|
|
|
count(key?: IDBValidKey | IDBKeyRange): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be
|
|
|
|
* satisfied with the data already in store the upgrade
|
|
|
|
* transaction will abort with
|
|
|
|
* a "ConstraintError" DOMException.
|
|
|
|
* Throws an "InvalidStateError" DOMException if not called within an upgrade
|
|
|
|
* transaction.
|
|
|
|
*/
|
|
|
|
createIndex(name: string, keyPath: string | string[], options?: IDBIndexParameters): IDBIndex;
|
|
|
|
/**
|
|
|
|
* Deletes records in store with the given key or in the given key range in query.
|
|
|
|
* If successful, request's result will
|
|
|
|
* be undefined.
|
|
|
|
*/
|
|
|
|
delete(key: IDBValidKey | IDBKeyRange): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Deletes the index in store with the given name.
|
|
|
|
* Throws an "InvalidStateError" DOMException if not called within an upgrade
|
|
|
|
* transaction.
|
|
|
|
*/
|
|
|
|
deleteIndex(name: string): void;
|
|
|
|
/**
|
|
|
|
* Retrieves the value of the first record matching the
|
|
|
|
* given key or key range in query.
|
|
|
|
* If successful, request's result will be the value, or undefined if there was no matching record.
|
|
|
|
*/
|
|
|
|
get(query: IDBValidKey | IDBKeyRange): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Retrieves the values of the records matching the
|
|
|
|
* given key or key range in query (up to count if given).
|
|
|
|
* If successful, request's result will
|
|
|
|
* be an Array of the values.
|
|
|
|
*/
|
|
|
|
getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Retrieves the keys of records matching the
|
|
|
|
* given key or key range in query (up to count if given).
|
|
|
|
* If successful, request's result will
|
|
|
|
* be an Array of the keys.
|
|
|
|
*/
|
|
|
|
getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Retrieves the key of the first record matching the
|
|
|
|
* given key or key range in query.
|
|
|
|
* If successful, request's result will be the key, or undefined if there was no matching record.
|
|
|
|
*/
|
|
|
|
getKey(query: IDBValidKey | IDBKeyRange): IDBRequest;
|
2016-12-15 07:03:00 +01:00
|
|
|
index(name: string): IDBIndex;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Opens a cursor over the records matching query,
|
|
|
|
* ordered by direction. If query is null, all records in store are matched.
|
|
|
|
* If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records.
|
|
|
|
*/
|
|
|
|
openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest;
|
|
|
|
/**
|
|
|
|
* Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched.
|
|
|
|
* If successful, request's result will be an IDBCursor pointing at the first matching record, or
|
|
|
|
* null if there were no matching records.
|
|
|
|
*/
|
|
|
|
openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest;
|
|
|
|
put(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var IDBObjectStore: {
|
|
|
|
prototype: IDBObjectStore;
|
|
|
|
new(): IDBObjectStore;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2016-12-15 22:46:39 +01:00
|
|
|
interface IDBOpenDBRequestEventMap extends IDBRequestEventMap {
|
|
|
|
"blocked": Event;
|
|
|
|
"upgradeneeded": IDBVersionChangeEvent;
|
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface IDBOpenDBRequest extends IDBRequest {
|
2018-03-29 02:46:57 +02:00
|
|
|
onblocked: ((this: IDBOpenDBRequest, ev: Event) => any) | null;
|
|
|
|
onupgradeneeded: ((this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any) | null;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener<K extends keyof IDBOpenDBRequestEventMap>(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof IDBOpenDBRequestEventMap>(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var IDBOpenDBRequest: {
|
|
|
|
prototype: IDBOpenDBRequest;
|
|
|
|
new(): IDBOpenDBRequest;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2016-12-15 22:46:39 +01:00
|
|
|
interface IDBRequestEventMap {
|
2017-02-15 23:44:31 +01:00
|
|
|
"error": Event;
|
2016-12-15 22:46:39 +01:00
|
|
|
"success": Event;
|
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface IDBRequest extends EventTarget {
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* When a request is completed, returns the error (a DOMException), or null if the request succeeded. Throws
|
|
|
|
* a "InvalidStateError" DOMException if the request is still pending.
|
|
|
|
*/
|
|
|
|
readonly error: DOMException | null;
|
2018-03-29 02:46:57 +02:00
|
|
|
onerror: ((this: IDBRequest, ev: Event) => any) | null;
|
|
|
|
onsuccess: ((this: IDBRequest, ev: Event) => any) | null;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns "pending" until a request is complete,
|
|
|
|
* then returns "done".
|
|
|
|
*/
|
2017-04-26 23:38:47 +02:00
|
|
|
readonly readyState: IDBRequestReadyState;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* When a request is completed, returns the result,
|
|
|
|
* or undefined if the request failed. Throws a
|
|
|
|
* "InvalidStateError" DOMException if the request is still pending.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly result: any;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the IDBObjectStore, IDBIndex, or IDBCursor the request was made against, or null if is was an open
|
|
|
|
* request.
|
|
|
|
*/
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly source: IDBObjectStore | IDBIndex | IDBCursor;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the IDBTransaction the request was made within.
|
|
|
|
* If this as an open request, then it returns an upgrade transaction while it is running, or null otherwise.
|
|
|
|
*/
|
|
|
|
readonly transaction: IDBTransaction | null;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var IDBRequest: {
|
|
|
|
prototype: IDBRequest;
|
|
|
|
new(): IDBRequest;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2016-12-15 22:46:39 +01:00
|
|
|
interface IDBTransactionEventMap {
|
|
|
|
"abort": Event;
|
|
|
|
"complete": Event;
|
2017-02-15 23:44:31 +01:00
|
|
|
"error": Event;
|
2016-12-15 22:46:39 +01:00
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface IDBTransaction extends EventTarget {
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the transaction's connection.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly db: IDBDatabase;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* If the transaction was aborted, returns the
|
|
|
|
* error (a DOMException) providing the reason.
|
|
|
|
*/
|
2017-08-01 00:54:41 +02:00
|
|
|
readonly error: DOMException;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the mode the transaction was created with
|
|
|
|
* ("readonly" or "readwrite"), or "versionchange" for
|
|
|
|
* an upgrade transaction.
|
|
|
|
*/
|
2017-04-26 23:38:47 +02:00
|
|
|
readonly mode: IDBTransactionMode;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns a list of the names of object stores in the
|
|
|
|
* transaction's scope. For an upgrade transaction this is all object stores in the database.
|
|
|
|
*/
|
|
|
|
readonly objectStoreNames: DOMStringList;
|
2018-03-29 02:46:57 +02:00
|
|
|
onabort: ((this: IDBTransaction, ev: Event) => any) | null;
|
|
|
|
oncomplete: ((this: IDBTransaction, ev: Event) => any) | null;
|
|
|
|
onerror: ((this: IDBTransaction, ev: Event) => any) | null;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Aborts the transaction. All pending requests will fail with
|
|
|
|
* a "AbortError" DOMException and all changes made to the database will be
|
|
|
|
* reverted.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
abort(): void;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns an IDBObjectStore in the transaction's scope.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
objectStore(name: string): IDBObjectStore;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener<K extends keyof IDBTransactionEventMap>(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof IDBTransactionEventMap>(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var IDBTransaction: {
|
|
|
|
prototype: IDBTransaction;
|
|
|
|
new(): IDBTransaction;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface IDBVersionChangeEvent extends Event {
|
|
|
|
readonly newVersion: number | null;
|
|
|
|
readonly oldVersion: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var IDBVersionChangeEvent: {
|
|
|
|
prototype: IDBVersionChangeEvent;
|
2018-06-11 05:05:12 +02:00
|
|
|
new(type: string, eventInitDict?: IDBVersionChangeEventInit): IDBVersionChangeEvent;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface ImageBitmap {
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly height: number;
|
|
|
|
readonly width: number;
|
2018-03-29 02:46:57 +02:00
|
|
|
close(): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface ImageBitmapOptions {
|
|
|
|
colorSpaceConversion?: "none" | "default";
|
|
|
|
imageOrientation?: "none" | "flipY";
|
|
|
|
premultiplyAlpha?: "none" | "premultiply" | "default";
|
|
|
|
resizeHeight?: number;
|
|
|
|
resizeQuality?: "pixelated" | "low" | "medium" | "high";
|
|
|
|
resizeWidth?: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ImageData {
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var ImageData: {
|
|
|
|
prototype: ImageData;
|
|
|
|
new(width: number, height: number): ImageData;
|
|
|
|
new(array: Uint8ClampedArray, width: number, height: number): ImageData;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface MessageChannel {
|
|
|
|
readonly port1: MessagePort;
|
|
|
|
readonly port2: MessagePort;
|
|
|
|
}
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
declare var MessageChannel: {
|
|
|
|
prototype: MessageChannel;
|
|
|
|
new(): MessageChannel;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface MessageEvent extends Event {
|
|
|
|
readonly data: any;
|
|
|
|
readonly origin: string;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly ports: ReadonlyArray<MessagePort>;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly source: MessageEventSource;
|
2018-03-29 02:46:57 +02:00
|
|
|
initMessageEvent(type: string, bubbles: boolean, cancelable: boolean, data: any, origin: string, lastEventId: string, source: object): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var MessageEvent: {
|
|
|
|
prototype: MessageEvent;
|
|
|
|
new(type: string, eventInitDict?: MessageEventInit): MessageEvent;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2016-12-15 22:46:39 +01:00
|
|
|
interface MessagePortEventMap {
|
|
|
|
"message": MessageEvent;
|
2018-06-11 05:05:12 +02:00
|
|
|
"messageerror": MessageEvent;
|
2016-12-15 22:46:39 +01:00
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface MessagePort extends EventTarget {
|
2018-03-29 02:46:57 +02:00
|
|
|
onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null;
|
2018-06-11 05:05:12 +02:00
|
|
|
onmessageerror: ((this: MessagePort, ev: MessageEvent) => any) | null;
|
|
|
|
/**
|
|
|
|
* Disconnects the port, so that it is no longer active.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
close(): void;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Posts a message through the channel. Objects listed in transfer are
|
|
|
|
* transferred, not just cloned, meaning that they are no longer usable on the sending side.
|
|
|
|
* Throws a "DataCloneError" DOMException if
|
|
|
|
* transfer contains duplicate objects or port, or if message
|
|
|
|
* could not be cloned.
|
|
|
|
*/
|
|
|
|
postMessage(message: any, transfer?: any[]): void;
|
|
|
|
/**
|
|
|
|
* Begins dispatching messages received on the port.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
start(): void;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener<K extends keyof MessagePortEventMap>(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof MessagePortEventMap>(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var MessagePort: {
|
|
|
|
prototype: MessagePort;
|
|
|
|
new(): MessagePort;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface NavigationPreloadManager {
|
|
|
|
disable(): Promise<void>;
|
|
|
|
enable(): Promise<void>;
|
|
|
|
getState(): Promise<NavigationPreloadState>;
|
|
|
|
setHeaderValue(value: string): Promise<void>;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var NavigationPreloadManager: {
|
|
|
|
prototype: NavigationPreloadManager;
|
|
|
|
new(): NavigationPreloadManager;
|
|
|
|
};
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface NavigatorBeacon {
|
|
|
|
sendBeacon(url: string, data?: Blob | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | FormData | string | null): boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface NavigatorConcurrentHardware {
|
|
|
|
readonly hardwareConcurrency: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface NavigatorID {
|
|
|
|
readonly appCodeName: string;
|
|
|
|
readonly appName: string;
|
|
|
|
readonly appVersion: string;
|
|
|
|
readonly platform: string;
|
|
|
|
readonly product: string;
|
|
|
|
readonly productSub: string;
|
|
|
|
readonly userAgent: string;
|
|
|
|
readonly vendor: string;
|
|
|
|
readonly vendorSub: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface NavigatorOnLine {
|
|
|
|
readonly onLine: boolean;
|
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface NavigatorStorage {
|
|
|
|
readonly storage: StorageManager;
|
|
|
|
}
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface NotificationEventMap {
|
|
|
|
"click": Event;
|
|
|
|
"close": Event;
|
|
|
|
"error": Event;
|
|
|
|
"show": Event;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Notification extends EventTarget {
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly actions: ReadonlyArray<NotificationAction>;
|
|
|
|
readonly badge: string;
|
|
|
|
readonly body: string;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly data: any;
|
2017-04-26 23:38:47 +02:00
|
|
|
readonly dir: NotificationDirection;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly icon: string;
|
|
|
|
readonly image: string;
|
|
|
|
readonly lang: string;
|
2018-03-29 02:46:57 +02:00
|
|
|
onclick: ((this: Notification, ev: Event) => any) | null;
|
|
|
|
onclose: ((this: Notification, ev: Event) => any) | null;
|
|
|
|
onerror: ((this: Notification, ev: Event) => any) | null;
|
|
|
|
onshow: ((this: Notification, ev: Event) => any) | null;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly renotify: boolean;
|
|
|
|
readonly requireInteraction: boolean;
|
|
|
|
readonly silent: boolean;
|
|
|
|
readonly tag: string;
|
|
|
|
readonly timestamp: number;
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly title: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly vibrate: ReadonlyArray<number>;
|
2017-02-15 23:44:31 +01:00
|
|
|
close(): void;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener<K extends keyof NotificationEventMap>(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof NotificationEventMap>(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2017-02-15 23:44:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var Notification: {
|
|
|
|
prototype: Notification;
|
|
|
|
new(title: string, options?: NotificationOptions): Notification;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly maxActions: number;
|
|
|
|
readonly permission: NotificationPermission;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface NotificationEvent extends ExtendableEvent {
|
|
|
|
readonly action: string;
|
|
|
|
readonly notification: Notification;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var NotificationEvent: {
|
|
|
|
prototype: NotificationEvent;
|
|
|
|
new(type: string, eventInitDict: NotificationEventInit): NotificationEvent;
|
|
|
|
};
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface PerformanceEventMap {
|
|
|
|
"resourcetimingbufferfull": Event;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Performance extends EventTarget {
|
|
|
|
onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly timeOrigin: number;
|
2017-02-15 23:44:31 +01:00
|
|
|
clearMarks(markName?: string): void;
|
|
|
|
clearMeasures(measureName?: string): void;
|
|
|
|
clearResourceTimings(): void;
|
2018-06-11 05:05:12 +02:00
|
|
|
getEntries(): PerformanceEntryList;
|
|
|
|
getEntriesByName(name: string, type?: string): PerformanceEntryList;
|
|
|
|
getEntriesByType(type: string): PerformanceEntryList;
|
2017-02-15 23:44:31 +01:00
|
|
|
mark(markName: string): void;
|
2018-06-11 05:05:12 +02:00
|
|
|
measure(measureName: string, startMark?: string, endMark?: string): void;
|
2017-02-15 23:44:31 +01:00
|
|
|
now(): number;
|
|
|
|
setResourceTimingBufferSize(maxSize: number): void;
|
|
|
|
toJSON(): any;
|
2018-06-11 05:05:12 +02:00
|
|
|
addEventListener<K extends keyof PerformanceEventMap>(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof PerformanceEventMap>(type: K, listener: (this: Performance, ev: PerformanceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2017-02-15 23:44:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var Performance: {
|
|
|
|
prototype: Performance;
|
|
|
|
new(): Performance;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface PerformanceEntry {
|
|
|
|
readonly duration: number;
|
|
|
|
readonly entryType: string;
|
|
|
|
readonly name: string;
|
|
|
|
readonly startTime: number;
|
2017-02-15 23:44:31 +01:00
|
|
|
toJSON(): any;
|
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
declare var PerformanceEntry: {
|
|
|
|
prototype: PerformanceEntry;
|
|
|
|
new(): PerformanceEntry;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface PerformanceMark extends PerformanceEntry {
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var PerformanceMark: {
|
|
|
|
prototype: PerformanceMark;
|
|
|
|
new(): PerformanceMark;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface PerformanceMeasure extends PerformanceEntry {
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var PerformanceMeasure: {
|
|
|
|
prototype: PerformanceMeasure;
|
|
|
|
new(): PerformanceMeasure;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface PerformanceObserver {
|
|
|
|
disconnect(): void;
|
|
|
|
observe(options: PerformanceObserverInit): void;
|
|
|
|
takeRecords(): PerformanceEntryList;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var PerformanceObserver: {
|
|
|
|
prototype: PerformanceObserver;
|
|
|
|
new(callback: PerformanceObserverCallback): PerformanceObserver;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface PerformanceObserverEntryList {
|
|
|
|
getEntries(): PerformanceEntryList;
|
|
|
|
getEntriesByName(name: string, type?: string): PerformanceEntryList;
|
|
|
|
getEntriesByType(type: string): PerformanceEntryList;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var PerformanceObserverEntryList: {
|
|
|
|
prototype: PerformanceObserverEntryList;
|
|
|
|
new(): PerformanceObserverEntryList;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface PerformanceResourceTiming extends PerformanceEntry {
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly connectEnd: number;
|
|
|
|
readonly connectStart: number;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly decodedBodySize: number;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly domainLookupEnd: number;
|
|
|
|
readonly domainLookupStart: number;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly encodedBodySize: number;
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly fetchStart: number;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly initiatorType: string;
|
|
|
|
readonly nextHopProtocol: string;
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly redirectEnd: number;
|
|
|
|
readonly redirectStart: number;
|
|
|
|
readonly requestStart: number;
|
|
|
|
readonly responseEnd: number;
|
|
|
|
readonly responseStart: number;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly secureConnectionStart: number;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly transferSize: number;
|
|
|
|
readonly workerStart: number;
|
2017-02-15 23:44:31 +01:00
|
|
|
toJSON(): any;
|
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
declare var PerformanceResourceTiming: {
|
|
|
|
prototype: PerformanceResourceTiming;
|
|
|
|
new(): PerformanceResourceTiming;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
|
|
|
interface ProgressEvent extends Event {
|
|
|
|
readonly lengthComputable: boolean;
|
|
|
|
readonly loaded: number;
|
|
|
|
readonly total: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var ProgressEvent: {
|
|
|
|
prototype: ProgressEvent;
|
2018-06-11 05:05:12 +02:00
|
|
|
new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface PromiseRejectionEvent extends Event {
|
|
|
|
readonly promise: PromiseLike<any>;
|
|
|
|
readonly reason: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var PromiseRejectionEvent: {
|
|
|
|
prototype: PromiseRejectionEvent;
|
|
|
|
new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent;
|
2018-03-29 02:46:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
interface PushEvent extends ExtendableEvent {
|
|
|
|
readonly data: PushMessageData | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var PushEvent: {
|
|
|
|
prototype: PushEvent;
|
|
|
|
new(type: string, eventInitDict?: PushEventInit): PushEvent;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface PushManager {
|
2018-02-21 18:12:48 +01:00
|
|
|
getSubscription(): Promise<PushSubscription | null>;
|
2017-04-26 23:38:47 +02:00
|
|
|
permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>;
|
2017-02-15 23:44:31 +01:00
|
|
|
subscribe(options?: PushSubscriptionOptionsInit): Promise<PushSubscription>;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var PushManager: {
|
|
|
|
prototype: PushManager;
|
|
|
|
new(): PushManager;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly supportedContentEncodings: ReadonlyArray<string>;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface PushMessageData {
|
|
|
|
arrayBuffer(): ArrayBuffer;
|
|
|
|
blob(): Blob;
|
|
|
|
json(): any;
|
|
|
|
text(): string;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var PushMessageData: {
|
|
|
|
prototype: PushMessageData;
|
|
|
|
new(): PushMessageData;
|
|
|
|
};
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface PushSubscription {
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly endpoint: string;
|
|
|
|
readonly expirationTime: number | null;
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly options: PushSubscriptionOptions;
|
2017-04-26 23:38:47 +02:00
|
|
|
getKey(name: PushEncryptionKeyName): ArrayBuffer | null;
|
2018-06-11 05:05:12 +02:00
|
|
|
toJSON(): PushSubscriptionJSON;
|
2017-02-15 23:44:31 +01:00
|
|
|
unsubscribe(): Promise<boolean>;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var PushSubscription: {
|
|
|
|
prototype: PushSubscription;
|
|
|
|
new(): PushSubscription;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface PushSubscriptionChangeEvent extends ExtendableEvent {
|
|
|
|
readonly newSubscription: PushSubscription | null;
|
|
|
|
readonly oldSubscription: PushSubscription | null;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var PushSubscriptionChangeEvent: {
|
|
|
|
prototype: PushSubscriptionChangeEvent;
|
|
|
|
new(type: string, eventInitDict?: PushSubscriptionChangeInit): PushSubscriptionChangeEvent;
|
|
|
|
};
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface PushSubscriptionOptions {
|
|
|
|
readonly applicationServerKey: ArrayBuffer | null;
|
|
|
|
readonly userVisibleOnly: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var PushSubscriptionOptions: {
|
|
|
|
prototype: PushSubscriptionOptions;
|
|
|
|
new(): PushSubscriptionOptions;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
|
|
|
interface ReadableStream {
|
|
|
|
readonly locked: boolean;
|
|
|
|
cancel(): Promise<void>;
|
|
|
|
getReader(): ReadableStreamReader;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var ReadableStream: {
|
|
|
|
prototype: ReadableStream;
|
|
|
|
new(): ReadableStream;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
|
|
|
interface ReadableStreamReader {
|
|
|
|
cancel(): Promise<void>;
|
|
|
|
read(): Promise<any>;
|
|
|
|
releaseLock(): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var ReadableStreamReader: {
|
|
|
|
prototype: ReadableStreamReader;
|
|
|
|
new(): ReadableStreamReader;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface Request extends Body {
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the cache mode associated with request, which is a string indicating
|
|
|
|
* how the the request will interact with the browser's cache when fetching.
|
|
|
|
*/
|
2017-04-26 23:38:47 +02:00
|
|
|
readonly cache: RequestCache;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the credentials mode associated with request, which is a string
|
|
|
|
* indicating whether credentials will be sent with the request always, never, or only when sent to a
|
|
|
|
* same-origin URL.
|
|
|
|
*/
|
2017-04-26 23:38:47 +02:00
|
|
|
readonly credentials: RequestCredentials;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the kind of resource requested by request, e.g., "document" or
|
|
|
|
* "script".
|
|
|
|
*/
|
2017-04-26 23:38:47 +02:00
|
|
|
readonly destination: RequestDestination;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns a Headers object consisting of the headers associated with request.
|
|
|
|
* Note that headers added in the network layer by the user agent will not be accounted for in this
|
|
|
|
* object, e.g., the "Host" header.
|
|
|
|
*/
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly headers: Headers;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns request's subresource integrity metadata, which is a cryptographic hash of
|
|
|
|
* the resource being fetched. Its value consists of multiple hashes separated by whitespace. [SRI]
|
|
|
|
*/
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly integrity: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns a boolean indicating whether or not request is for a history
|
|
|
|
* navigation (a.k.a. back-foward navigation).
|
|
|
|
*/
|
|
|
|
readonly isHistoryNavigation: boolean;
|
|
|
|
/**
|
|
|
|
* Returns a boolean indicating whether or not request is for a reload navigation.
|
|
|
|
*/
|
|
|
|
readonly isReloadNavigation: boolean;
|
|
|
|
/**
|
|
|
|
* Returns a boolean indicating whether or not request can outlive the global in which
|
|
|
|
* it was created.
|
|
|
|
*/
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly keepalive: boolean;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns request's HTTP method, which is "GET" by default.
|
|
|
|
*/
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly method: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the mode associated with request, which is a string indicating
|
|
|
|
* whether the request will use CORS, or will be restricted to same-origin URLs.
|
|
|
|
*/
|
2017-04-26 23:38:47 +02:00
|
|
|
readonly mode: RequestMode;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the redirect mode associated with request, which is a string
|
|
|
|
* indicating how redirects for the request will be handled during fetching. A request will follow redirects by default.
|
|
|
|
*/
|
2017-04-26 23:38:47 +02:00
|
|
|
readonly redirect: RequestRedirect;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the referrer of request. Its value can be a same-origin URL if
|
|
|
|
* explicitly set in init, the empty string to indicate no referrer, and
|
|
|
|
* "about:client" when defaulting to the global's default. This is used during
|
|
|
|
* fetching to determine the value of the `Referer` header of the request being made.
|
|
|
|
*/
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly referrer: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the referrer policy associated with request. This is used during
|
|
|
|
* fetching to compute the value of the request's referrer.
|
|
|
|
*/
|
2017-04-26 23:38:47 +02:00
|
|
|
readonly referrerPolicy: ReferrerPolicy;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort
|
|
|
|
* event handler.
|
|
|
|
*/
|
|
|
|
readonly signal: object;
|
|
|
|
/**
|
|
|
|
* Returns the URL of request as a string.
|
|
|
|
*/
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly url: string;
|
|
|
|
clone(): Request;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var Request: {
|
|
|
|
prototype: Request;
|
2018-06-11 05:05:12 +02:00
|
|
|
new(input: RequestInfo, init?: RequestInit): Request;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface Response extends Body {
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly headers: Headers;
|
|
|
|
readonly ok: boolean;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly redirected: boolean;
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly status: number;
|
|
|
|
readonly statusText: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly trailer: Promise<Headers>;
|
2017-04-26 23:38:47 +02:00
|
|
|
readonly type: ResponseType;
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly url: string;
|
|
|
|
clone(): Response;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var Response: {
|
|
|
|
prototype: Response;
|
2018-06-11 05:05:12 +02:00
|
|
|
new(body?: BodyInit | null, init?: ResponseInit): Response;
|
2018-03-29 02:46:57 +02:00
|
|
|
error(): Response;
|
|
|
|
redirect(url: string, status?: number): Response;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
|
|
|
interface ServiceWorkerEventMap extends AbstractWorkerEventMap {
|
|
|
|
"statechange": Event;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ServiceWorker extends EventTarget, AbstractWorker {
|
2018-03-29 02:46:57 +02:00
|
|
|
onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;
|
|
|
|
readonly scriptURL: string;
|
2017-04-26 23:38:47 +02:00
|
|
|
readonly state: ServiceWorkerState;
|
2017-02-15 23:44:31 +01:00
|
|
|
postMessage(message: any, transfer?: any[]): void;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2017-02-15 23:44:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var ServiceWorker: {
|
|
|
|
prototype: ServiceWorker;
|
|
|
|
new(): ServiceWorker;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface ServiceWorkerContainerEventMap {
|
|
|
|
"controllerchange": Event;
|
|
|
|
"message": MessageEvent;
|
|
|
|
"messageerror": MessageEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ServiceWorkerContainer extends EventTarget {
|
|
|
|
readonly controller: ServiceWorker | null;
|
|
|
|
oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null;
|
|
|
|
onmessage: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null;
|
|
|
|
onmessageerror: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null;
|
|
|
|
readonly ready: Promise<ServiceWorkerRegistration>;
|
|
|
|
getRegistration(clientURL?: string): Promise<ServiceWorkerRegistration | undefined>;
|
|
|
|
getRegistrations(): Promise<ReadonlyArray<ServiceWorkerRegistration>>;
|
|
|
|
register(scriptURL: string, options?: RegistrationOptions): Promise<ServiceWorkerRegistration>;
|
|
|
|
startMessages(): void;
|
|
|
|
addEventListener<K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof ServiceWorkerContainerEventMap>(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var ServiceWorkerContainer: {
|
|
|
|
prototype: ServiceWorkerContainer;
|
|
|
|
new(): ServiceWorkerContainer;
|
|
|
|
};
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface ServiceWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap {
|
|
|
|
"activate": ExtendableEvent;
|
|
|
|
"fetch": FetchEvent;
|
|
|
|
"install": ExtendableEvent;
|
|
|
|
"message": ExtendableMessageEvent;
|
|
|
|
"messageerror": MessageEvent;
|
|
|
|
"notificationclick": NotificationEvent;
|
|
|
|
"notificationclose": NotificationEvent;
|
|
|
|
"push": PushEvent;
|
|
|
|
"pushsubscriptionchange": PushSubscriptionChangeEvent;
|
|
|
|
"sync": SyncEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
|
readonly clients: Clients;
|
|
|
|
onactivate: ((this: ServiceWorkerGlobalScope, ev: ExtendableEvent) => any) | null;
|
|
|
|
onfetch: ((this: ServiceWorkerGlobalScope, ev: FetchEvent) => any) | null;
|
|
|
|
oninstall: ((this: ServiceWorkerGlobalScope, ev: ExtendableEvent) => any) | null;
|
|
|
|
onmessage: ((this: ServiceWorkerGlobalScope, ev: ExtendableMessageEvent) => any) | null;
|
|
|
|
onmessageerror: ((this: ServiceWorkerGlobalScope, ev: MessageEvent) => any) | null;
|
|
|
|
onnotificationclick: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;
|
|
|
|
onnotificationclose: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;
|
|
|
|
onpush: ((this: ServiceWorkerGlobalScope, ev: PushEvent) => any) | null;
|
|
|
|
onpushsubscriptionchange: ((this: ServiceWorkerGlobalScope, ev: PushSubscriptionChangeEvent) => any) | null;
|
|
|
|
onsync: ((this: ServiceWorkerGlobalScope, ev: SyncEvent) => any) | null;
|
|
|
|
readonly registration: ServiceWorkerRegistration;
|
|
|
|
skipWaiting(): Promise<void>;
|
|
|
|
addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var ServiceWorkerGlobalScope: {
|
|
|
|
prototype: ServiceWorkerGlobalScope;
|
|
|
|
new(): ServiceWorkerGlobalScope;
|
|
|
|
};
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface ServiceWorkerRegistrationEventMap {
|
|
|
|
"updatefound": Event;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ServiceWorkerRegistration extends EventTarget {
|
|
|
|
readonly active: ServiceWorker | null;
|
|
|
|
readonly installing: ServiceWorker | null;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly navigationPreload: NavigationPreloadManager;
|
2018-03-29 02:46:57 +02:00
|
|
|
onupdatefound: ((this: ServiceWorkerRegistration, ev: Event) => any) | null;
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly pushManager: PushManager;
|
2018-03-29 02:46:57 +02:00
|
|
|
readonly scope: string;
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly sync: SyncManager;
|
2018-06-11 05:05:12 +02:00
|
|
|
readonly updateViaCache: ServiceWorkerUpdateViaCache;
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly waiting: ServiceWorker | null;
|
2017-09-26 22:51:27 +02:00
|
|
|
getNotifications(filter?: GetNotificationOptions): Promise<Notification[]>;
|
2017-02-15 23:44:31 +01:00
|
|
|
showNotification(title: string, options?: NotificationOptions): Promise<void>;
|
|
|
|
unregister(): Promise<boolean>;
|
|
|
|
update(): Promise<void>;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2017-02-15 23:44:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var ServiceWorkerRegistration: {
|
|
|
|
prototype: ServiceWorkerRegistration;
|
|
|
|
new(): ServiceWorkerRegistration;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface StorageManager {
|
|
|
|
estimate(): Promise<StorageEstimate>;
|
|
|
|
persisted(): Promise<boolean>;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var StorageManager: {
|
|
|
|
prototype: StorageManager;
|
|
|
|
new(): StorageManager;
|
|
|
|
};
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface SyncEvent extends ExtendableEvent {
|
|
|
|
readonly lastChance: boolean;
|
|
|
|
readonly tag: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var SyncEvent: {
|
|
|
|
prototype: SyncEvent;
|
|
|
|
new(type: string, init: SyncEventInit): SyncEvent;
|
|
|
|
};
|
|
|
|
|
2017-02-15 23:44:31 +01:00
|
|
|
interface SyncManager {
|
2017-09-26 22:51:27 +02:00
|
|
|
getTags(): Promise<string[]>;
|
2017-02-15 23:44:31 +01:00
|
|
|
register(tag: string): Promise<void>;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var SyncManager: {
|
|
|
|
prototype: SyncManager;
|
|
|
|
new(): SyncManager;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-02-15 23:44:31 +01:00
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface TextDecoder {
|
|
|
|
/**
|
|
|
|
* Returns encoding's name, lowercased.
|
|
|
|
*/
|
|
|
|
readonly encoding: string;
|
|
|
|
/**
|
|
|
|
* Returns true if error mode is "fatal", and false
|
|
|
|
* otherwise.
|
|
|
|
*/
|
|
|
|
readonly fatal: boolean;
|
|
|
|
/**
|
|
|
|
* Returns true if ignore BOM flag is set, and false otherwise.
|
|
|
|
*/
|
|
|
|
readonly ignoreBOM: boolean;
|
|
|
|
/**
|
|
|
|
* Returns the result of running encoding's decoder. The
|
|
|
|
* method can be invoked zero or more times with options's stream set to
|
|
|
|
* true, and then once without options's stream (or set to false), to process
|
|
|
|
* a fragmented stream. If the invocation without options's stream (or set to
|
|
|
|
* false) has no input, it's clearest to omit both arguments.
|
|
|
|
* var string = "", decoder = new TextDecoder(encoding), buffer;
|
|
|
|
* while(buffer = next_chunk()) {
|
|
|
|
* string += decoder.decode(buffer, {stream:true});
|
|
|
|
* }
|
|
|
|
* string += decoder.decode(); // end-of-stream
|
|
|
|
* If the error mode is "fatal" and encoding's decoder returns error, throws a TypeError.
|
|
|
|
*/
|
|
|
|
decode(input?: BufferSource, options?: TextDecodeOptions): string;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var TextDecoder: {
|
|
|
|
prototype: TextDecoder;
|
|
|
|
new(label?: string, options?: TextDecoderOptions): TextDecoder;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface TextEncoder {
|
|
|
|
/**
|
|
|
|
* Returns "utf-8".
|
|
|
|
*/
|
|
|
|
readonly encoding: string;
|
|
|
|
/**
|
|
|
|
* Returns the result of running UTF-8's encoder.
|
|
|
|
*/
|
|
|
|
encode(input?: string): Uint8Array;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var TextEncoder: {
|
|
|
|
prototype: TextEncoder;
|
|
|
|
new(): TextEncoder;
|
|
|
|
};
|
|
|
|
|
2017-04-26 23:38:47 +02:00
|
|
|
interface URL {
|
|
|
|
hash: string;
|
|
|
|
host: string;
|
|
|
|
hostname: string;
|
|
|
|
href: string;
|
|
|
|
readonly origin: string;
|
|
|
|
password: string;
|
|
|
|
pathname: string;
|
|
|
|
port: string;
|
|
|
|
protocol: string;
|
|
|
|
search: string;
|
|
|
|
readonly searchParams: URLSearchParams;
|
2018-03-29 02:46:57 +02:00
|
|
|
username: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
toJSON(): string;
|
2017-04-26 23:38:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var URL: {
|
|
|
|
prototype: URL;
|
2018-02-21 18:12:48 +01:00
|
|
|
new(url: string, base?: string | URL): URL;
|
2018-06-11 05:05:12 +02:00
|
|
|
createObjectURL(object: any): string;
|
2017-04-26 23:38:47 +02:00
|
|
|
revokeObjectURL(url: string): void;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2017-04-26 23:38:47 +02:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface URLSearchParams {
|
|
|
|
/**
|
|
|
|
* Appends a specified key/value pair as a new search parameter.
|
|
|
|
*/
|
|
|
|
append(name: string, value: string): void;
|
|
|
|
/**
|
|
|
|
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
|
|
|
|
*/
|
|
|
|
delete(name: string): void;
|
|
|
|
/**
|
|
|
|
* Returns the first value associated to the given search parameter.
|
|
|
|
*/
|
|
|
|
get(name: string): string | null;
|
|
|
|
/**
|
|
|
|
* Returns all the values association with a given search parameter.
|
|
|
|
*/
|
|
|
|
getAll(name: string): string[];
|
|
|
|
/**
|
|
|
|
* Returns a Boolean indicating if such a search parameter exists.
|
|
|
|
*/
|
|
|
|
has(name: string): boolean;
|
|
|
|
/**
|
|
|
|
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
|
|
|
|
*/
|
|
|
|
set(name: string, value: string): void;
|
2018-06-11 05:05:12 +02:00
|
|
|
sort(): void;
|
|
|
|
forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;
|
2018-03-29 02:46:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var URLSearchParams: {
|
|
|
|
prototype: URLSearchParams;
|
2018-06-11 05:05:12 +02:00
|
|
|
new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
|
2018-03-29 02:46:57 +02:00
|
|
|
};
|
|
|
|
|
2016-12-15 22:46:39 +01:00
|
|
|
interface WebSocketEventMap {
|
|
|
|
"close": CloseEvent;
|
2017-02-15 23:44:31 +01:00
|
|
|
"error": Event;
|
2016-12-15 22:46:39 +01:00
|
|
|
"message": MessageEvent;
|
|
|
|
"open": Event;
|
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface WebSocket extends EventTarget {
|
2018-03-29 02:46:57 +02:00
|
|
|
binaryType: BinaryType;
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly bufferedAmount: number;
|
|
|
|
readonly extensions: string;
|
2018-03-29 02:46:57 +02:00
|
|
|
onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;
|
|
|
|
onerror: ((this: WebSocket, ev: Event) => any) | null;
|
|
|
|
onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;
|
|
|
|
onopen: ((this: WebSocket, ev: Event) => any) | null;
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly protocol: string;
|
|
|
|
readonly readyState: number;
|
|
|
|
readonly url: string;
|
|
|
|
close(code?: number, reason?: string): void;
|
2018-03-29 02:46:57 +02:00
|
|
|
send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly CLOSED: number;
|
|
|
|
readonly CLOSING: number;
|
|
|
|
readonly CONNECTING: number;
|
|
|
|
readonly OPEN: number;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var WebSocket: {
|
|
|
|
prototype: WebSocket;
|
|
|
|
new(url: string, protocols?: string | string[]): WebSocket;
|
|
|
|
readonly CLOSED: number;
|
|
|
|
readonly CLOSING: number;
|
|
|
|
readonly CONNECTING: number;
|
|
|
|
readonly OPEN: number;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface WindowBase64 {
|
|
|
|
atob(encodedString: string): string;
|
|
|
|
btoa(rawString: string): string;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface WindowClient extends Client {
|
|
|
|
readonly ancestorOrigins: ReadonlyArray<string>;
|
|
|
|
readonly focused: boolean;
|
|
|
|
readonly visibilityState: VisibilityState;
|
|
|
|
focus(): Promise<WindowClient>;
|
2018-06-11 05:05:12 +02:00
|
|
|
navigate(url: string): Promise<WindowClient | null>;
|
2018-03-29 02:46:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var WindowClient: {
|
|
|
|
prototype: WindowClient;
|
|
|
|
new(): WindowClient;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface WindowConsole {
|
|
|
|
readonly console: Console;
|
|
|
|
}
|
|
|
|
|
2016-12-15 22:46:39 +01:00
|
|
|
interface WorkerEventMap extends AbstractWorkerEventMap {
|
|
|
|
"message": MessageEvent;
|
|
|
|
}
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
interface Worker extends EventTarget, AbstractWorker {
|
2018-03-29 02:46:57 +02:00
|
|
|
onmessage: ((this: Worker, ev: MessageEvent) => any) | null;
|
2017-02-15 23:44:31 +01:00
|
|
|
postMessage(message: any, transfer?: any[]): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
terminate(): void;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener<K extends keyof WorkerEventMap>(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof WorkerEventMap>(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var Worker: {
|
|
|
|
prototype: Worker;
|
|
|
|
new(stringUrl: string): Worker;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface WorkerGlobalScopeEventMap {
|
|
|
|
"error": ErrorEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowConsole, GlobalFetch {
|
|
|
|
readonly caches: CacheStorage;
|
|
|
|
readonly isSecureContext: boolean;
|
|
|
|
readonly location: WorkerLocation;
|
|
|
|
onerror: ((this: WorkerGlobalScope, ev: ErrorEvent) => any) | null;
|
|
|
|
readonly performance: Performance;
|
|
|
|
readonly self: WorkerGlobalScope;
|
|
|
|
createImageBitmap(image: ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
|
|
|
createImageBitmap(image: ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
|
|
|
msWriteProfilerMark(profilerMarkName: string): void;
|
|
|
|
addEventListener<K extends keyof WorkerGlobalScopeEventMap>(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof WorkerGlobalScopeEventMap>(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var WorkerGlobalScope: {
|
|
|
|
prototype: WorkerGlobalScope;
|
|
|
|
new(): WorkerGlobalScope;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface WorkerLocation {
|
|
|
|
readonly hash: string;
|
|
|
|
readonly host: string;
|
|
|
|
readonly hostname: string;
|
|
|
|
readonly href: string;
|
|
|
|
readonly origin: string;
|
|
|
|
readonly pathname: string;
|
|
|
|
readonly port: string;
|
|
|
|
readonly protocol: string;
|
|
|
|
readonly search: string;
|
|
|
|
toString(): string;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var WorkerLocation: {
|
|
|
|
prototype: WorkerLocation;
|
|
|
|
new(): WorkerLocation;
|
|
|
|
};
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface WorkerNavigator extends NavigatorID, NavigatorOnLine, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorStorage {
|
|
|
|
readonly serviceWorker: ServiceWorkerContainer;
|
2018-03-29 02:46:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var WorkerNavigator: {
|
|
|
|
prototype: WorkerNavigator;
|
|
|
|
new(): WorkerNavigator;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface WorkerUtils extends WindowBase64 {
|
|
|
|
readonly indexedDB: IDBFactory;
|
|
|
|
readonly msIndexedDB: IDBFactory;
|
|
|
|
readonly navigator: WorkerNavigator;
|
|
|
|
clearImmediate(handle: number): void;
|
|
|
|
clearInterval(handle: number): void;
|
|
|
|
clearTimeout(handle: number): void;
|
|
|
|
importScripts(...urls: string[]): void;
|
|
|
|
setImmediate(handler: any, ...args: any[]): number;
|
|
|
|
setInterval(handler: any, timeout?: any, ...args: any[]): number;
|
|
|
|
setTimeout(handler: any, timeout?: any, ...args: any[]): number;
|
|
|
|
}
|
|
|
|
|
2016-12-15 22:46:39 +01:00
|
|
|
interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {
|
|
|
|
"readystatechange": Event;
|
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface XMLHttpRequest extends XMLHttpRequestEventTarget {
|
2018-03-29 02:46:57 +02:00
|
|
|
onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns client's state.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly readyState: number;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the response's body.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly response: any;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the text response.
|
|
|
|
* Throws an "InvalidStateError" DOMException if responseType is not the empty string or "text".
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly responseText: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the response type.
|
|
|
|
* Can be set to change the response type. Values are:
|
|
|
|
* the empty string (default),
|
|
|
|
* "arraybuffer",
|
|
|
|
* "blob",
|
|
|
|
* "document",
|
|
|
|
* "json", and
|
|
|
|
* "text".
|
|
|
|
* When set: setting to "document" is ignored if current global object is not a Window object.
|
|
|
|
* When set: throws an "InvalidStateError" DOMException if state is loading or done.
|
|
|
|
* When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object.
|
|
|
|
*/
|
2017-04-26 23:38:47 +02:00
|
|
|
responseType: XMLHttpRequestResponseType;
|
2017-02-15 23:44:31 +01:00
|
|
|
readonly responseURL: string;
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly status: number;
|
|
|
|
readonly statusText: string;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Can be set to a time in milliseconds. When set to a non-zero value will cause fetching to terminate after the given time has passed. When the time has passed, the
|
|
|
|
* request has not yet completed, and the synchronous flag is unset, a timeout event will then be dispatched, or a
|
|
|
|
* "TimeoutError" DOMException will be thrown otherwise (for the send() method).
|
|
|
|
* When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
timeout: number;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Returns the associated XMLHttpRequestUpload object. It can be used to gather transmission information when data is
|
|
|
|
* transferred to a server.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly upload: XMLHttpRequestUpload;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* True when credentials are to be included in a cross-origin request. False when they are
|
|
|
|
* to be excluded in a cross-origin request and when cookies are to be ignored in its response.
|
|
|
|
* Initially false.
|
|
|
|
* When set: throws an "InvalidStateError" DOMException if state is not unsent or opened, or if the send() flag is set.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
withCredentials: boolean;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Cancels any network activity.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
abort(): void;
|
|
|
|
getAllResponseHeaders(): string;
|
2018-06-11 05:05:12 +02:00
|
|
|
getResponseHeader(name: string): string | null;
|
|
|
|
/**
|
|
|
|
* Sets the request method, request URL, and synchronous flag.
|
|
|
|
* Throws a "SyntaxError" DOMException if either method is not a
|
|
|
|
* valid HTTP method or url cannot be parsed.
|
|
|
|
* Throws a "SecurityError" DOMException if method is a
|
|
|
|
* case-insensitive match for `CONNECT`, `TRACE`, or `TRACK`.
|
|
|
|
* Throws an "InvalidAccessError" DOMException if async is false, current global object is a Window object, and the timeout attribute is not zero or the responseType attribute is not the empty string.
|
|
|
|
*/
|
|
|
|
open(method: string, url: string): void;
|
|
|
|
open(method: string, url: string, async: boolean, username?: string | null, password?: string | null): void;
|
|
|
|
/**
|
|
|
|
* Acts as if the `Content-Type` header value for response is mime.
|
|
|
|
* (It does not actually change the header though.)
|
|
|
|
* Throws an "InvalidStateError" DOMException if state is loading or done.
|
|
|
|
*/
|
2016-12-15 07:03:00 +01:00
|
|
|
overrideMimeType(mime: string): void;
|
2018-06-11 05:05:12 +02:00
|
|
|
/**
|
|
|
|
* Initiates the request. The optional argument provides the request body. The argument is ignored if request method is GET or HEAD.
|
|
|
|
* Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
|
|
|
|
*/
|
|
|
|
send(body?: object | BodyInit): void;
|
|
|
|
/**
|
|
|
|
* Combines a header in author request headers.
|
|
|
|
* Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.
|
|
|
|
* Throws a "SyntaxError" DOMException if name is not a header name
|
|
|
|
* or if value is not a header value.
|
|
|
|
*/
|
|
|
|
setRequestHeader(name: string, value: string): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
readonly DONE: number;
|
|
|
|
readonly HEADERS_RECEIVED: number;
|
|
|
|
readonly LOADING: number;
|
|
|
|
readonly OPENED: number;
|
|
|
|
readonly UNSENT: number;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof XMLHttpRequestEventMap>(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
declare var XMLHttpRequest: {
|
|
|
|
prototype: XMLHttpRequest;
|
|
|
|
new(): XMLHttpRequest;
|
|
|
|
readonly DONE: number;
|
|
|
|
readonly HEADERS_RECEIVED: number;
|
|
|
|
readonly LOADING: number;
|
|
|
|
readonly OPENED: number;
|
|
|
|
readonly UNSENT: number;
|
2017-08-01 00:54:41 +02:00
|
|
|
};
|
2016-12-15 07:03:00 +01:00
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
interface XMLHttpRequestEventTargetEventMap {
|
2018-06-11 05:05:12 +02:00
|
|
|
"abort": ProgressEvent;
|
|
|
|
"error": ProgressEvent;
|
|
|
|
"load": ProgressEvent;
|
2018-03-29 02:46:57 +02:00
|
|
|
"loadend": ProgressEvent;
|
2018-06-11 05:05:12 +02:00
|
|
|
"loadstart": ProgressEvent;
|
2018-03-29 02:46:57 +02:00
|
|
|
"progress": ProgressEvent;
|
|
|
|
"timeout": ProgressEvent;
|
2016-12-15 22:46:39 +01:00
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface XMLHttpRequestEventTarget extends EventTarget {
|
|
|
|
onabort: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
|
|
onerror: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
|
|
onload: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
2018-03-29 02:46:57 +02:00
|
|
|
onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
2018-06-11 05:05:12 +02:00
|
|
|
onloadstart: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
2018-03-29 02:46:57 +02:00
|
|
|
onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
|
|
|
ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
declare var XMLHttpRequestEventTarget: {
|
|
|
|
prototype: XMLHttpRequestEventTarget;
|
|
|
|
new(): XMLHttpRequestEventTarget;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface XMLHttpRequestUpload extends XMLHttpRequestEventTarget {
|
2018-03-29 02:46:57 +02:00
|
|
|
addEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
2017-12-02 20:16:59 +01:00
|
|
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
2018-03-29 02:46:57 +02:00
|
|
|
removeEventListener<K extends keyof XMLHttpRequestEventTargetEventMap>(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
2017-12-02 20:16:59 +01:00
|
|
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2017-09-26 22:51:27 +02:00
|
|
|
}
|
|
|
|
|
2018-03-29 02:46:57 +02:00
|
|
|
declare var XMLHttpRequestUpload: {
|
|
|
|
prototype: XMLHttpRequestUpload;
|
|
|
|
new(): XMLHttpRequestUpload;
|
2018-02-21 18:12:48 +01:00
|
|
|
};
|
|
|
|
|
2016-12-15 07:03:00 +01:00
|
|
|
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
|
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface EventHandlerNonNull {
|
|
|
|
(event: Event): any;
|
2016-12-15 07:03:00 +01:00
|
|
|
}
|
2018-03-29 02:46:57 +02:00
|
|
|
|
2018-06-11 05:05:12 +02:00
|
|
|
interface PerformanceObserverCallback {
|
|
|
|
(entries: PerformanceObserverEntryList, observer: PerformanceObserver): void;
|
2017-08-01 00:54:41 +02:00
|
|
|
}
|
2018-03-29 02:46:57 +02:00
|
|
|
|
|
|
|
declare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null;
|
2017-02-15 23:44:31 +01:00
|
|
|
declare function close(): void;
|
|
|
|
declare function postMessage(message: any, transfer?: any[]): void;
|
2018-03-29 02:46:57 +02:00
|
|
|
declare function dispatchEvent(evt: Event): boolean;
|
2017-02-15 23:44:31 +01:00
|
|
|
declare var caches: CacheStorage;
|
|
|
|
declare var isSecureContext: boolean;
|
2016-12-15 07:03:00 +01:00
|
|
|
declare var location: WorkerLocation;
|
2018-03-29 02:46:57 +02:00
|
|
|
declare var onerror: ((this: DedicatedWorkerGlobalScope, ev: ErrorEvent) => any) | null;
|
2017-02-15 23:44:31 +01:00
|
|
|
declare var performance: Performance;
|
2016-12-15 07:03:00 +01:00
|
|
|
declare var self: WorkerGlobalScope;
|
2017-04-26 23:38:47 +02:00
|
|
|
declare function createImageBitmap(image: ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
|
|
|
declare function createImageBitmap(image: ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
|
2018-03-29 02:46:57 +02:00
|
|
|
declare function msWriteProfilerMark(profilerMarkName: string): void;
|
2016-12-15 07:03:00 +01:00
|
|
|
declare function dispatchEvent(evt: Event): boolean;
|
|
|
|
declare var indexedDB: IDBFactory;
|
|
|
|
declare var msIndexedDB: IDBFactory;
|
|
|
|
declare var navigator: WorkerNavigator;
|
|
|
|
declare function clearImmediate(handle: number): void;
|
|
|
|
declare function clearInterval(handle: number): void;
|
|
|
|
declare function clearTimeout(handle: number): void;
|
|
|
|
declare function setImmediate(handler: any, ...args: any[]): number;
|
|
|
|
declare function setInterval(handler: any, timeout?: any, ...args: any[]): number;
|
|
|
|
declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number;
|
|
|
|
declare function atob(encodedString: string): string;
|
|
|
|
declare function btoa(rawString: string): string;
|
|
|
|
declare var console: Console;
|
2018-03-29 02:46:57 +02:00
|
|
|
declare function fetch(input?: Request | string, init?: RequestInit): Promise<Response>;
|
2017-12-02 20:16:59 +01:00
|
|
|
declare function addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
|
|
declare function removeEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
|
|
declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
2018-06-11 05:05:12 +02:00
|
|
|
type BlobPart = BufferSource | Blob | string;
|
|
|
|
type HeadersInit = Headers | string[][] | Record<string, string>;
|
|
|
|
type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string;
|
2017-02-15 23:44:31 +01:00
|
|
|
type RequestInfo = Request | string;
|
2018-06-11 05:05:12 +02:00
|
|
|
type DOMHighResTimeStamp = number;
|
|
|
|
type PerformanceEntryList = PerformanceEntry[];
|
|
|
|
type PushMessageDataInit = BufferSource | string;
|
|
|
|
type VibratePattern = number | number[];
|
|
|
|
type BufferSource = ArrayBufferView | ArrayBuffer;
|
|
|
|
type DOMTimeStamp = number;
|
|
|
|
type FormDataEntryValue = File | string;
|
|
|
|
type IDBValidKey = number | string | Date | BufferSource | IDBArrayKey;
|
|
|
|
type MessageEventSource = object | MessagePort | ServiceWorker;
|
2018-03-29 02:46:57 +02:00
|
|
|
type BinaryType = "blob" | "arraybuffer";
|
2018-06-11 05:05:12 +02:00
|
|
|
type ClientTypes = "window" | "worker" | "sharedworker" | "all";
|
2017-04-26 23:38:47 +02:00
|
|
|
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
|
|
|
|
type IDBRequestReadyState = "pending" | "done";
|
|
|
|
type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
|
|
|
|
type NotificationDirection = "auto" | "ltr" | "rtl";
|
|
|
|
type NotificationPermission = "default" | "denied" | "granted";
|
|
|
|
type PushEncryptionKeyName = "p256dh" | "auth";
|
2018-06-11 05:05:12 +02:00
|
|
|
type PushPermissionState = "denied" | "granted" | "prompt";
|
2017-04-26 23:38:47 +02:00
|
|
|
type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin-only" | "origin-when-cross-origin" | "unsafe-url";
|
2018-06-11 05:05:12 +02:00
|
|
|
type RequestCache = "default" | "no-store" | "reload" | "no-cache" | "force-cache" | "only-if-cached";
|
2017-04-26 23:38:47 +02:00
|
|
|
type RequestCredentials = "omit" | "same-origin" | "include";
|
2018-06-11 05:05:12 +02:00
|
|
|
type RequestDestination = "" | "audio" | "audioworklet" | "document" | "embed" | "font" | "image" | "manifest" | "object" | "paintworklet" | "report" | "script" | "sharedworker" | "style" | "track" | "video" | "worker" | "xslt";
|
2017-04-26 23:38:47 +02:00
|
|
|
type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors";
|
|
|
|
type RequestRedirect = "follow" | "error" | "manual";
|
|
|
|
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
|
|
|
|
type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant";
|
2018-06-11 05:05:12 +02:00
|
|
|
type ServiceWorkerUpdateViaCache = "imports" | "all" | "none";
|
2017-04-26 23:38:47 +02:00
|
|
|
type VisibilityState = "hidden" | "visible" | "prerender" | "unloaded";
|
2018-06-11 05:05:12 +02:00
|
|
|
type WorkerType = "classic" | "module";
|
2018-03-29 02:46:57 +02:00
|
|
|
type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";
|