diff options
Diffstat (limited to 'cli/dts/lib.webworker.d.ts')
-rw-r--r-- | cli/dts/lib.webworker.d.ts | 778 |
1 files changed, 241 insertions, 537 deletions
diff --git a/cli/dts/lib.webworker.d.ts b/cli/dts/lib.webworker.d.ts index 7c1e0fa63..242db956a 100644 --- a/cli/dts/lib.webworker.d.ts +++ b/cli/dts/lib.webworker.d.ts @@ -405,10 +405,6 @@ interface PermissionDescriptor { name: PermissionName; } -interface PostMessageOptions { - transfer?: any[]; -} - interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; @@ -476,58 +472,32 @@ interface RegistrationOptions { } interface RequestInit { - /** - * A BodyInit object or null to set request's body. - */ + /** A BodyInit object or null to set request's body. */ body?: BodyInit | null; - /** - * A string indicating how the request will interact with the browser's cache to set request's cache. - */ + /** A string indicating how the request will interact with the browser's cache to set request's cache. */ cache?: RequestCache; - /** - * A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials. - */ + /** A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials. */ credentials?: RequestCredentials; - /** - * A Headers object, an object literal, or an array of two-item arrays to set request's headers. - */ + /** A Headers object, an object literal, or an array of two-item arrays to set request's headers. */ headers?: HeadersInit; - /** - * A cryptographic hash of the resource to be fetched by request. Sets request's integrity. - */ + /** A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */ integrity?: string; - /** - * A boolean to set request's keepalive. - */ + /** A boolean to set request's keepalive. */ keepalive?: boolean; - /** - * A string to set request's method. - */ + /** A string to set request's method. */ method?: string; - /** - * A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode. - */ + /** A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode. */ mode?: RequestMode; - /** - * A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. - */ + /** A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */ redirect?: RequestRedirect; - /** - * A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer. - */ + /** A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer. */ referrer?: string; - /** - * A referrer policy to set request's referrerPolicy. - */ + /** A referrer policy to set request's referrerPolicy. */ referrerPolicy?: ReferrerPolicy; - /** - * An AbortSignal to set request's signal. - */ + /** An AbortSignal to set request's signal. */ signal?: AbortSignal | null; - /** - * Can only be null. Used to disassociate request from any Window. - */ - window?: any; + /** Can only be null. Used to disassociate request from any Window. */ + window?: null; } interface ResponseInit { @@ -607,6 +577,10 @@ interface StreamPipeOptions { signal?: AbortSignal; } +interface StructuredSerializeOptions { + transfer?: any[]; +} + interface TextDecodeOptions { stream?: boolean; } @@ -688,13 +662,9 @@ interface ANGLE_instanced_arrays { /** A controller object that allows you to abort one or more DOM requests as and when desired. */ interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ + /** Returns the AbortSignal object associated with this object. */ readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ + /** Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. */ abort(): void; } @@ -709,9 +679,7 @@ interface AbortSignalEventMap { /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ + /** Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */ readonly aborted: boolean; onabort: ((this: AbortSignal, ev: Event) => any) | null; addEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -723,6 +691,7 @@ interface AbortSignal extends EventTarget { declare var AbortSignal: { prototype: AbortSignal; new(): AbortSignal; + // abort(): AbortSignal; - To be re-added in the future }; interface AbstractWorkerEventMap { @@ -773,19 +742,13 @@ interface BroadcastChannelEventMap { } interface BroadcastChannel extends EventTarget { - /** - * Returns the channel name (as passed to the constructor). - */ + /** 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. - */ + /** 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. - */ + /** 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; @@ -809,7 +772,10 @@ declare var ByteLengthQueuingStrategy: { new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; }; -/** Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. */ +/** + * Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. + * Available only in secure contexts. + */ interface Cache { add(request: RequestInfo): Promise<void>; addAll(requests: RequestInfo[]): Promise<void>; @@ -825,7 +791,10 @@ declare var Cache: { new(): Cache; }; -/** The storage for Cache objects. */ +/** + * The storage for Cache objects. + * Available only in secure contexts. + */ interface CacheStorage { delete(cacheName: string): Promise<boolean>; has(cacheName: string): Promise<boolean>; @@ -868,9 +837,7 @@ interface CanvasPath { /** An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */ interface CanvasPattern { - /** - * Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation. - */ + /** Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation. */ setTransform(transform?: DOMMatrix2DInit): void; } @@ -886,7 +853,7 @@ interface Client { readonly type: ClientTypes; readonly url: string; postMessage(message: any, transfer: Transferable[]): void; - postMessage(message: any, options?: PostMessageOptions): void; + postMessage(message: any, options?: StructuredSerializeOptions): void; } declare var Client: { @@ -909,17 +876,11 @@ declare var Clients: { /** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */ interface CloseEvent extends Event { - /** - * Returns the WebSocket connection close code provided by the server. - */ + /** Returns the WebSocket connection close code provided by the server. */ readonly code: number; - /** - * Returns the WebSocket connection close reason provided by the server. - */ + /** Returns the WebSocket connection close reason provided by the server. */ readonly reason: string; - /** - * Returns true if the connection closed cleanly; false otherwise. - */ + /** Returns true if the connection closed cleanly; false otherwise. */ readonly wasClean: boolean; } @@ -941,6 +902,7 @@ declare var CountQueuingStrategy: { /** Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. */ interface Crypto { + /** Available only in secure contexts. */ readonly subtle: SubtleCrypto; getRandomValues<T extends ArrayBufferView | null>(array: T): T; } @@ -950,7 +912,10 @@ declare var Crypto: { new(): Crypto; }; -/** The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. */ +/** + * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. + * Available only in secure contexts. + */ interface CryptoKey { readonly algorithm: KeyAlgorithm; readonly extractable: boolean; @@ -964,9 +929,7 @@ declare var CryptoKey: { }; interface CustomEvent<T = any> extends Event { - /** - * Returns any custom data event was created with. Typically used for synthetic events. - */ + /** Returns any custom data event was created with. Typically used for synthetic events. */ readonly detail: T; /** @deprecated */ initCustomEvent(type: string, bubbles?: boolean, cancelable?: boolean, detail?: T): void; @@ -978,7 +941,7 @@ declare var CustomEvent: { }; /** An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. */ -interface DOMException { +interface DOMException extends Error { readonly code: number; readonly message: string; readonly name: string; @@ -1213,17 +1176,11 @@ declare var DOMRectReadOnly: { /** A type returned by some APIs which contains a list of DOMString (strings). */ interface DOMStringList { - /** - * Returns the number of strings in strings. - */ + /** Returns the number of strings in strings. */ readonly length: number; - /** - * Returns true if strings contains string, and false otherwise. - */ + /** Returns true if strings contains string, and false otherwise. */ contains(string: string): boolean; - /** - * Returns the string with index index from strings. - */ + /** Returns the string with index index from strings. */ item(index: number): string | null; [index: number]: string; } @@ -1240,21 +1197,15 @@ interface DedicatedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap { /** (the Worker global scope) is accessible through the self keyword. Some additional global functions, namespaces objects, and constructors, not typically associated with the worker global scope, but available on it, are listed in the JavaScript Reference. See also: Functions available to workers. */ interface DedicatedWorkerGlobalScope extends WorkerGlobalScope, AnimationFrameProvider { - /** - * Returns dedicatedWorkerGlobal's name, i.e. the value given to the Worker constructor. Primarily useful for debugging. - */ + /** Returns dedicatedWorkerGlobal's name, i.e. the value given to the Worker constructor. Primarily useful for debugging. */ readonly name: string; onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null; onmessageerror: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null; - /** - * Aborts dedicatedWorkerGlobal. - */ + /** Aborts dedicatedWorkerGlobal. */ close(): void; - /** - * Clones message and transmits it to the Worker object associated with dedicatedWorkerGlobal. transfer can be passed as a list of objects that are to be transferred rather than cloned. - */ + /** Clones message and transmits it to the Worker object associated with dedicatedWorkerGlobal. transfer can be passed as a list of objects that are to be transferred rather than cloned. */ postMessage(message: any, transfer: Transferable[]): void; - postMessage(message: any, options?: PostMessageOptions): void; + postMessage(message: any, options?: StructuredSerializeOptions): 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; @@ -1327,68 +1278,40 @@ declare var ErrorEvent: { /** An event which takes place in the DOM. */ interface Event { - /** - * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. - */ + /** Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. */ readonly bubbles: boolean; cancelBubble: boolean; - /** - * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. - */ + /** Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. */ readonly cancelable: boolean; - /** - * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. - */ + /** Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. */ readonly composed: boolean; - /** - * Returns the object whose event listener's callback is currently being invoked. - */ + /** Returns the object whose event listener's callback is currently being invoked. */ readonly currentTarget: EventTarget | null; - /** - * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. - */ + /** Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. */ readonly defaultPrevented: boolean; - /** - * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. - */ + /** Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. */ readonly eventPhase: number; - /** - * Returns true if event was dispatched by the user agent, and false otherwise. - */ + /** Returns true if event was dispatched by the user agent, and false otherwise. */ readonly isTrusted: boolean; /** @deprecated */ returnValue: boolean; /** @deprecated */ readonly srcElement: EventTarget | null; - /** - * Returns the object to which event is dispatched (its target). - */ + /** Returns the object to which event is dispatched (its target). */ readonly target: EventTarget | null; - /** - * Returns the event's timestamp as the number of milliseconds measured relative to the time origin. - */ + /** Returns the event's timestamp as the number of milliseconds measured relative to the time origin. */ readonly timeStamp: DOMHighResTimeStamp; - /** - * Returns the type of event, e.g. "click", "hashchange", or "submit". - */ + /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ readonly type: string; - /** - * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. - */ + /** Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. */ composedPath(): EventTarget[]; /** @deprecated */ initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void; - /** - * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. - */ + /** If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. */ preventDefault(): void; - /** - * Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. - */ + /** Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. */ stopImmediatePropagation(): void; - /** - * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. - */ + /** When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. */ stopPropagation(): void; readonly AT_TARGET: number; readonly BUBBLING_PHASE: number; @@ -1423,21 +1346,13 @@ interface EventSource extends EventTarget { onerror: ((this: EventSource, ev: Event) => any) | null; onmessage: ((this: EventSource, ev: MessageEvent) => any) | null; onopen: ((this: EventSource, ev: Event) => any) | null; - /** - * Returns the state of this EventSource object's connection. It can have the values described below. - */ + /** Returns the state of this EventSource object's connection. It can have the values described below. */ readonly readyState: number; - /** - * Returns the URL providing the event stream. - */ + /** Returns the URL providing the event stream. */ readonly url: string; - /** - * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise. - */ + /** Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise. */ readonly withCredentials: boolean; - /** - * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED. - */ + /** Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED. */ close(): void; readonly CLOSED: number; readonly CONNECTING: number; @@ -1474,13 +1389,9 @@ interface EventTarget { * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. */ addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void; - /** - * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. - */ + /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ dispatchEvent(event: Event): boolean; - /** - * Removes the event listener in target's event listener list with the same type, callback, and options. - */ + /** Removes the event listener in target's event listener list with the same type, callback, and options. */ removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; } @@ -1707,34 +1618,20 @@ declare var Headers: { /** This IndexedDB API interface represents a cursor for traversing or iterating over multiple records in a database. */ interface IDBCursor { - /** - * Returns the direction ("next", "nextunique", "prev" or "prevunique") of the cursor. - */ + /** Returns the direction ("next", "nextunique", "prev" or "prevunique") of the cursor. */ readonly direction: IDBCursorDirection; - /** - * Returns the key of the cursor. Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished. - */ + /** Returns the key of the cursor. Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished. */ readonly key: IDBValidKey; - /** - * Returns the effective key of the cursor. Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished. - */ + /** Returns the effective key of the cursor. Throws a "InvalidStateError" DOMException if the cursor is advancing or is finished. */ readonly primaryKey: IDBValidKey; readonly request: IDBRequest; - /** - * Returns the IDBObjectStore or IDBIndex the cursor was opened from. - */ + /** Returns the IDBObjectStore or IDBIndex the cursor was opened from. */ readonly source: IDBObjectStore | IDBIndex; - /** - * Advances the cursor through the next count records in range. - */ + /** Advances the cursor through the next count records in range. */ advance(count: number): void; - /** - * Advances the cursor to the next record in range. - */ + /** Advances the cursor to the next record in range. */ continue(key?: IDBValidKey): 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. - */ + /** 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, primaryKey: IDBValidKey): void; /** * Delete the record pointed at by the cursor with a new value. @@ -1759,9 +1656,7 @@ declare var IDBCursor: { /** This IndexedDB API interface represents a cursor for traversing or iterating over multiple records in a database. It is the same as the IDBCursor, except that it includes the value property. */ interface IDBCursorWithValue extends IDBCursor { - /** - * Returns the cursor's current value. - */ + /** Returns the cursor's current value. */ readonly value: any; } @@ -1779,25 +1674,17 @@ interface IDBDatabaseEventMap { /** This IndexedDB API interface provides a connection to a database; you can use an IDBDatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. The interface provides the only way to get and manage versions of the database. */ interface IDBDatabase extends EventTarget { - /** - * Returns the name of the database. - */ + /** Returns the name of the database. */ readonly name: string; - /** - * Returns a list of the names of object stores in the database. - */ + /** Returns a list of the names of object stores in the database. */ readonly objectStoreNames: DOMStringList; onabort: ((this: IDBDatabase, ev: Event) => any) | null; onclose: ((this: IDBDatabase, ev: Event) => any) | null; onerror: ((this: IDBDatabase, ev: Event) => any) | null; onversionchange: ((this: IDBDatabase, ev: IDBVersionChangeEvent) => any) | null; - /** - * Returns the version of the database. - */ + /** Returns the version of the database. */ readonly version: number; - /** - * Closes the connection once all running transactions have finished. - */ + /** Closes the connection once all running transactions have finished. */ close(): void; /** * Creates a new object store with the given name and options and returns a new IDBObjectStore. @@ -1811,9 +1698,7 @@ interface IDBDatabase extends EventTarget { * Throws a "InvalidStateError" DOMException if not called within an upgrade transaction. */ deleteObjectStore(name: string): void; - /** - * 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. - */ + /** 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. */ transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction; 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; @@ -1835,13 +1720,9 @@ interface IDBFactory { */ cmp(first: any, second: any): number; databases(): Promise<IDBDatabaseInfo[]>; - /** - * 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. - */ + /** 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. */ deleteDatabase(name: string): IDBOpenDBRequest; - /** - * Attempts to open a connection to the named database with the current version, or 1 if it does not already exist. If the request is successful request's result will be the connection. - */ + /** Attempts to open a connection to the named database with the current version, or 1 if it does not already exist. If the request is successful request's result will be the connection. */ open(name: string, version?: number): IDBOpenDBRequest; } @@ -1854,13 +1735,9 @@ declare var IDBFactory: { interface IDBIndex { readonly keyPath: string | string[]; readonly multiEntry: boolean; - /** - * Returns the name of the index. - */ + /** Returns the name of the index. */ name: string; - /** - * Returns the IDBObjectStore the index belongs to. - */ + /** Returns the IDBObjectStore the index belongs to. */ readonly objectStore: IDBObjectStore; readonly unique: boolean; /** @@ -1914,70 +1791,42 @@ declare var IDBIndex: { /** A key range can be a single value or a range with upper and lower bounds or endpoints. If the key range has both upper and lower bounds, then it is bounded; if it has no bounds, it is unbounded. A bounded key range can either be open (the endpoints are excluded) or closed (the endpoints are included). To retrieve all keys within a certain range, you can use the following code constructs: */ interface IDBKeyRange { - /** - * Returns lower bound, or undefined if none. - */ + /** Returns lower bound, or undefined if none. */ readonly lower: any; - /** - * Returns true if the lower open flag is set, and false otherwise. - */ + /** Returns true if the lower open flag is set, and false otherwise. */ readonly lowerOpen: boolean; - /** - * Returns upper bound, or undefined if none. - */ + /** Returns upper bound, or undefined if none. */ readonly upper: any; - /** - * Returns true if the upper open flag is set, and false otherwise. - */ + /** Returns true if the upper open flag is set, and false otherwise. */ readonly upperOpen: boolean; - /** - * Returns true if key is included in the range, and false otherwise. - */ + /** Returns true if key is included in the range, and false otherwise. */ includes(key: any): boolean; } declare var IDBKeyRange: { prototype: IDBKeyRange; new(): IDBKeyRange; - /** - * 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. - */ + /** 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. */ bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - /** - * Returns a new IDBKeyRange starting at key with no upper bound. If open is true, key is not included in the range. - */ + /** Returns a new IDBKeyRange starting at key with no upper bound. If open is true, key is not included in the range. */ lowerBound(lower: any, open?: boolean): IDBKeyRange; - /** - * Returns a new IDBKeyRange spanning only key. - */ + /** Returns a new IDBKeyRange spanning only key. */ only(value: any): IDBKeyRange; - /** - * Returns a new IDBKeyRange with no lower bound and ending at key. If open is true, key is not included in the range. - */ + /** Returns a new IDBKeyRange with no lower bound and ending at key. If open is true, key is not included in the range. */ upperBound(upper: any, open?: boolean): IDBKeyRange; }; /** This example shows a variety of different uses of object stores, from updating the data structure with IDBObjectStore.createIndex inside an onupgradeneeded function, to adding a new item to our object store with IDBObjectStore.add. For a full working example, see our To-do Notifications app (view example live.) */ interface IDBObjectStore { - /** - * Returns true if the store has a key generator, and false otherwise. - */ + /** 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. - */ + /** Returns a list of the names of indexes in the store. */ readonly indexNames: DOMStringList; - /** - * Returns the key path of the store, or null if none. - */ + /** Returns the key path of the store, or null if none. */ readonly keyPath: string | string[]; - /** - * Returns the name of the store. - */ + /** Returns the name of the store. */ name: string; - /** - * Returns the associated transaction. - */ + /** Returns the associated transaction. */ readonly transaction: IDBTransaction; /** * Adds or updates a record in store with the given value and key. @@ -2100,27 +1949,17 @@ interface IDBRequestEventMap { /** The request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the IDBRequest instance. */ interface IDBRequest<T = any> extends EventTarget { - /** - * 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. - */ + /** 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; onerror: ((this: IDBRequest<T>, ev: Event) => any) | null; onsuccess: ((this: IDBRequest<T>, ev: Event) => any) | null; - /** - * Returns "pending" until a request is complete, then returns "done". - */ + /** Returns "pending" until a request is complete, then returns "done". */ readonly readyState: IDBRequestReadyState; - /** - * When a request is completed, returns the result, or undefined if the request failed. Throws a "InvalidStateError" DOMException if the request is still pending. - */ + /** When a request is completed, returns the result, or undefined if the request failed. Throws a "InvalidStateError" DOMException if the request is still pending. */ readonly result: T; - /** - * Returns the IDBObjectStore, IDBIndex, or IDBCursor the request was made against, or null if is was an open request. - */ + /** Returns the IDBObjectStore, IDBIndex, or IDBCursor the request was made against, or null if is was an open request. */ readonly source: IDBObjectStore | IDBIndex | IDBCursor; - /** - * 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. - */ + /** 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; addEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest<T>, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -2140,33 +1979,21 @@ interface IDBTransactionEventMap { } interface IDBTransaction extends EventTarget { - /** - * Returns the transaction's connection. - */ + /** Returns the transaction's connection. */ readonly db: IDBDatabase; - /** - * If the transaction was aborted, returns the error (a DOMException) providing the reason. - */ + /** If the transaction was aborted, returns the error (a DOMException) providing the reason. */ readonly error: DOMException | null; - /** - * Returns the mode the transaction was created with ("readonly" or "readwrite"), or "versionchange" for an upgrade transaction. - */ + /** Returns the mode the transaction was created with ("readonly" or "readwrite"), or "versionchange" for an upgrade transaction. */ readonly mode: IDBTransactionMode; - /** - * 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. - */ + /** 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; onabort: ((this: IDBTransaction, ev: Event) => any) | null; oncomplete: ((this: IDBTransaction, ev: Event) => any) | null; onerror: ((this: IDBTransaction, ev: Event) => any) | null; - /** - * Aborts the transaction. All pending requests will fail with a "AbortError" DOMException and all changes made to the database will be reverted. - */ + /** Aborts the transaction. All pending requests will fail with a "AbortError" DOMException and all changes made to the database will be reverted. */ abort(): void; commit(): void; - /** - * Returns an IDBObjectStore in the transaction's scope. - */ + /** Returns an IDBObjectStore in the transaction's scope. */ objectStore(name: string): IDBObjectStore; 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; @@ -2191,17 +2018,11 @@ declare var IDBVersionChangeEvent: { }; interface ImageBitmap { - /** - * Returns the intrinsic height of the image, in CSS pixels. - */ + /** Returns the intrinsic height of the image, in CSS pixels. */ readonly height: number; - /** - * Returns the intrinsic width of the image, in CSS pixels. - */ + /** Returns the intrinsic width of the image, in CSS pixels. */ readonly width: number; - /** - * Releases imageBitmap's underlying bitmap data. - */ + /** Releases imageBitmap's underlying bitmap data. */ close(): void; } @@ -2211,9 +2032,7 @@ declare var ImageBitmap: { }; interface ImageBitmapRenderingContext { - /** - * Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound. - */ + /** Transfers the underlying bitmap data from imageBitmap to context, and the bitmap becomes the contents of the canvas element to which context is bound. */ transferFromImageBitmap(bitmap: ImageBitmap | null): void; } @@ -2224,17 +2043,11 @@ declare var ImageBitmapRenderingContext: { /** The underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */ interface ImageData { - /** - * Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. - */ + /** Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. */ readonly data: Uint8ClampedArray; - /** - * Returns the actual dimensions of the data in the ImageData object, in pixels. - */ + /** Returns the actual dimensions of the data in the ImageData object, in pixels. */ readonly height: number; - /** - * Returns the actual dimensions of the data in the ImageData object, in pixels. - */ + /** Returns the actual dimensions of the data in the ImageData object, in pixels. */ readonly width: number; } @@ -2260,13 +2073,9 @@ declare var MediaCapabilities: { /** This Channel Messaging API interface allows us to create a new message channel and send data through it via its two MessagePort properties. */ interface MessageChannel { - /** - * Returns the first MessagePort object. - */ + /** Returns the first MessagePort object. */ readonly port1: MessagePort; - /** - * Returns the second MessagePort object. - */ + /** Returns the second MessagePort object. */ readonly port2: MessagePort; } @@ -2277,25 +2086,15 @@ declare var MessageChannel: { /** A message received by a target object. */ interface MessageEvent<T = any> extends Event { - /** - * Returns the data of the message. - */ + /** Returns the data of the message. */ readonly data: T; - /** - * Returns the last event ID string, for server-sent events. - */ + /** Returns the last event ID string, for server-sent events. */ readonly lastEventId: string; - /** - * Returns the origin of the message, for server-sent events and cross-document messaging. - */ + /** Returns the origin of the message, for server-sent events and cross-document messaging. */ readonly origin: string; - /** - * Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging. - */ + /** Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging. */ readonly ports: ReadonlyArray<MessagePort>; - /** - * Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects. - */ + /** Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects. */ readonly source: MessageEventSource | null; /** @deprecated */ initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: MessagePort[]): void; @@ -2315,9 +2114,7 @@ interface MessagePortEventMap { interface MessagePort extends EventTarget { onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null; onmessageerror: ((this: MessagePort, ev: MessageEvent) => any) | null; - /** - * Disconnects the port, so that it is no longer active. - */ + /** Disconnects the port, so that it is no longer active. */ close(): void; /** * 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. @@ -2325,10 +2122,8 @@ interface MessagePort extends EventTarget { * Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned. */ postMessage(message: any, transfer: Transferable[]): void; - postMessage(message: any, options?: PostMessageOptions): void; - /** - * Begins dispatching messages received on the port. - */ + postMessage(message: any, options?: StructuredSerializeOptions): void; + /** Begins dispatching messages received on the port. */ start(): void; 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; @@ -2372,6 +2167,7 @@ interface NavigatorOnLine { readonly onLine: boolean; } +/** Available only in secure contexts. */ interface NavigatorStorage { readonly storage: StorageManager; } @@ -2480,9 +2276,7 @@ interface OffscreenCanvas extends EventTarget { /** This Canvas 2D API interface is used to declare a path that can then be used on a CanvasRenderingContext2D object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired. */ interface Path2D extends CanvasPath { - /** - * Adds to the path the path given by the argument. - */ + /** Adds to the path the path given by the argument. */ addPath(path: Path2D, transform?: DOMMatrix2DInit): void; } @@ -2668,7 +2462,10 @@ declare var PromiseRejectionEvent: { new(type: string, eventInitDict: PromiseRejectionEventInit): PromiseRejectionEvent; }; -/** This Push API interface represents a push message that has been received. This event is sent to the global scope of a ServiceWorker. It contains the information sent from an application server to a PushSubscription. */ +/** + * This Push API interface represents a push message that has been received. This event is sent to the global scope of a ServiceWorker. It contains the information sent from an application server to a PushSubscription. + * Available only in secure contexts. + */ interface PushEvent extends ExtendableEvent { readonly data: PushMessageData | null; } @@ -2678,7 +2475,10 @@ declare var PushEvent: { new(type: string, eventInitDict?: PushEventInit): PushEvent; }; -/** This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications. */ +/** + * This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications. + * Available only in secure contexts. + */ interface PushManager { getSubscription(): Promise<PushSubscription | null>; permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>; @@ -2691,7 +2491,10 @@ declare var PushManager: { readonly supportedContentEncodings: ReadonlyArray<string>; }; -/** This Push API interface provides methods which let you retrieve the push data sent by a server in various formats. */ +/** + * This Push API interface provides methods which let you retrieve the push data sent by a server in various formats. + * Available only in secure contexts. + */ interface PushMessageData { arrayBuffer(): ArrayBuffer; blob(): Blob; @@ -2704,7 +2507,10 @@ declare var PushMessageData: { new(): PushMessageData; }; -/** This Push API interface provides a subcription's URL endpoint and allows unsubscription from a push service. */ +/** + * This Push API interface provides a subcription's URL endpoint and allows unsubscription from a push service. + * Available only in secure contexts. + */ interface PushSubscription { readonly endpoint: string; readonly options: PushSubscriptionOptions; @@ -2718,6 +2524,7 @@ declare var PushSubscription: { new(): PushSubscription; }; +/** Available only in secure contexts. */ interface PushSubscriptionOptions { readonly applicationServerKey: ArrayBuffer | null; } @@ -2735,7 +2542,6 @@ interface ReadableStream<R = any> { pipeThrough<T>(transform: ReadableWritablePair<T, R>, options?: StreamPipeOptions): ReadableStream<T>; pipeTo(destination: WritableStream<R>, options?: StreamPipeOptions): Promise<void>; tee(): [ReadableStream<R>, ReadableStream<R>]; - forEach(callbackfn: (value: any, key: number, parent: ReadableStream<R>) => void, thisArg?: any): void; } declare var ReadableStream: { @@ -2772,57 +2578,31 @@ interface ReadableStreamGenericReader { /** This Fetch API interface represents a resource request. */ interface Request extends Body { - /** - * Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. - */ + /** Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser's cache when fetching. */ readonly cache: RequestCache; - /** - * 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. - */ + /** 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. */ readonly credentials: RequestCredentials; - /** - * Returns the kind of resource requested by request, e.g., "document" or "script". - */ + /** Returns the kind of resource requested by request, e.g., "document" or "script". */ readonly destination: RequestDestination; - /** - * 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. - */ + /** 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. */ readonly headers: Headers; - /** - * 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] - */ + /** 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] */ readonly integrity: string; - /** - * Returns a boolean indicating whether or not request can outlive the global in which it was created. - */ + /** Returns a boolean indicating whether or not request can outlive the global in which it was created. */ readonly keepalive: boolean; - /** - * Returns request's HTTP method, which is "GET" by default. - */ + /** Returns request's HTTP method, which is "GET" by default. */ readonly method: string; - /** - * 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. - */ + /** 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. */ readonly mode: RequestMode; - /** - * 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. - */ + /** 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. */ readonly redirect: RequestRedirect; - /** - * 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. - */ + /** 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. */ readonly referrer: string; - /** - * Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. - */ + /** Returns the referrer policy associated with request. This is used during fetching to compute the value of the request's referrer. */ readonly referrerPolicy: ReferrerPolicy; - /** - * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler. - */ + /** 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: AbortSignal; - /** - * Returns the URL of request as a string. - */ + /** Returns the URL of request as a string. */ readonly url: string; clone(): Request; } @@ -2876,13 +2656,16 @@ interface ServiceWorkerEventMap extends AbstractWorkerEventMap { "statechange": Event; } -/** This ServiceWorker API interface provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object. */ +/** + * This ServiceWorker API interface provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object. + * Available only in secure contexts. + */ interface ServiceWorker extends EventTarget, AbstractWorker { onstatechange: ((this: ServiceWorker, ev: Event) => any) | null; readonly scriptURL: string; readonly state: ServiceWorkerState; postMessage(message: any, transfer: Transferable[]): void; - postMessage(message: any, options?: PostMessageOptions): void; + postMessage(message: any, options?: StructuredSerializeOptions): void; 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; @@ -2900,7 +2683,10 @@ interface ServiceWorkerContainerEventMap { "messageerror": MessageEvent; } -/** The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations. */ +/** + * The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations. + * Available only in secure contexts. + */ interface ServiceWorkerContainer extends EventTarget { readonly controller: ServiceWorker | null; oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null; @@ -2961,7 +2747,10 @@ interface ServiceWorkerRegistrationEventMap { "updatefound": Event; } -/** This ServiceWorker API interface represents the service worker registration. You register a service worker to control one or more pages that share the same origin. */ +/** + * This ServiceWorker API interface represents the service worker registration. You register a service worker to control one or more pages that share the same origin. + * Available only in secure contexts. + */ interface ServiceWorkerRegistration extends EventTarget { readonly active: ServiceWorker | null; readonly installing: ServiceWorker | null; @@ -2990,14 +2779,10 @@ interface SharedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap { } interface SharedWorkerGlobalScope extends WorkerGlobalScope { - /** - * Returns sharedWorkerGlobal's name, i.e. the value given to the SharedWorker constructor. Multiple SharedWorker objects can correspond to the same shared worker (and SharedWorkerGlobalScope), by reusing the same name. - */ + /** Returns sharedWorkerGlobal's name, i.e. the value given to the SharedWorker constructor. Multiple SharedWorker objects can correspond to the same shared worker (and SharedWorkerGlobalScope), by reusing the same name. */ readonly name: string; onconnect: ((this: SharedWorkerGlobalScope, ev: MessageEvent) => any) | null; - /** - * Aborts sharedWorkerGlobal. - */ + /** Aborts sharedWorkerGlobal. */ close(): void; addEventListener<K extends keyof SharedWorkerGlobalScopeEventMap>(type: K, listener: (this: SharedWorkerGlobalScope, ev: SharedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -3010,6 +2795,7 @@ declare var SharedWorkerGlobalScope: { new(): SharedWorkerGlobalScope; }; +/** Available only in secure contexts. */ interface StorageManager { estimate(): Promise<StorageEstimate>; persisted(): Promise<boolean>; @@ -3020,7 +2806,10 @@ declare var StorageManager: { new(): StorageManager; }; -/** This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). */ +/** + * This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). + * Available only in secure contexts. + */ interface SubtleCrypto { decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>; deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>; @@ -3069,17 +2858,11 @@ declare var TextDecoder: { }; interface TextDecoderCommon { - /** - * Returns encoding's name, lowercased. - */ + /** Returns encoding's name, lowercased. */ readonly encoding: string; - /** - * Returns true if error mode is "fatal", otherwise false. - */ + /** Returns true if error mode is "fatal", otherwise false. */ readonly fatal: boolean; - /** - * Returns the value of ignore BOM. - */ + /** Returns the value of ignore BOM. */ readonly ignoreBOM: boolean; } @@ -3095,13 +2878,9 @@ declare var TextDecoderStream: { /** TextEncoder takes a stream of code points as input and emits a stream of bytes. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. */ interface TextEncoder extends TextEncoderCommon { - /** - * Returns the result of running UTF-8's encoder. - */ + /** Returns the result of running UTF-8's encoder. */ encode(input?: string): Uint8Array; - /** - * Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. - */ + /** Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as an object wherein read is the number of converted code units of source and written is the number of bytes modified in destination. */ encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult; } @@ -3111,9 +2890,7 @@ declare var TextEncoder: { }; interface TextEncoderCommon { - /** - * Returns "utf-8". - */ + /** Returns "utf-8". */ readonly encoding: string; } @@ -3129,33 +2906,19 @@ declare var TextEncoderStream: { /** The dimensions of a piece of text in the canvas, as created by the CanvasRenderingContext2D.measureText() method. */ interface TextMetrics { - /** - * Returns the measurement described below. - */ + /** Returns the measurement described below. */ readonly actualBoundingBoxAscent: number; - /** - * Returns the measurement described below. - */ + /** Returns the measurement described below. */ readonly actualBoundingBoxDescent: number; - /** - * Returns the measurement described below. - */ + /** Returns the measurement described below. */ readonly actualBoundingBoxLeft: number; - /** - * Returns the measurement described below. - */ + /** Returns the measurement described below. */ readonly actualBoundingBoxRight: number; - /** - * Returns the measurement described below. - */ + /** Returns the measurement described below. */ readonly fontBoundingBoxAscent: number; - /** - * Returns the measurement described below. - */ + /** Returns the measurement described below. */ readonly fontBoundingBoxDescent: number; - /** - * Returns the measurement described below. - */ + /** Returns the measurement described below. */ readonly width: number; } @@ -3207,39 +2970,25 @@ interface URL { declare var URL: { prototype: URL; new(url: string | URL, base?: string | URL): URL; - createObjectURL(object: any): string; + createObjectURL(obj: Blob): string; revokeObjectURL(url: string): void; }; interface URLSearchParams { - /** - * Appends a specified key/value pair as a new search parameter. - */ + /** 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. - */ + /** 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. - */ + /** 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. - */ + /** Returns all the values association with a given search parameter. */ getAll(name: string): string[]; - /** - * Returns a Boolean indicating if such a search parameter exists. - */ + /** 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. - */ + /** 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; sort(): void; - /** - * Returns a string containing a query string suitable for use in a URL. Does not include the question mark. - */ + /** Returns a string containing a query string suitable for use in a URL. Does not include the question mark. */ toString(): string; forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void; } @@ -5288,33 +5037,21 @@ interface WebSocket extends EventTarget { * If the WebSocket connection is closed, this attribute's value will only increase with each call to the send() method. (The number does not reset to zero once the connection closes.) */ readonly bufferedAmount: number; - /** - * Returns the extensions selected by the server, if any. - */ + /** Returns the extensions selected by the server, if any. */ readonly extensions: string; 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; - /** - * Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation. - */ + /** Returns the subprotocol selected by the server, if any. It can be used in conjunction with the array form of the constructor's second argument to perform subprotocol negotiation. */ readonly protocol: string; - /** - * Returns the state of the WebSocket object's connection. It can have the values described below. - */ + /** Returns the state of the WebSocket object's connection. It can have the values described below. */ readonly readyState: number; - /** - * Returns the URL that was used to establish the WebSocket connection. - */ + /** Returns the URL that was used to establish the WebSocket connection. */ readonly url: string; - /** - * Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason. - */ + /** Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason. */ close(code?: number, reason?: string): void; - /** - * Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView. - */ + /** Transmits data using the WebSocket connection. data can be a string, a Blob, an ArrayBuffer, or an ArrayBufferView. */ send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void; readonly CLOSED: number; readonly CLOSING: number; @@ -5349,6 +5086,7 @@ declare var WindowClient: { }; interface WindowOrWorkerGlobalScope { + /** Available only in secure contexts. */ readonly caches: CacheStorage; readonly crossOriginIsolated: boolean; readonly crypto: Crypto; @@ -5377,14 +5115,10 @@ interface WorkerEventMap extends AbstractWorkerEventMap { interface Worker extends EventTarget, AbstractWorker { onmessage: ((this: Worker, ev: MessageEvent) => any) | null; onmessageerror: ((this: Worker, ev: MessageEvent) => any) | null; - /** - * Clones message and transmits it to worker's global environment. transfer can be passed as a list of objects that are to be transferred rather than cloned. - */ + /** Clones message and transmits it to worker's global environment. transfer can be passed as a list of objects that are to be transferred rather than cloned. */ postMessage(message: any, transfer: Transferable[]): void; - postMessage(message: any, options?: PostMessageOptions): void; - /** - * Aborts worker's associated global environment. - */ + postMessage(message: any, options?: StructuredSerializeOptions): void; + /** Aborts worker's associated global environment. */ terminate(): void; 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; @@ -5408,13 +5142,9 @@ interface WorkerGlobalScopeEventMap { /** This Web Workers API interface is an interface representing the scope of any worker. Workers have no browsing context; this scope contains the information usually conveyed by Window objects — in this case event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop. */ interface WorkerGlobalScope extends EventTarget, FontFaceSource, WindowOrWorkerGlobalScope { - /** - * Returns workerGlobal's WorkerLocation object. - */ + /** Returns workerGlobal's WorkerLocation object. */ readonly location: WorkerLocation; - /** - * Returns workerGlobal's WorkerNavigator object. - */ + /** Returns workerGlobal's WorkerNavigator object. */ readonly navigator: WorkerNavigator; onerror: ((this: WorkerGlobalScope, ev: ErrorEvent) => any) | null; onlanguagechange: ((this: WorkerGlobalScope, ev: Event) => any) | null; @@ -5422,13 +5152,9 @@ interface WorkerGlobalScope extends EventTarget, FontFaceSource, WindowOrWorkerG ononline: ((this: WorkerGlobalScope, ev: Event) => any) | null; onrejectionhandled: ((this: WorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null; onunhandledrejection: ((this: WorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null; - /** - * Returns workerGlobal. - */ + /** Returns workerGlobal. */ readonly self: WorkerGlobalScope & typeof globalThis; - /** - * Fetches each URL in urls, executes them one-by-one in the order they are passed, and then returns (or throws if something went amiss). - */ + /** Fetches each URL in urls, executes them one-by-one in the order they are passed, and then returns (or throws if something went amiss). */ importScripts(...urls: (string | URL)[]): 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; @@ -5516,13 +5242,9 @@ interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap { /** Use XMLHttpRequest (XHR) objects to interact with servers. You can retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what the user is doing. */ interface XMLHttpRequest extends XMLHttpRequestEventTarget { onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null; - /** - * Returns client's state. - */ + /** Returns client's state. */ readonly readyState: number; - /** - * Returns the response body. - */ + /** Returns the response body. */ readonly response: any; /** * Returns response as text. @@ -5551,9 +5273,7 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { * When set: throws an "InvalidAccessError" DOMException if the synchronous flag is set and current global object is a Window object. */ timeout: number; - /** - * Returns the associated XMLHttpRequestUpload object. It can be used to gather transmission information when data is transferred to a server. - */ + /** Returns the associated XMLHttpRequestUpload object. It can be used to gather transmission information when data is transferred to a server. */ readonly upload: XMLHttpRequestUpload; /** * 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. @@ -5561,9 +5281,7 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { * When set: throws an "InvalidStateError" DOMException if state is not unsent or opened, or if the send() flag is set. */ withCredentials: boolean; - /** - * Cancels any network activity. - */ + /** Cancels any network activity. */ abort(): void; getAllResponseHeaders(): string; getResponseHeader(name: string): string | null; @@ -5691,7 +5409,8 @@ declare namespace WebAssembly { var CompileError: { prototype: CompileError; - new(): CompileError; + new(message?: string): CompileError; + (message?: string): CompileError; }; interface Global { @@ -5718,7 +5437,8 @@ declare namespace WebAssembly { var LinkError: { prototype: LinkError; - new(): LinkError; + new(message?: string): LinkError; + (message?: string): LinkError; }; interface Memory { @@ -5747,7 +5467,8 @@ declare namespace WebAssembly { var RuntimeError: { prototype: RuntimeError; - new(): RuntimeError; + new(message?: string): RuntimeError; + (message?: string): RuntimeError; }; interface Table { @@ -5824,7 +5545,7 @@ interface PerformanceObserverCallback { } interface QueuingStrategySize<T = any> { - (chunk?: T): number; + (chunk: T): number; } interface TransformerFlushCallback<O> { @@ -5871,32 +5592,20 @@ interface VoidFunction { (): void; } -/** - * Returns dedicatedWorkerGlobal's name, i.e. the value given to the Worker constructor. Primarily useful for debugging. - */ +/** Returns dedicatedWorkerGlobal's name, i.e. the value given to the Worker constructor. Primarily useful for debugging. */ declare var name: string; declare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null; declare var onmessageerror: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null; -/** - * Aborts dedicatedWorkerGlobal. - */ +/** Aborts dedicatedWorkerGlobal. */ declare function close(): void; -/** - * Clones message and transmits it to the Worker object associated with dedicatedWorkerGlobal. transfer can be passed as a list of objects that are to be transferred rather than cloned. - */ +/** Clones message and transmits it to the Worker object associated with dedicatedWorkerGlobal. transfer can be passed as a list of objects that are to be transferred rather than cloned. */ declare function postMessage(message: any, transfer: Transferable[]): void; -declare function postMessage(message: any, options?: PostMessageOptions): void; -/** - * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. - */ +declare function postMessage(message: any, options?: StructuredSerializeOptions): void; +/** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ declare function dispatchEvent(event: Event): boolean; -/** - * Returns workerGlobal's WorkerLocation object. - */ +/** Returns workerGlobal's WorkerLocation object. */ declare var location: WorkerLocation; -/** - * Returns workerGlobal's WorkerNavigator object. - */ +/** Returns workerGlobal's WorkerNavigator object. */ declare var navigator: WorkerNavigator; declare var onerror: ((this: DedicatedWorkerGlobalScope, ev: ErrorEvent) => any) | null; declare var onlanguagechange: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null; @@ -5904,19 +5613,14 @@ declare var onoffline: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | declare var ononline: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null; declare var onrejectionhandled: ((this: DedicatedWorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null; declare var onunhandledrejection: ((this: DedicatedWorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null; -/** - * Returns workerGlobal. - */ +/** Returns workerGlobal. */ declare var self: WorkerGlobalScope & typeof globalThis; -/** - * Fetches each URL in urls, executes them one-by-one in the order they are passed, and then returns (or throws if something went amiss). - */ +/** Fetches each URL in urls, executes them one-by-one in the order they are passed, and then returns (or throws if something went amiss). */ declare function importScripts(...urls: (string | URL)[]): void; -/** - * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. - */ +/** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ declare function dispatchEvent(event: Event): boolean; declare var fonts: FontFaceSet; +/** Available only in secure contexts. */ declare var caches: CacheStorage; declare var crossOriginIsolated: boolean; declare var crypto: Crypto; @@ -6005,7 +5709,7 @@ type MediaDecodingType = "file" | "media-source" | "webrtc"; type MediaEncodingType = "record" | "webrtc"; type NotificationDirection = "auto" | "ltr" | "rtl"; type NotificationPermission = "default" | "denied" | "granted"; -type PermissionName = "gamepad" | "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock"; +type PermissionName = "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "xr-spatial-tracking"; type PermissionState = "denied" | "granted" | "prompt"; type PredefinedColorSpace = "display-p3" | "srgb"; type PremultiplyAlpha = "default" | "none" | "premultiply"; |