UNPKG

@types/sharedworker

Version:
1,531 lines (1,352 loc) 527 kB
/// <reference path="./iterable.d.ts" /> /// <reference path="./asynciterable.d.ts" /> ///////////////////////////// /// SharedWorker APIs ///////////////////////////// interface AddEventListenerOptions extends EventListenerOptions { once?: boolean; passive?: boolean; signal?: AbortSignal; } interface AesCbcParams extends Algorithm { iv: BufferSource; } interface AesCtrParams extends Algorithm { counter: BufferSource; length: number; } interface AesDerivedKeyParams extends Algorithm { length: number; } interface AesGcmParams extends Algorithm { additionalData?: BufferSource; iv: BufferSource; tagLength?: number; } interface AesKeyAlgorithm extends KeyAlgorithm { length: number; } interface AesKeyGenParams extends Algorithm { length: number; } interface Algorithm { name: string; } interface AudioConfiguration { bitrate?: number; channels?: string; contentType: string; samplerate?: number; spatialRendering?: boolean; } interface BlobPropertyBag { endings?: EndingType; type?: string; } interface CSSMatrixComponentOptions { is2D?: boolean; } interface CSSNumericType { angle?: number; flex?: number; frequency?: number; length?: number; percent?: number; percentHint?: CSSNumericBaseType; resolution?: number; time?: number; } interface CacheQueryOptions { ignoreMethod?: boolean; ignoreSearch?: boolean; ignoreVary?: boolean; } interface CloseEventInit extends EventInit { code?: number; reason?: string; wasClean?: boolean; } interface CryptoKeyPair { privateKey: CryptoKey; publicKey: CryptoKey; } interface CustomEventInit<T = any> extends EventInit { detail?: T; } 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; } interface EcKeyGenParams extends Algorithm { namedCurve: NamedCurve; } interface EcKeyImportParams extends Algorithm { namedCurve: NamedCurve; } interface EcdhKeyDeriveParams extends Algorithm { public: CryptoKey; } interface EcdsaParams extends Algorithm { hash: HashAlgorithmIdentifier; } interface ErrorEventInit extends EventInit { colno?: number; error?: any; filename?: string; lineno?: number; message?: string; } interface EventInit { bubbles?: boolean; cancelable?: boolean; composed?: boolean; } interface EventListenerOptions { capture?: boolean; } interface EventSourceInit { withCredentials?: boolean; } interface FilePropertyBag extends BlobPropertyBag { lastModified?: number; } interface FileSystemCreateWritableOptions { keepExistingData?: boolean; } interface FileSystemGetDirectoryOptions { create?: boolean; } interface FileSystemGetFileOptions { create?: boolean; } interface FileSystemRemoveOptions { recursive?: boolean; } interface FontFaceDescriptors { ascentOverride?: string; descentOverride?: string; display?: FontDisplay; featureSettings?: string; lineGapOverride?: string; stretch?: string; style?: string; unicodeRange?: string; weight?: string; } interface FontFaceSetLoadEventInit extends EventInit { fontfaces?: FontFace[]; } interface GetNotificationOptions { tag?: string; } interface HkdfParams extends Algorithm { hash: HashAlgorithmIdentifier; info: BufferSource; salt: BufferSource; } interface HmacImportParams extends Algorithm { hash: HashAlgorithmIdentifier; length?: number; } interface HmacKeyGenParams extends Algorithm { hash: HashAlgorithmIdentifier; length?: number; } interface IDBDatabaseInfo { name?: string; version?: number; } interface IDBIndexParameters { multiEntry?: boolean; unique?: boolean; } interface IDBObjectStoreParameters { autoIncrement?: boolean; keyPath?: string | string[] | null; } interface IDBTransactionOptions { durability?: IDBTransactionDurability; } interface IDBVersionChangeEventInit extends EventInit { newVersion?: number | null; oldVersion?: number; } interface ImageBitmapOptions { colorSpaceConversion?: ColorSpaceConversion; imageOrientation?: ImageOrientation; premultiplyAlpha?: PremultiplyAlpha; resizeHeight?: number; resizeQuality?: ResizeQuality; resizeWidth?: number; } interface ImageBitmapRenderingContextSettings { alpha?: boolean; } interface ImageDataSettings { colorSpace?: PredefinedColorSpace; } interface ImageEncodeOptions { quality?: number; type?: string; } interface JsonWebKey { alg?: string; crv?: string; d?: string; dp?: string; dq?: string; e?: string; ext?: boolean; k?: string; key_ops?: string[]; kty?: string; n?: string; oth?: RsaOtherPrimesInfo[]; p?: string; q?: string; qi?: string; use?: string; x?: string; y?: string; } interface KeyAlgorithm { name: string; } interface KeySystemTrackConfiguration { robustness?: string; } interface LockInfo { clientId?: string; mode?: LockMode; name?: string; } interface LockManagerSnapshot { held?: LockInfo[]; pending?: LockInfo[]; } interface LockOptions { ifAvailable?: boolean; mode?: LockMode; signal?: AbortSignal; steal?: boolean; } interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo { } interface MediaCapabilitiesEncodingInfo extends MediaCapabilitiesInfo { } interface MediaCapabilitiesInfo { powerEfficient: boolean; smooth: boolean; supported: boolean; } interface MediaCapabilitiesKeySystemConfiguration { audio?: KeySystemTrackConfiguration; distinctiveIdentifier?: MediaKeysRequirement; initDataType?: string; keySystem: string; persistentState?: MediaKeysRequirement; sessionTypes?: string[]; video?: KeySystemTrackConfiguration; } interface MediaConfiguration { audio?: AudioConfiguration; video?: VideoConfiguration; } interface MediaDecodingConfiguration extends MediaConfiguration { keySystemConfiguration?: MediaCapabilitiesKeySystemConfiguration; type: MediaDecodingType; } interface MediaEncodingConfiguration extends MediaConfiguration { type: MediaEncodingType; } interface MessageEventInit<T = any> extends EventInit { data?: T; lastEventId?: string; origin?: string; ports?: MessagePort[]; source?: MessageEventSource | null; } interface MultiCacheQueryOptions extends CacheQueryOptions { cacheName?: string; } interface NavigationPreloadState { enabled?: boolean; headerValue?: string; } interface NotificationOptions { badge?: string; body?: string; data?: any; dir?: NotificationDirection; icon?: string; lang?: string; requireInteraction?: boolean; silent?: boolean | null; tag?: string; } interface Pbkdf2Params extends Algorithm { hash: HashAlgorithmIdentifier; iterations: number; salt: BufferSource; } interface PerformanceMarkOptions { detail?: any; startTime?: DOMHighResTimeStamp; } interface PerformanceMeasureOptions { detail?: any; duration?: DOMHighResTimeStamp; end?: string | DOMHighResTimeStamp; start?: string | DOMHighResTimeStamp; } interface PerformanceObserverInit { buffered?: boolean; entryTypes?: string[]; type?: string; } interface PermissionDescriptor { name: PermissionName; } interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; total?: number; } interface PromiseRejectionEventInit extends EventInit { promise: Promise<any>; reason?: any; } interface PushSubscriptionJSON { endpoint?: string; expirationTime?: EpochTimeStamp | null; keys?: Record<string, string>; } interface PushSubscriptionOptionsInit { applicationServerKey?: BufferSource | string | null; userVisibleOnly?: boolean; } interface QueuingStrategy<T = any> { highWaterMark?: number; size?: QueuingStrategySize<T>; } interface QueuingStrategyInit { /** * Creates a new ByteLengthQueuingStrategy with the provided high water mark. * * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw. */ highWaterMark: number; } interface ReadableStreamGetReaderOptions { /** * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. * * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation. */ mode?: ReadableStreamReaderMode; } interface ReadableStreamIteratorOptions { /** * Asynchronously iterates over the chunks in the stream's internal queue. * * Asynchronously iterating over the stream will lock it, preventing any other consumer from acquiring a reader. The lock will be released if the async iterator's return() method is called, e.g. by breaking out of the loop. * * By default, calling the async iterator's return() method will also cancel the stream. To prevent this, use the stream's values() method, passing true for the preventCancel option. */ preventCancel?: boolean; } interface ReadableStreamReadDoneResult<T> { done: true; value: T | undefined; } interface ReadableStreamReadValueResult<T> { done: false; value: T; } interface ReadableWritablePair<R = any, W = any> { readable: ReadableStream<R>; /** * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use. * * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. */ writable: WritableStream<W>; } interface RegistrationOptions { scope?: string; type?: WorkerType; updateViaCache?: ServiceWorkerUpdateViaCache; } interface ReportingObserverOptions { buffered?: boolean; types?: string[]; } interface RequestInit { /** 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. */ 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. */ credentials?: RequestCredentials; /** 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. */ integrity?: string; /** A boolean to set request's keepalive. */ keepalive?: boolean; /** 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. */ mode?: RequestMode; priority?: RequestPriority; /** 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. */ referrer?: string; /** A referrer policy to set request's referrerPolicy. */ referrerPolicy?: ReferrerPolicy; /** An AbortSignal to set request's signal. */ signal?: AbortSignal | null; /** Can only be null. Used to disassociate request from any Window. */ window?: null; } interface ResponseInit { headers?: HeadersInit; status?: number; statusText?: string; } interface RsaHashedImportParams extends Algorithm { hash: HashAlgorithmIdentifier; } interface RsaHashedKeyGenParams extends RsaKeyGenParams { hash: HashAlgorithmIdentifier; } interface RsaKeyGenParams extends Algorithm { modulusLength: number; publicExponent: BigInteger; } interface RsaOaepParams extends Algorithm { label?: BufferSource; } interface RsaOtherPrimesInfo { d?: string; r?: string; t?: string; } interface RsaPssParams extends Algorithm { saltLength: number; } interface SecurityPolicyViolationEventInit extends EventInit { blockedURI?: string; columnNumber?: number; disposition?: SecurityPolicyViolationEventDisposition; documentURI?: string; effectiveDirective?: string; lineNumber?: number; originalPolicy?: string; referrer?: string; sample?: string; sourceFile?: string; statusCode?: number; violatedDirective?: string; } interface StorageEstimate { quota?: number; usage?: number; } interface StreamPipeOptions { preventAbort?: boolean; preventCancel?: boolean; /** * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. * * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. * * Errors and closures of the source and destination streams propagate as follows: * * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination. * * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source. * * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. * * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. * * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set. */ preventClose?: boolean; signal?: AbortSignal; } interface StructuredSerializeOptions { transfer?: Transferable[]; } interface TextDecodeOptions { stream?: boolean; } interface TextDecoderOptions { fatal?: boolean; ignoreBOM?: boolean; } interface TextEncoderEncodeIntoResult { read: number; written: number; } interface Transformer<I = any, O = any> { flush?: TransformerFlushCallback<O>; readableType?: undefined; start?: TransformerStartCallback<O>; transform?: TransformerTransformCallback<I, O>; writableType?: undefined; } interface URLPatternComponentResult { groups?: Record<string, string | undefined>; input?: string; } interface URLPatternInit { baseURL?: string; hash?: string; hostname?: string; password?: string; pathname?: string; port?: string; protocol?: string; search?: string; username?: string; } interface URLPatternOptions { ignoreCase?: boolean; } interface URLPatternResult { hash?: URLPatternComponentResult; hostname?: URLPatternComponentResult; inputs?: URLPatternInput[]; password?: URLPatternComponentResult; pathname?: URLPatternComponentResult; port?: URLPatternComponentResult; protocol?: URLPatternComponentResult; search?: URLPatternComponentResult; username?: URLPatternComponentResult; } interface UnderlyingByteSource { autoAllocateChunkSize?: number; cancel?: UnderlyingSourceCancelCallback; pull?: (controller: ReadableByteStreamController) => void | PromiseLike<void>; start?: (controller: ReadableByteStreamController) => any; type: "bytes"; } interface UnderlyingDefaultSource<R = any> { cancel?: UnderlyingSourceCancelCallback; pull?: (controller: ReadableStreamDefaultController<R>) => void | PromiseLike<void>; start?: (controller: ReadableStreamDefaultController<R>) => any; type?: undefined; } interface UnderlyingSink<W = any> { abort?: UnderlyingSinkAbortCallback; close?: UnderlyingSinkCloseCallback; start?: UnderlyingSinkStartCallback; type?: undefined; write?: UnderlyingSinkWriteCallback<W>; } interface UnderlyingSource<R = any> { autoAllocateChunkSize?: number; cancel?: UnderlyingSourceCancelCallback; pull?: UnderlyingSourcePullCallback<R>; start?: UnderlyingSourceStartCallback<R>; type?: ReadableStreamType; } interface VideoConfiguration { bitrate: number; colorGamut?: ColorGamut; contentType: string; framerate: number; hasAlphaChannel?: boolean; hdrMetadataType?: HdrMetadataType; height: number; scalabilityMode?: string; transferFunction?: TransferFunction; width: number; } interface WebGLContextAttributes { alpha?: boolean; antialias?: boolean; depth?: boolean; desynchronized?: boolean; failIfMajorPerformanceCaveat?: boolean; powerPreference?: WebGLPowerPreference; premultipliedAlpha?: boolean; preserveDrawingBuffer?: boolean; stencil?: boolean; } interface WebGLContextEventInit extends EventInit { statusMessage?: string; } interface WebTransportCloseInfo { closeCode?: number; reason?: string; } interface WebTransportErrorOptions { source?: WebTransportErrorSource; streamErrorCode?: number | null; } interface WebTransportHash { algorithm?: string; value?: BufferSource; } interface WebTransportOptions { allowPooling?: boolean; congestionControl?: WebTransportCongestionControl; requireUnreliable?: boolean; serverCertificateHashes?: WebTransportHash[]; } interface WebTransportSendOptions { sendOrder?: number; } interface WebTransportSendStreamOptions extends WebTransportSendOptions { } interface WorkerOptions { credentials?: RequestCredentials; name?: string; type?: WorkerType; } interface WriteParams { data?: BufferSource | Blob | string | null; position?: number | null; size?: number | null; type: WriteCommandType; } /** * The **`ANGLE_instanced_arrays`** extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays) */ interface ANGLE_instanced_arrays { /** * The **`ANGLE_instanced_arrays.drawArraysInstancedANGLE()`** method of the WebGL API renders primitives from array data like the WebGLRenderingContext.drawArrays() method. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawArraysInstancedANGLE) */ drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void; /** * The **`ANGLE_instanced_arrays.drawElementsInstancedANGLE()`** method of the WebGL API renders primitives from array data like the WebGLRenderingContext.drawElements() method. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawElementsInstancedANGLE) */ drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void; /** * The **ANGLE_instanced_arrays.vertexAttribDivisorANGLE()** method of the WebGL API modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with ANGLE_instanced_arrays.drawArraysInstancedANGLE() and ANGLE_instanced_arrays.drawElementsInstancedANGLE(). * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/vertexAttribDivisorANGLE) */ vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void; readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: 0x88FE; } /** * The **`AbortController`** interface represents a controller object that allows you to abort one or more Web requests as and when desired. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController) */ interface AbortController { /** * The **`signal`** read-only property of the AbortController interface returns an AbortSignal object instance, which can be used to communicate with/abort an asynchronous operation as desired. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal) */ readonly signal: AbortSignal; /** * The **`abort()`** method of the AbortController interface aborts an asynchronous operation before it has completed. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/abort) */ abort(reason?: any): void; } declare var AbortController: { prototype: AbortController; new(): AbortController; }; interface AbortSignalEventMap { "abort": Event; } /** * The **`AbortSignal`** interface represents a signal object that allows you to communicate with an asynchronous operation (such as a fetch request) and abort it if required via an AbortController object. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal) */ interface AbortSignal extends EventTarget { /** * The **`aborted`** read-only property returns a value that indicates whether the asynchronous operations the signal is communicating with are aborted (`true`) or not (`false`). * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/aborted) */ readonly aborted: boolean; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_event) */ onabort: ((this: AbortSignal, ev: Event) => any) | null; /** * The **`reason`** read-only property returns a JavaScript value that indicates the abort reason. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */ readonly reason: any; /** * The **`throwIfAborted()`** method throws the signal's abort AbortSignal.reason if the signal has been aborted; otherwise it does nothing. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/throwIfAborted) */ throwIfAborted(): void; addEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var AbortSignal: { prototype: AbortSignal; new(): AbortSignal; /** * The **`AbortSignal.abort()`** static method returns an AbortSignal that is already set as aborted (and which does not trigger an AbortSignal/abort_event event). * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */ // abort(reason?: any): AbortSignal; - To be re-added in the future /** * The **`AbortSignal.any()`** static method takes an iterable of abort signals and returns an AbortSignal. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */ any(signals: AbortSignal[]): AbortSignal; /** * The **`AbortSignal.timeout()`** static method returns an AbortSignal that will automatically abort after a specified time. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/timeout_static) */ timeout(milliseconds: number): AbortSignal; }; interface AbstractWorkerEventMap { "error": ErrorEvent; } interface AbstractWorker { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorker/error_event) */ 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; } /** * The **`Blob`** interface represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a ReadableStream so its methods can be used for processing the data. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob) */ interface Blob { /** * The **`size`** read-only property of the Blob interface returns the size of the Blob or File in bytes. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */ readonly size: number; /** * The **`type`** read-only property of the Blob interface returns the MIME type of the file. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */ readonly type: string; /** * The **`arrayBuffer()`** method of the Blob interface returns a Promise that resolves with the contents of the blob as binary data contained in an ArrayBuffer. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */ arrayBuffer(): Promise<ArrayBuffer>; /** * The **`bytes()`** method of the Blob interface returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/bytes) */ bytes(): Promise<Uint8Array<ArrayBuffer>>; /** * The **`slice()`** method of the Blob interface creates and returns a new `Blob` object which contains data from a subset of the blob on which it's called. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */ slice(start?: number, end?: number, contentType?: string): Blob; /** * The **`stream()`** method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the `Blob`. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */ stream(): ReadableStream<Uint8Array<ArrayBuffer>>; /** * The **`text()`** method of the string containing the contents of the blob, interpreted as UTF-8. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */ text(): Promise<string>; } declare var Blob: { prototype: Blob; new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob; }; interface Body { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) */ readonly body: ReadableStream<Uint8Array<ArrayBuffer>> | null; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */ readonly bodyUsed: boolean; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */ arrayBuffer(): Promise<ArrayBuffer>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */ blob(): Promise<Blob>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) */ bytes(): Promise<Uint8Array<ArrayBuffer>>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */ formData(): Promise<FormData>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */ json(): Promise<any>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */ text(): Promise<string>; } interface BroadcastChannelEventMap { "message": MessageEvent; "messageerror": MessageEvent; } /** * The **`BroadcastChannel`** interface represents a named channel that any browsing context of a given origin can subscribe to. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel) */ interface BroadcastChannel extends EventTarget { /** * The **`name`** read-only property of the BroadcastChannel interface returns a string, which uniquely identifies the given channel with its name. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/name) */ readonly name: string; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/message_event) */ onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/messageerror_event) */ onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null; /** * The **`close()`** method of the BroadcastChannel interface terminates the connection to the underlying channel, allowing the object to be garbage collected. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/close) */ close(): void; /** * The **`postMessage()`** method of the BroadcastChannel interface sends a message, which can be of any kind of Object, to each listener in any browsing context with the same origin. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/postMessage) */ 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; }; /** * The **`ByteLengthQueuingStrategy`** interface of the Streams API provides a built-in byte length queuing strategy that can be used when constructing streams. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy) */ interface ByteLengthQueuingStrategy extends QueuingStrategy<ArrayBufferView> { /** * The read-only **`ByteLengthQueuingStrategy.highWaterMark`** property returns the total number of bytes that can be contained in the internal queue before backpressure is applied. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark) */ readonly highWaterMark: number; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ByteLengthQueuingStrategy/size) */ readonly size: QueuingStrategySize<ArrayBufferView>; } declare var ByteLengthQueuingStrategy: { prototype: ByteLengthQueuingStrategy; new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; }; /** * The **`CSSImageValue`** interface of the CSS Typed Object Model API represents values for properties that take an image, for example background-image, list-style-image, or border-image-source. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImageValue) */ interface CSSImageValue extends CSSStyleValue { } declare var CSSImageValue: { prototype: CSSImageValue; new(): CSSImageValue; }; /** * The **`CSSKeywordValue`** interface of the CSS Typed Object Model API creates an object to represent CSS keywords and other identifiers. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeywordValue) */ interface CSSKeywordValue extends CSSStyleValue { /** * The **`value`** property of the `CSSKeywordValue`. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeywordValue/value) */ value: string; } declare var CSSKeywordValue: { prototype: CSSKeywordValue; new(value: string): CSSKeywordValue; }; interface CSSMathClamp extends CSSMathValue { readonly lower: CSSNumericValue; readonly upper: CSSNumericValue; readonly value: CSSNumericValue; } declare var CSSMathClamp: { prototype: CSSMathClamp; new(lower: CSSNumberish, value: CSSNumberish, upper: CSSNumberish): CSSMathClamp; }; /** * The **`CSSMathInvert`** interface of the CSS Typed Object Model API represents a CSS calc used as `calc(1 / <value>)`. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathInvert) */ interface CSSMathInvert extends CSSMathValue { /** * The CSSMathInvert.value read-only property of the A CSSNumericValue. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathInvert/value) */ readonly value: CSSNumericValue; } declare var CSSMathInvert: { prototype: CSSMathInvert; new(arg: CSSNumberish): CSSMathInvert; }; /** * The **`CSSMathMax`** interface of the CSS Typed Object Model API represents the CSS max function. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMax) */ interface CSSMathMax extends CSSMathValue { /** * The CSSMathMax.values read-only property of the which contains one or more CSSNumericValue objects. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMax/values) */ readonly values: CSSNumericArray; } declare var CSSMathMax: { prototype: CSSMathMax; new(...args: CSSNumberish[]): CSSMathMax; }; /** * The **`CSSMathMin`** interface of the CSS Typed Object Model API represents the CSS min function. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMin) */ interface CSSMathMin extends CSSMathValue { /** * The CSSMathMin.values read-only property of the which contains one or more CSSNumericValue objects. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMin/values) */ readonly values: CSSNumericArray; } declare var CSSMathMin: { prototype: CSSMathMin; new(...args: CSSNumberish[]): CSSMathMin; }; /** * The **`CSSMathNegate`** interface of the CSS Typed Object Model API negates the value passed into it. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathNegate) */ interface CSSMathNegate extends CSSMathValue { /** * The CSSMathNegate.value read-only property of the A CSSNumericValue. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathNegate/value) */ readonly value: CSSNumericValue; } declare var CSSMathNegate: { prototype: CSSMathNegate; new(arg: CSSNumberish): CSSMathNegate; }; /** * The **`CSSMathProduct`** interface of the CSS Typed Object Model API represents the result obtained by calling CSSNumericValue.add, CSSNumericValue.sub, or CSSNumericValue.toSum on CSSNumericValue. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathProduct) */ interface CSSMathProduct extends CSSMathValue { /** * The **`CSSMathProduct.values`** read-only property of the CSSMathProduct interface returns a A CSSNumericArray. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathProduct/values) */ readonly values: CSSNumericArray; } declare var CSSMathProduct: { prototype: CSSMathProduct; new(...args: CSSNumberish[]): CSSMathProduct; }; /** * The **`CSSMathSum`** interface of the CSS Typed Object Model API represents the result obtained by calling CSSNumericValue.add, CSSNumericValue.sub, or CSSNumericValue.toSum on CSSNumericValue. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathSum) */ interface CSSMathSum extends CSSMathValue { /** * The **`CSSMathSum.values`** read-only property of the CSSMathSum interface returns a CSSNumericArray object which contains one or more CSSNumericValue objects. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathSum/values) */ readonly values: CSSNumericArray; } declare var CSSMathSum: { prototype: CSSMathSum; new(...args: CSSNumberish[]): CSSMathSum; }; /** * The **`CSSMathValue`** interface of the CSS Typed Object Model API a base class for classes representing complex numeric values. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathValue) */ interface CSSMathValue extends CSSNumericValue { /** * The **`CSSMathValue.operator`** read-only property of the CSSMathValue interface indicates the operator that the current subtype represents. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathValue/operator) */ readonly operator: CSSMathOperator; } declare var CSSMathValue: { prototype: CSSMathValue; new(): CSSMathValue; }; /** * The **`CSSMatrixComponent`** interface of the CSS Typed Object Model API represents the matrix() and matrix3d() values of the individual transform property in CSS. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMatrixComponent) */ interface CSSMatrixComponent extends CSSTransformComponent { /** * The **`matrix`** property of the See the matrix() and matrix3d() pages for examples. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMatrixComponent/matrix) */ matrix: DOMMatrix; } declare var CSSMatrixComponent: { prototype: CSSMatrixComponent; new(matrix: DOMMatrixReadOnly, options?: CSSMatrixComponentOptions): CSSMatrixComponent; }; /** * The **`CSSNumericArray`** interface of the CSS Typed Object Model API contains a list of CSSNumericValue objects. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericArray) */ interface CSSNumericArray { /** * The read-only **`length`** property of the An integer representing the number of CSSNumericValue objects in the list. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericArray/length) */ readonly length: number; forEach(callbackfn: (value: CSSNumericValue, key: number, parent: CSSNumericArray) => void, thisArg?: any): void; [index: number]: CSSNumericValue; } declare var CSSNumericArray: { prototype: CSSNumericArray; new(): CSSNumericArray; }; /** * The **`CSSNumericValue`** interface of the CSS Typed Object Model API represents operations that all numeric values can perform. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue) */ interface CSSNumericValue extends CSSStyleValue { /** * The **`add()`** method of the `CSSNumericValue`. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/add) */ add(...values: CSSNumberish[]): CSSNumericValue; /** * The **`div()`** method of the supplied value. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/div) */ div(...values: CSSNumberish[]): CSSNumericValue; /** * The **`equals()`** method of the value are strictly equal. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/equals) */ equals(...value: CSSNumberish[]): boolean; /** * The **`max()`** method of the passed. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/max) */ max(...values: CSSNumberish[]): CSSNumericValue; /** * The **`min()`** method of the values passed. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/min) */ min(...values: CSSNumberish[]): CSSNumericValue; /** * The **`mul()`** method of the the supplied value. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/mul) */ mul(...values: CSSNumberish[]): CSSNumericValue; /** * The **`sub()`** method of the `CSSNumericValue`. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/sub) */ sub(...values: CSSNumberish[]): CSSNumericValue; /** * The **`to()`** method of the another. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/to) */ to(unit: string): CSSUnitValue; /** * The **`toSum()`** method of the ```js-nolint toSum(units) ``` - `units` - : The units to convert to. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/toSum) */ toSum(...units: string[]): CSSMathSum; /** * The **`type()`** method of the `CSSNumericValue`, one of `angle`, `flex`, `frequency`, `length`, `resolution`, `percent`, `percentHint`, or `time`. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/type) */ type(): CSSNumericType; } declare var CSSNumericValue: { prototype: CSSNumericValue; new(): CSSNumericValue; }; /** * The **`CSSPerspective`** interface of the CSS Typed Object Model API represents the perspective() value of the individual transform property in CSS. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPerspective) */ interface CSSPerspective extends CSSTransformComponent { /** * The **`length`** property of the It is used to apply a perspective transform to the element and its content. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPerspective/length) */ length: CSSPerspectiveValue; } declare var CSSPerspective: { prototype: CSSPerspective; new(length: CSSPerspectiveValue): CSSPerspective; }; /** * The **`CSSRotate`** interface of the CSS Typed Object Model API represents the rotate value of the individual transform property in CSS. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate) */ interface CSSRotate extends CSSTransformComponent { /** * The **`angle`** property of the denotes a clockwise rotation, a negative angle a counter-clockwise one. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/angle) */ angle: CSSNumericValue; /** * The **`x`** property of the translating vector. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/x) */ x: CSSNumberish; /** * The **`y`** property of the translating vector. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/y) */ y: CSSNumberish; /** * The **`z`** property of the vector. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/z) */ z: CSSNumberish; } declare var CSSRotate: { prototype: CSSRotate; new(angle: CSSNumericValue): CSSRotate; new(x: CSSNumberish, y: CSSNumberish, z: CSSNumberish, angle: CSSNumericValue): CSSRotate; }; /** * The **`CSSScale`** interface of the CSS Typed Object Model API represents the scale() and scale3d() values of the individual transform property in CSS. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale) */ interface CSSScale extends CSSTransformComponent { /** * The **`x`** property of the translating vector. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale/x) */ x: CSSNumberish; /** * The **`y`** property of the translating vector. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale/y) */ y: CSSNumberish; /** * The **`z`** property of the vector. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale/z) */ z: CSSNumberish; } declare var CSSScale: { prototype: CSSScale; new(x: CSSNumberish, y: CSSNumberish, z?: CSSNumberish): CSSScale; }; /** * The **`CSSSkew`** interface of the CSS Typed Object Model API is part of the CSSTransformValue interface. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkew) */ interface CSSSkew extends CSSTransformComponent { /** * The **`ax`** property of the along the x-axis (or abscissa). * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkew/ax) */ ax: CSSNumericValue; /** * The **`ay`** property of the along the y-axis (or ordinate). * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkew/ay) */ ay: CSSNumericValue; } declare var CSSSkew: { prototype: CSSSkew; new(ax: CSSNumericValue, ay: CSSNumericValue): CSSSkew; }; /** * The **`CSSSkewX`** interface of the CSS Typed Object Model API represents the `skewX()` value of the individual transform property in CSS. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewX) */ interface CSSSkewX extends CSSTransformComponent { /** * The **`ax`** property of the along the x-axis (or abscissa). * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewX/ax) */ ax: CSSNumericValue; } declare var CSSSkewX: { prototype: CSSSkewX; new(ax: CSSNumericValue): CSSSkewX; }; /** * The **`CSSSkewY`** interface of the CSS Typed Object Model API represents the `skewY()` value of the individual transform property in CSS. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewY) */ interface CSSSkewY extends CSSTransformComponent { /** * The **`ay`** property of the along the y-axis (or ordinate). * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewY/ay) */ ay: CSSNumericValue; } declare var CSSSkewY: { prototype: CSSSkewY; new(ay: CSSNumericValue): CSSSkewY; }; /** * The **`CSSStyleValue`** interface of the CSS Typed Object Model API is the base class of all CSS values accessible through the Typed OM API. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleValue) */ interface CSSStyleValue { toString(): string; } declare var CSSStyleValue: { prototype: CSSStyleValue; new(): CSSStyleValue; }; /** * The **`CSSTransformComponent`** interface of the CSS Typed Object Model API is part of the CSSTransformValue interface. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformComponent) */ interface CSSTransformComponent { /** * The **`is2D`** read-only property of the CSSTransformComponent interface indicates where the transform is 2D or 3D. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformComponent/is2D) */ is2D: boolean; /** * The **`toMatrix()`** method of the object. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformComponent/toMatrix) */ toMatrix(): DOMMatrix; toString(): string; } declare var CSSTransformComponent: { prototype: CSSTransformComponent; new(): CSSTransformComponent; }; /** * The **`CSSTransformValue`** interface of the CSS Typed Object Model API represents `transform-list` values as used by the CSS transform property. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue) */ interface CSSTransformValue extends CSSStyleValue { /** * The read-only **`is2D`** property of the In the case of the `CSSTransformValue` this property returns true unless any of the individual functions return false for `Is2D`, in which case it returns false. * * [MDN Reference](https://