@typescript/native-preview-linux-x64
Version:
Preview CLI of the native TypeScript compiler port
1,530 lines (1,340 loc) • 610 kB
TypeScript
/*! *****************************************************************************
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 AudioDataCopyToOptions {
format?: AudioSampleFormat;
frameCount?: number;
frameOffset?: number;
planeIndex: number;
}
interface AudioDataInit {
data: BufferSource;
format: AudioSampleFormat;
numberOfChannels: number;
numberOfFrames: number;
sampleRate: number;
timestamp: number;
transfer?: ArrayBuffer[];
}
interface AudioDecoderConfig {
codec: string;
description?: AllowSharedBufferSource;
numberOfChannels: number;
sampleRate: number;
}
interface AudioDecoderInit {
error: WebCodecsErrorCallback;
output: AudioDataOutputCallback;
}
interface AudioDecoderSupport {
config?: AudioDecoderConfig;
supported?: boolean;
}
interface AudioEncoderConfig {
bitrate?: number;
bitrateMode?: BitrateMode;
codec: string;
numberOfChannels: number;
opus?: OpusEncoderConfig;
sampleRate: number;
}
interface AudioEncoderInit {
error: WebCodecsErrorCallback;
output: EncodedAudioChunkOutputCallback;
}
interface AudioEncoderSupport {
config?: AudioEncoderConfig;
supported?: 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 CookieInit {
domain?: string | null;
expires?: DOMHighResTimeStamp | null;
name: string;
partitioned?: boolean;
path?: string;
sameSite?: CookieSameSite;
value: string;
}
interface CookieListItem {
name?: string;
value?: string;
}
interface CookieStoreDeleteOptions {
domain?: string | null;
name: string;
partitioned?: boolean;
path?: string;
}
interface CookieStoreGetOptions {
name?: string;
url?: string;
}
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 EncodedAudioChunkInit {
data: AllowSharedBufferSource;
duration?: number;
timestamp: number;
transfer?: ArrayBuffer[];
type: EncodedAudioChunkType;
}
interface EncodedAudioChunkMetadata {
decoderConfig?: AudioDecoderConfig;
}
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 ExtendableCookieChangeEventInit extends ExtendableEventInit {
changed?: CookieList;
deleted?: CookieList;
}
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<void>;
preloadResponse?: Promise<any>;
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 ImageDecodeOptions {
completeFramesOnly?: boolean;
frameIndex?: number;
}
interface ImageDecodeResult {
complete: boolean;
image: VideoFrame;
}
interface ImageDecoderInit {
colorSpaceConversion?: ColorSpaceConversion;
data: ImageBufferSource;
desiredHeight?: number;
desiredWidth?: number;
preferAnimation?: boolean;
transfer?: ArrayBuffer[];
type: string;
}
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 MediaStreamTrackProcessorInit {
maxBufferSize?: number;
}
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 OpusEncoderConfig {
complexity?: number;
format?: OpusBitstreamFormat;
frameDuration?: number;
packetlossperc?: number;
usedtx?: boolean;
useinbandfec?: boolean;
}
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 PushSubscriptionChangeEventInit extends ExtendableEventInit {
newSubscription?: PushSubscription;
oldSubscription?: PushSubscription;
}
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 extends RTCEncodedFrameMetadata {
sequenceNumber?: number;
}
interface RTCEncodedFrameMetadata {
contributingSources?: number[];
mimeType?: string;
payloadType?: number;
rtpTimestamp?: number;
synchronizationSource?: number;
}
interface RTCEncodedVideoFrameMetadata extends RTCEncodedFrameMetadata {
dependencies?: number[];
frameId?: number;
height?: number;
spatialIndex?: 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 | 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 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;
hasAlphaChannel?: boolean;
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;
contentHint?: string;
displayHeight?: number;
displayWidth?: number;
framerate?: number;
hardwareAcceleration?: HardwareAcceleration;
height: number;
latencyMode?: LatencyMode;
scalabilityMode?: string;
width: number;
}
interface VideoEncoderEncodeOptions {
avc?: VideoEncoderEncodeOptionsForAvc;
keyFrame?: boolean;
}
interface VideoEncoderEncodeOptionsForAvc {
quantizer?: number | null;
}
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 {
colorSpace?: PredefinedColorSpace;
format?: VideoPixelFormat;
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 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;
/**
* 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;
}
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;
}
/**
* The **`AudioData`** interface of the WebCodecs API represents an audio sample.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioData)
*/
interface AudioData {
/**
* The **`duration`** read-only property of the AudioData interface returns the duration in microseconds of this `AudioData` object.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioData/duration)
*/
readonly duration: number;
/**
* The **`format`** read-only property of the AudioData interface returns the sample format of the `AudioData` object.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioData/format)
*/
readonly format: AudioSampleFormat | null;
/**
* The **`numberOfChannels`** read-only property of the AudioData interface returns the number of channels in the `AudioData` object.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioData/numberOfChannels)
*/
readonly numberOfChannels: number;
/**
* The **`numberOfFrames`** read-only property of the AudioData interface returns the number of frames in the `AudioData` object.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioData/numberOfFrames)
*/
readonly numberOfFrames: number;
/**
* The **`sampleRate`** read-only property of the AudioData interface returns the sample rate in Hz.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioData/sampleRate)
*/
readonly sampleRate: number;
/**
* The **`timestamp`** read-only property of the AudioData interface returns the timestamp of this `AudioData` object.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioData/timestamp)
*/
readonly timestamp: number;
/**
* The **`allocationSize()`** method of the AudioData interface returns the size in bytes required to hold the current sample as filtered by options passed into the method.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioData/allocationSize)
*/
allocationSize(options: AudioDataCopyToOptions): number;
/**
* The **`clone()`** method of the AudioData interface creates a new `AudioData` object with reference to the same media resource as the original.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioData/clone)
*/
clone(): AudioData;
/**
* The **`close()`** method of the AudioData interface clears all states and releases the reference to the media resource.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioData/close)
*/
close(): void;
/**
* The **`copyTo()`** method of the AudioData interface copies a plane of an `AudioData` object to a destination buffer.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioData/copyTo)
*/
copyTo(destination: AllowSharedBufferSource, options: AudioDataCopyToOptions): void;
}
declare var AudioData: {
prototype: AudioData;
new(init: AudioDataInit): AudioData;
};
interface AudioDecoderEventMap {
"dequeue": Event;
}
/**
* The **`AudioDecoder`** interface of the WebCodecs API decodes chunks of audio.
* Available only in secure contexts.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDecoder)
*/
interface AudioDecoder extends EventTarget {
/**
* The **`decodeQueueSize`** read-only property of the AudioDecoder interface returns the number of pending decode requests in the queue.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDecoder/decodeQueueSize)
*/
readonly decodeQueueSize: number;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDecoder/dequeue_event) */
ondequeue: ((this: AudioDecoder, ev: Event) => any) | null;
/**
* The **`state`** read-only property of the AudioDecoder interface returns the current state of the underlying codec.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDecoder/state)
*/
readonly state: CodecState;
/**
* The **`close()`** method of the AudioDecoder interface ends all pending work and releases system resources.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDecoder/close)
*/
close(): void;
/**
* The **`configure()`** method of the AudioDecoder interface enqueues a control message to configure the audio decoder for decoding chunks.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDecoder/configure)
*/
configure(config: AudioDecoderConfig): void;
/**
* The **`decode()`** method of the AudioDecoder interface enqueues a control message to decode a given chunk of audio.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDecoder/decode)
*/
decode(chunk: EncodedAudioChunk): void;
/**
* The **`flush()`** method of the AudioDecoder interface returns a Promise that resolves once all pending messages in the queue have been completed.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDecoder/flush)
*/
flush(): Promise<void>;
/**
* The **`reset()`** method of the AudioDecoder interface resets all states including configuration, control messages in the control message queue, and all pending callbacks.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDecoder/reset)
*/
reset(): void;
addEventListener<K extends keyof AudioDecoderEventMap>(type: K, listener: (this: AudioDecoder, ev: AudioDecoderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof AudioDecoderEventMap>(type: K, listener: (this: AudioDecoder, ev: AudioDecoderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var AudioDecoder: {
prototype: AudioDecoder;
new(init: AudioDecoderInit): AudioDecoder;
/**
* The **`isConfigSupported()`** static method of the AudioDecoder interface checks if the given config is supported (that is, if AudioDecoder objects can be successfully configured with the given config).
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioDecoder/isConfigSupported_static)
*/
isConfigSupported(config: AudioDecoderConfig): Promise<AudioDecoderSupport>;
};
interface AudioEncoderEventMap {
"dequeue": Event;
}
/**
* The **`AudioEncoder`** interface of the WebCodecs API encodes AudioData objects.
* Available only in secure contexts.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioEncoder)
*/
interface AudioEncoder extends EventTarget {
/**
* The **`encodeQueueSize`** read-only property of the AudioEncoder interface returns the number of pending encode requests in the queue.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioEncoder/encodeQueueSize)
*/
readonly encodeQueueSize: number;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioEncoder/dequeue_event) */
ondequeue: ((this: AudioEncoder, ev: Event) => any) | null;
/**
* The **`state`** read-only property of the AudioEncoder interface returns the current state of the underlying codec.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioEncoder/state)
*/
readonly state: CodecState;
/**
* The **`close()`** method of the AudioEncoder interface ends all pending work and releases system resources.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioEncoder/close)
*/
close(): void;
/**
* The **`configure()`** method of the AudioEncoder interface enqueues a control message to configure the audio encoder for encoding chunks.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioEncoder/configure)
*/
configure(config: AudioEncoderConfig): void;
/**
* The **`encode()`** method of the AudioEncoder interface enqueues a control message to encode a given AudioData object.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioEncoder/encode)
*/
encode(data: AudioData): void;
/**
* The **`flush()`** method of the AudioEncoder interface returns a Promise that resolves once all pending messages in the queue have been completed.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioEncoder/flush)
*/
flush(): Promise<void>;
/**
* The **`reset()`** method of the AudioEncoder interface resets all states including configuration, control messages in the control message queue, and all pending callbacks.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioEncoder/reset)
*/
reset(): void;
addEventListener<K extends keyof AudioEncoderEventMap>(type: K, listener: (this: AudioEncoder, ev: AudioEncoderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof AudioEncoderEventMap>(type: K, listener: (this: AudioEncoder, ev: AudioEncoderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var AudioEncoder: {
prototype: AudioEncoder;
new(init: AudioEncoderInit): AudioEncoder;
/**
* The **`isConfigSupported()`** static method of the AudioEncoder interface checks if the given config is supported (that is, if AudioEncoder objects can be successfully configured with the given config).
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/AudioEncoder/isConfigSupported_static)
*/
isConfigSupported(config: AudioEncoderConfig): Promise<AudioEncoderSupport>;
};
/**
* 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;
}
decl