UNPKG

@stencil/core

Version:

A Compiler for Web Components and Progressive Web Apps

1,518 lines (1,300 loc) • 448 kB
/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /// <reference no-default-lib="true"/> ///////////////////////////// /// Worker 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 AvcEncoderConfig { format?: AvcBitstreamFormat; } 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 ClientQueryOptions { includeUncontrolled?: boolean; type?: ClientTypes; } 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 EncodedVideoChunkInit { data: AllowSharedBufferSource; duration?: number; timestamp: number; type: EncodedVideoChunkType; } interface EncodedVideoChunkMetadata { decoderConfig?: VideoDecoderConfig; } 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 ExtendableEventInit extends EventInit { } interface ExtendableMessageEventInit extends ExtendableEventInit { data?: any; lastEventId?: string; origin?: string; ports?: MessagePort[]; source?: Client | ServiceWorker | MessagePort | null; } interface FetchEventInit extends ExtendableEventInit { clientId?: string; handled?: Promise<undefined>; preloadResponse?: Promise<any>; replacesClientId?: string; request: Request; resultingClientId?: string; } interface FilePropertyBag extends BlobPropertyBag { lastModified?: number; } interface FileSystemCreateWritableOptions { keepExistingData?: boolean; } interface FileSystemGetDirectoryOptions { create?: boolean; } interface FileSystemGetFileOptions { create?: boolean; } interface FileSystemReadWriteOptions { at?: number; } 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 ImportMeta { url: 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 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 { configuration?: MediaDecodingConfiguration; } interface MediaCapabilitiesEncodingInfo extends MediaCapabilitiesInfo { configuration?: MediaEncodingConfiguration; } interface MediaCapabilitiesInfo { powerEfficient: boolean; smooth: boolean; supported: boolean; } interface MediaConfiguration { audio?: AudioConfiguration; video?: VideoConfiguration; } interface MediaDecodingConfiguration extends MediaConfiguration { 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 NotificationEventInit extends ExtendableEventInit { action?: string; notification: Notification; } 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 PlaneLayout { offset: number; stride: number; } interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; total?: number; } interface PromiseRejectionEventInit extends EventInit { promise: Promise<any>; reason?: any; } interface PushEventInit extends ExtendableEventInit { data?: PushMessageDataInit; } 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 RTCEncodedAudioFrameMetadata { contributingSources?: number[]; payloadType?: number; sequenceNumber?: number; synchronizationSource?: number; } interface RTCEncodedVideoFrameMetadata { contributingSources?: number[]; dependencies?: number[]; frameId?: number; height?: number; payloadType?: number; spatialIndex?: number; synchronizationSource?: number; temporalIndex?: number; timestamp?: number; width?: 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; } 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 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 VideoColorSpaceInit { fullRange?: boolean | null; matrix?: VideoMatrixCoefficients | null; primaries?: VideoColorPrimaries | null; transfer?: VideoTransferCharacteristics | null; } interface VideoConfiguration { bitrate: number; colorGamut?: ColorGamut; contentType: string; framerate: number; hdrMetadataType?: HdrMetadataType; height: number; scalabilityMode?: string; transferFunction?: TransferFunction; width: number; } interface VideoDecoderConfig { codec: string; codedHeight?: number; codedWidth?: number; colorSpace?: VideoColorSpaceInit; description?: AllowSharedBufferSource; displayAspectHeight?: number; displayAspectWidth?: number; hardwareAcceleration?: HardwareAcceleration; optimizeForLatency?: boolean; } interface VideoDecoderInit { error: WebCodecsErrorCallback; output: VideoFrameOutputCallback; } interface VideoDecoderSupport { config?: VideoDecoderConfig; supported?: boolean; } interface VideoEncoderConfig { alpha?: AlphaOption; avc?: AvcEncoderConfig; bitrate?: number; bitrateMode?: VideoEncoderBitrateMode; codec: string; displayHeight?: number; displayWidth?: number; framerate?: number; hardwareAcceleration?: HardwareAcceleration; height: number; latencyMode?: LatencyMode; scalabilityMode?: string; width: number; } interface VideoEncoderEncodeOptions { keyFrame?: boolean; } interface VideoEncoderInit { error: WebCodecsErrorCallback; output: EncodedVideoChunkOutputCallback; } interface VideoEncoderSupport { config?: VideoEncoderConfig; supported?: boolean; } interface VideoFrameBufferInit { codedHeight: number; codedWidth: number; colorSpace?: VideoColorSpaceInit; displayHeight?: number; displayWidth?: number; duration?: number; format: VideoPixelFormat; layout?: PlaneLayout[]; timestamp: number; visibleRect?: DOMRectInit; } interface VideoFrameCopyToOptions { layout?: PlaneLayout[]; rect?: DOMRectInit; } interface VideoFrameInit { alpha?: AlphaOption; displayHeight?: number; displayWidth?: number; duration?: number; timestamp?: number; visibleRect?: DOMRectInit; } 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 WebTransportSendStreamOptions { sendOrder?: number; } 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 { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ANGLE_instanced_arrays/drawArraysInstancedANGLE) */ drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void; /** [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; /** [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; } /** * A controller object that allows you to abort one or more DOM requests as and when desired. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController) */ interface AbortController { /** * Returns the AbortSignal object associated with this object. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortController/signal) */ 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. * * [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; } /** * 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. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal) */ interface AbortSignal extends EventTarget { /** * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. * * [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; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/reason) */ readonly reason: any; /** [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; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/abort_static) */ abort(reason?: any): AbortSignal; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AbortSignal/any_static) */ any(signals: AbortSignal[]): AbortSignal; /** [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; } interface AnimationFrameProvider { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/cancelAnimationFrame) */ cancelAnimationFrame(handle: number): void; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DedicatedWorkerGlobalScope/requestAnimationFrame) */ requestAnimationFrame(callback: FrameRequestCallback): number; } /** * A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob) */ interface Blob { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */ readonly size: number; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */ readonly type: string; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/arrayBuffer) */ arrayBuffer(): Promise<ArrayBuffer>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */ slice(start?: number, end?: number, contentType?: string): Blob; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/stream) */ stream(): ReadableStream<Uint8Array>; /** [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> | 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/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; } /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel) */ interface BroadcastChannel extends EventTarget { /** * Returns the channel name (as passed to the constructor). * * [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; /** * Closes the BroadcastChannel object, opening it up to garbage collection. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/BroadcastChannel/close) */ 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. * * [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; }; /** * This Streams API interface 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> { /** [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; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSImageValue) */ interface CSSImageValue extends CSSStyleValue { } declare var CSSImageValue: { prototype: CSSImageValue; new(): CSSImageValue; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSKeywordValue) */ interface CSSKeywordValue extends CSSStyleValue { /** [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; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathInvert) */ interface CSSMathInvert extends CSSMathValue { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathInvert/value) */ readonly value: CSSNumericValue; } declare var CSSMathInvert: { prototype: CSSMathInvert; new(arg: CSSNumberish): CSSMathInvert; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMax) */ interface CSSMathMax extends CSSMathValue { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMax/values) */ readonly values: CSSNumericArray; } declare var CSSMathMax: { prototype: CSSMathMax; new(...args: CSSNumberish[]): CSSMathMax; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMin) */ interface CSSMathMin extends CSSMathValue { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathMin/values) */ readonly values: CSSNumericArray; } declare var CSSMathMin: { prototype: CSSMathMin; new(...args: CSSNumberish[]): CSSMathMin; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathNegate) */ interface CSSMathNegate extends CSSMathValue { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathNegate/value) */ readonly value: CSSNumericValue; } declare var CSSMathNegate: { prototype: CSSMathNegate; new(arg: CSSNumberish): CSSMathNegate; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathProduct) */ interface CSSMathProduct extends CSSMathValue { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathProduct/values) */ readonly values: CSSNumericArray; } declare var CSSMathProduct: { prototype: CSSMathProduct; new(...args: CSSNumberish[]): CSSMathProduct; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathSum) */ interface CSSMathSum extends CSSMathValue { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathSum/values) */ readonly values: CSSNumericArray; } declare var CSSMathSum: { prototype: CSSMathSum; new(...args: CSSNumberish[]): CSSMathSum; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathValue) */ interface CSSMathValue extends CSSNumericValue { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMathValue/operator) */ readonly operator: CSSMathOperator; } declare var CSSMathValue: { prototype: CSSMathValue; new(): CSSMathValue; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMatrixComponent) */ interface CSSMatrixComponent extends CSSTransformComponent { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSMatrixComponent/matrix) */ matrix: DOMMatrix; } declare var CSSMatrixComponent: { prototype: CSSMatrixComponent; new(matrix: DOMMatrixReadOnly, options?: CSSMatrixComponentOptions): CSSMatrixComponent; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericArray) */ interface CSSNumericArray { /** [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; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue) */ interface CSSNumericValue extends CSSStyleValue { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/add) */ add(...values: CSSNumberish[]): CSSNumericValue; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/div) */ div(...values: CSSNumberish[]): CSSNumericValue; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/equals) */ equals(...value: CSSNumberish[]): boolean; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/max) */ max(...values: CSSNumberish[]): CSSNumericValue; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/min) */ min(...values: CSSNumberish[]): CSSNumericValue; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/mul) */ mul(...values: CSSNumberish[]): CSSNumericValue; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/sub) */ sub(...values: CSSNumberish[]): CSSNumericValue; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/to) */ to(unit: string): CSSUnitValue; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/toSum) */ toSum(...units: string[]): CSSMathSum; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSNumericValue/type) */ type(): CSSNumericType; } declare var CSSNumericValue: { prototype: CSSNumericValue; new(): CSSNumericValue; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPerspective) */ interface CSSPerspective extends CSSTransformComponent { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSPerspective/length) */ length: CSSPerspectiveValue; } declare var CSSPerspective: { prototype: CSSPerspective; new(length: CSSPerspectiveValue): CSSPerspective; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate) */ interface CSSRotate extends CSSTransformComponent { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/angle) */ angle: CSSNumericValue; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/x) */ x: CSSNumberish; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSRotate/y) */ y: CSSNumberish; /** [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; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale) */ interface CSSScale extends CSSTransformComponent { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale/x) */ x: CSSNumberish; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSScale/y) */ y: CSSNumberish; /** [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; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkew) */ interface CSSSkew extends CSSTransformComponent { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkew/ax) */ ax: CSSNumericValue; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkew/ay) */ ay: CSSNumericValue; } declare var CSSSkew: { prototype: CSSSkew; new(ax: CSSNumericValue, ay: CSSNumericValue): CSSSkew; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewX) */ interface CSSSkewX extends CSSTransformComponent { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewX/ax) */ ax: CSSNumericValue; } declare var CSSSkewX: { prototype: CSSSkewX; new(ax: CSSNumericValue): CSSSkewX; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewY) */ interface CSSSkewY extends CSSTransformComponent { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSSkewY/ay) */ ay: CSSNumericValue; } declare var CSSSkewY: { prototype: CSSSkewY; new(ay: CSSNumericValue): CSSSkewY; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSStyleValue) */ interface CSSStyleValue { toString(): string; } declare var CSSStyleValue: { prototype: CSSStyleValue; new(): CSSStyleValue; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformComponent) */ interface CSSTransformComponent { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformComponent/is2D) */ is2D: boolean; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformComponent/toMatrix) */ toMatrix(): DOMMatrix; toString(): string; } declare var CSSTransformComponent: { prototype: CSSTransformComponent; new(): CSSTransformComponent; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue) */ interface CSSTransformValue extends CSSStyleValue { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue/is2D) */ readonly is2D: boolean; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue/length) */ readonly length: number; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTransformValue/toMatrix) */ toMatrix(): DOMMatrix; forEach(callbackfn: (value: CSSTransformComponent, key: number, parent: CSSTransformValue) => void, thisArg?: any): void; [index: number]: CSSTransformComponent; } declare var CSSTransformValue: { prototype: CSSTransformValue; new(transforms: CSSTransformComponent[]): CSSTransformValue; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTranslate) */ interface CSSTranslate extends CSSTransformComponent { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTranslate/x) */ x: CSSNumericValue; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTranslate/y) */ y: CSSNumericValue; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSTranslate/z) */ z: CSSNumericValue; } declare var CSSTranslate: { prototype: CSSTranslate; new(x: CSSNumericValue, y: CSSNumericValue, z?: CSSNumericValue): CSSTranslate; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnitValue) */ interface CSSUnitValue extends CSSNumericValue { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnitValue/unit) */ readonly unit: string; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnitValue/value) */ value: number; } declare var CSSUnitValue: { prototype: CSSUnitValue; new(value: number, unit: string): CSSUnitValue; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnparsedValue) */ interface CSSUnparsedValue extends CSSStyleValue { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSUnparsedValue/length) */ readonly length: number; forEach(callbackfn: (value: CSSUnparsedSegment, key: number, parent: CSSUnparsedValue) => void, thisArg?: any): void; [index: number]: CSSUnparsedSegment; } declare var CSSUnparsedValue: { prototype: CSSUnparsedValue; new(members: CSSUnparsedSegment[]): CSSUnparsedValue; }; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSVariableReferenceValue) */ interface CSSVariableReferenceValue { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSVariableReferenceValue/fallback) */ readonly fallback: CSSUnparsedValue | null; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CSSVariableReferenceValue/variable) */ variable: string; } declare var CSSVariableReferenceValue: { prototype: CSSVariableReferenceValue; new(variable: string, fallback?: CSSUnparsedValue | null): CSSVariableReferenceValue; }; /** * 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. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache) */ interface Cache { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/add) */ add(request: RequestInfo | URL): Promise<void>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/addAll) */ addAll(requests: RequestInfo[]): Promise<void>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/delete) */ delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<boolean>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/keys) */ keys(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/match) */ match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<Response | undefined>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/matchAll) */ matchAll(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Cache/put) */ put(request: RequestInfo | URL, response: Response): Promise<void>; } declare var Cache: { prototype: Cache; new(): Cache; }; /** * The storage for Cache objects. * Available only in secure contexts. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage) */ interface CacheStorage { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/delete) */ delete(cacheName: string): Promise<boolean>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/has) */ has(cacheName: string): Promise<boolean>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/keys) */ keys(): Promise<string[]>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/match) */ match(request: RequestInfo | URL, options?: MultiCacheQueryOptions): Promise<Response | undefined>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CacheStorage/open) */ open(cacheName: string): Promise<Cache>; } declare var CacheStorage: { prototype: CacheStorage; new(): CacheStorage; }; interface CanvasCompositing { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/globalAlpha) */ globalAlpha: number; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation) */ globalCompositeOperation: GlobalCompositeOperation; } interface CanvasDrawImage { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/drawImage) */ drawImage(image: CanvasImageSource, dx: number, dy: number): void; drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void; drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void; } interface CanvasDrawPath { /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/beginPath) */ beginPath(): void; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/clip) */ clip(fillRule?: CanvasFillRule): void; clip(path: Path2D, fillRule?: CanvasFillRule): void; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/fill) */ fi