/*! ***************************************************************************** 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. ***************************************************************************** */ ///////////////////////////// /// Crypto ///////////////////////////// interface Algorithm { name: string; } interface AesCbcParams extends Algorithm { iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; } interface AesCtrParams extends Algorithm { counter: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; length: number; } interface AesDerivedKeyParams extends Algorithm { length: number; } interface AesKeyGenParams extends Algorithm { length: number; } interface AesGcmParams extends Algorithm { additionalData?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; tagLength?: number; } interface KeyAlgorithm { name: string; } interface AesKeyAlgorithm extends KeyAlgorithm { length: number; } type NamedCurve = string; interface EcKeyAlgorithm extends KeyAlgorithm { namedCurve: NamedCurve; } interface EcKeyGenParams extends Algorithm { namedCurve: NamedCurve; } interface EcKeyImportParams extends Algorithm { namedCurve: NamedCurve; } /** The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. */ type KeyType = "public" | "private" | "secret"; type KeyUsage = "encrypt" | "decrypt" | "sign" | "verify" | "deriveKey" | "deriveBits" | "wrapKey" | "unwrapKey"; type AlgorithmIdentifier = string | Algorithm; type HashAlgorithmIdentifier = AlgorithmIdentifier; interface CryptoKey { readonly algorithm: KeyAlgorithm; readonly extractable: boolean; readonly type: KeyType; readonly usages: KeyUsage[]; } declare var CryptoKey: { prototype: CryptoKey; new(): CryptoKey; }; interface EcdhKeyDeriveParams extends Algorithm { public: CryptoKey; } interface EcdsaParams extends Algorithm { hash: AlgorithmIdentifier; } ///////////////////////////// /// WebAudio APIs ///////////////////////////// type ChannelCountMode = "max" | "clamped-max" | "explicit"; type ChannelInterpretation = "speakers" | "discrete"; interface AudioNodeOptions { channelCount?: number; channelCountMode?: ChannelCountMode; channelInterpretation?: ChannelInterpretation; } interface AnalyserOptions extends AudioNodeOptions { fftSize?: number; maxDecibels?: number; minDecibels?: number; smoothingTimeConstant?: number; } interface EventInit { bubbles?: boolean; cancelable?: boolean; composed?: boolean; } interface UIEventInit extends EventInit { detail?: number; // view?: Window | null; } interface AnimationEventInit extends EventInit { animationName?: string; elapsedTime?: number; pseudoElement?: string; } interface AnimationPlaybackEventInit extends EventInit { currentTime?: number | null; timelineTime?: number | null; } interface WebAuthnExtensions {} type Transport = "usb" | "nfc" | "ble"; type ScopedCredentialType = "ScopedCred"; interface ScopedCredentialDescriptor { id: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null; transports?: Transport[]; type: ScopedCredentialType; } interface AssertionOptions { allowList?: ScopedCredentialDescriptor[]; extensions?: WebAuthnExtensions; rpId?: string; timeoutSeconds?: number; } interface AssignedNodesOptions { flatten?: boolean; } interface AudioBufferOptions { length: number; numberOfChannels?: number; sampleRate: number; } /** A short audio asset residing in memory, created from an audio file using the AudioContext.decodeAudioData() method, or from raw data using AudioContext.createBuffer(). Once put into an AudioBuffer, the audio can then be played by being passed into an AudioBufferSourceNode. */ interface AudioBuffer { readonly duration: number; readonly length: number; readonly numberOfChannels: number; readonly sampleRate: number; copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void; copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void; getChannelData(channel: number): Float32Array; } declare var AudioBuffer: { prototype: AudioBuffer; new(options: AudioBufferOptions): AudioBuffer; }; interface AudioBufferSourceOptions { buffer?: AudioBuffer | null; detune?: number; loop?: boolean; loopEnd?: number; loopStart?: number; playbackRate?: number; } interface AudioContextInfo { currentTime?: number; sampleRate?: number; } type AudioContextLatencyCategory = "balanced" | "interactive" | "playback"; interface AudioContextOptions { latencyHint?: AudioContextLatencyCategory | number; sampleRate?: number; } type AutomationRate = "a-rate" | "k-rate"; interface AudioParamDescriptor { automationRate?: AutomationRate; defaultValue?: number; maxValue?: number; minValue?: number; name: string; } interface AudioProcessingEventInit extends EventInit { inputBuffer: AudioBuffer; outputBuffer: AudioBuffer; playbackTime: number; } interface AudioTimestamp { contextTime?: number; performanceTime?: number; } interface AudioWorkletNodeOptions extends AudioNodeOptions { numberOfInputs?: number; numberOfOutputs?: number; outputChannelCount?: number[]; parameterData?: $Collection; processorOptions?: any; } type BufferSource = ArrayBufferView | ArrayBuffer; type AAGUID = BufferSource; type AuthenticatorSelectionList = AAGUID[]; interface txAuthGenericArg { content: ArrayBuffer; contentType: string; } interface AuthenticationExtensionsClientInputs { appid?: string; authnSel?: AuthenticatorSelectionList; exts?: boolean; loc?: boolean; txAuthGeneric?: txAuthGenericArg; txAuthSimple?: string; uvi?: boolean; uvm?: boolean; } type AuthenticationExtensionsSupported = string[]; /** The position and altitude of the device on Earth, as well as the accuracy with which these properties are calculated. */ interface Coordinates { readonly accuracy: number; readonly altitude: number | null; readonly altitudeAccuracy: number | null; readonly heading: number | null; readonly latitude: number; readonly longitude: number; readonly speed: number | null; } type UvmEntry = number[]; type UvmEntries = UvmEntry[]; interface AuthenticationExtensionsClientOutputs { appid?: boolean; authnSel?: boolean; exts?: AuthenticationExtensionsSupported; loc?: Coordinates; txAuthGeneric?: ArrayBuffer; txAuthSimple?: string; uvi?: ArrayBuffer; uvm?: UvmEntries; } type AuthenticatorAttachment = "platform" | "cross-platform"; type UserVerificationRequirement = "required" | "preferred" | "discouraged"; interface AuthenticatorSelectionCriteria { authenticatorAttachment?: AuthenticatorAttachment; requireResidentKey?: boolean; userVerification?: UserVerificationRequirement; } type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; interface BiquadFilterOptions extends AudioNodeOptions { Q?: number; detune?: number; frequency?: number; gain?: number; type?: BiquadFilterType; } type EndingType = "transparent" | "native"; interface BlobPropertyBag { endings?: EndingType; type?: string; } interface ByteLengthChunk { byteLength?: number; } interface CacheQueryOptions { ignoreMethod?: boolean; ignoreSearch?: boolean; ignoreVary?: boolean; } interface CanvasRenderingContext2DSettings { alpha?: boolean; desynchronized?: boolean; } interface ChannelMergerOptions extends AudioNodeOptions { numberOfInputs?: number; } interface ChannelSplitterOptions extends AudioNodeOptions { numberOfOutputs?: number; } interface ClientData { challenge: string; extensions?: WebAuthnExtensions; hashAlg: string | Algorithm; origin: string; rpId: string; tokenBinding?: string; } type ClientTypes = "window" | "worker" | "sharedworker" | "all"; interface ClientQueryOptions { includeUncontrolled?: boolean; type?: ClientTypes; } /** 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. */ interface Blob { readonly size: number; readonly type: string; slice(start?: number, end?: number, contentType?: string): Blob; } type BlobPart = BufferSource | Blob | string; declare var Blob: { prototype: Blob; new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob; }; /** Provides information about files and allows JavaScript in a web page to access their content. */ interface File extends Blob { readonly lastModified: number; readonly name: string; } interface FilePropertyBag extends BlobPropertyBag { lastModified?: number; } declare var File: { prototype: File; new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File; }; /** An object of this type is returned by the files property of the HTML element; this lets you access the list of files selected with the element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage. */ interface FileList { readonly length: number; item(index: number): File | null; [index: number]: File; } declare var FileList: { prototype: FileList; new(): FileList; }; /** One drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object. */ interface DataTransferItem { /** * Returns the drag data item kind, one of: "string", "file". */ readonly kind: string; /** * Returns the drag data item type string. */ readonly type: string; /** * Returns a File object, if the drag data item kind is File. */ getAsFile(): File | null; /** * Invokes the callback with the string data as the argument, if the drag data item kind is Plain Unicode string. */ getAsString(callback: ((data: string) => void) | null): void; webkitGetAsEntry(): any; } declare var DataTransferItem: { prototype: DataTransferItem; new(): DataTransferItem; }; /** A list of DataTransferItem objects representing items being dragged. During a drag operation, each DragEvent has a dataTransfer property and that property is a DataTransferItemList. */ interface DataTransferItemList { /** * Returns the number of items in the drag data store. */ readonly length: number; /** * Adds a new entry for the given data to the drag data store. If the data is plain text then a type string has to be provided also. */ add(data: string, type: string): DataTransferItem | null; add(data: File): DataTransferItem | null; /** * Removes all the entries in the drag data store. */ clear(): void; item(index: number): DataTransferItem; /** * Removes the indexth entry in the drag data store. */ remove(index: number): void; [name: number]: DataTransferItem; } declare var DataTransferItemList: { prototype: DataTransferItemList; new(): DataTransferItemList; }; // /** Used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API. */ interface DataTransfer { /** * Returns the kind of operation that is currently selected. If the kind of operation isn't one of those that is allowed by the effectAllowed attribute, then the operation will fail. * * Can be set, to change the selected operation. * * The possible values are "none", "copy", "link", and "move". */ dropEffect: string; /** * Returns the kinds of operations that are to be allowed. * * Can be set (during the dragstart event), to change the allowed operations. * * The possible values are "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", and "uninitialized", */ effectAllowed: string; /** * Returns a FileList of the files being dragged, if any. */ readonly files: FileList; /** * Returns a DataTransferItemList object, with the drag data. */ readonly items: DataTransferItemList; /** * Returns a frozen array listing the formats that were set in the dragstart event. In addition, if any files are being dragged, then one of the types will be the string "Files". */ readonly types: ReadonlyArray; /** * Removes the data of the specified formats. Removes all data if the argument is omitted. */ clearData(format?: string): void; /** * Returns the specified data. If there is no such data, returns the empty string. */ getData(format: string): string; /** * Adds the specified data. */ setData(format: string, data: string): void; /** * Uses the given element to update the drag feedback, replacing any previously specified feedback. */ // setDragImage(image: Element, x: number, y: number): void; } declare var DataTransfer: { prototype: DataTransfer; new(): DataTransfer; }; interface ClipboardEventInit extends EventInit { clipboardData?: DataTransfer | null; } interface CloseEventInit extends EventInit { code?: number; reason?: string; wasClean?: boolean; } interface CompositionEventInit extends UIEventInit { data?: string; } type PlaybackDirection = "normal" | "reverse" | "alternate" | "alternate-reverse"; type FillMode = "none" | "forwards" | "backwards" | "both" | "auto"; interface EffectTiming { delay?: number; direction?: PlaybackDirection; duration?: number | string; easing?: string; endDelay?: number; fill?: FillMode; iterationStart?: number; iterations?: number; } interface ComputedEffectTiming extends EffectTiming { activeDuration?: number; currentIteration?: number | null; endTime?: number; localTime?: number | null; progress?: number | null; } type CompositeOperation = "replace" | "add" | "accumulate"; type CompositeOperationOrAuto = "replace" | "add" | "accumulate" | "auto"; type IterationCompositeOperation = "replace" | "accumulate"; interface ComputedKeyframe { composite: CompositeOperationOrAuto; computedOffset: number; easing: string; offset: number | null; [property: string]: string | number | null | undefined; } interface ExceptionInformation { domain?: string | null; } interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { arrayOfDomainStrings?: string[]; } interface ConstantSourceOptions { offset?: number; } interface ConstrainBooleanParameters { exact?: boolean; ideal?: boolean; } interface ConstrainDOMStringParameters { exact?: string | string[]; ideal?: string | string[]; } interface DoubleRange { max?: number; min?: number; } interface ConstrainDoubleRange extends DoubleRange { exact?: number; ideal?: number; } interface ULongRange { max?: number; min?: number; } interface ConstrainULongRange extends ULongRange { exact?: number; ideal?: number; } type VideoFacingModeEnum = "user" | "environment" | "left" | "right"; interface ConstrainVideoFacingModeParameters { exact?: VideoFacingModeEnum | VideoFacingModeEnum[]; ideal?: VideoFacingModeEnum | VideoFacingModeEnum[]; } interface ConvolverOptions extends AudioNodeOptions { buffer?: AudioBuffer | null; disableNormalization?: boolean; } type AttestationConveyancePreference = "none" | "indirect" | "direct"; type AuthenticatorTransport = "usb" | "nfc" | "ble" | "internal"; type PublicKeyCredentialType = "public-key"; interface PublicKeyCredentialDescriptor { id: BufferSource; transports?: AuthenticatorTransport[]; type: PublicKeyCredentialType; } type COSEAlgorithmIdentifier = number; interface PublicKeyCredentialParameters { alg: COSEAlgorithmIdentifier; type: PublicKeyCredentialType; } interface PublicKeyCredentialEntity { icon?: string; name: string; } interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity { id?: string; } interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity { displayName: string; id: BufferSource; } interface PublicKeyCredentialCreationOptions { attestation?: AttestationConveyancePreference; authenticatorSelection?: AuthenticatorSelectionCriteria; challenge: BufferSource; excludeCredentials?: PublicKeyCredentialDescriptor[]; extensions?: AuthenticationExtensionsClientInputs; pubKeyCredParams: PublicKeyCredentialParameters[]; rp: PublicKeyCredentialRpEntity; timeout?: number; user: PublicKeyCredentialUserEntity; } ///////////////////////////// /// DOM APIs ///////////////////////////// interface Account { displayName: string; id: string; imageURL?: string; name?: string; rpDisplayName: string; } interface EventListenerOptions { capture?: boolean; } interface AddEventListenerOptions extends EventListenerOptions { once?: boolean; passive?: boolean; } interface EventListenerObject { handleEvent(evt: Event): void; } type EventListenerOrEventListenerObject = ((e: Event) => void) | EventListenerObject; /** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */ interface EventTarget { /** * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched. * * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture. * * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET. * * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in §2.8 Observing event listeners. * * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. * * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. */ addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void; /** * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ dispatchEvent(event: Event): boolean; /** * Removes the event listener in target's event listener list with the same type, callback, and options. */ removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; } declare var EventTarget: { prototype: EventTarget; new(): EventTarget; }; /** An event which takes place in the DOM. */ interface Event { /** * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. */ readonly bubbles: boolean; cancelBubble: boolean; /** * Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. */ readonly cancelable: boolean; /** * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. */ readonly composed: boolean; /** * Returns the object whose event listener's callback is currently being invoked. */ readonly currentTarget: EventTarget | null; /** * Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. */ readonly defaultPrevented: boolean; /** * Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. */ readonly eventPhase: number; /** * Returns true if event was dispatched by the user agent, and false otherwise. */ readonly isTrusted: boolean; returnValue: boolean; /** @deprecated */ readonly srcElement: EventTarget | null; /** * Returns the object to which event is dispatched (its target). */ readonly target: EventTarget | null; /** * Returns the event's timestamp as the number of milliseconds measured relative to the time origin. */ readonly timeStamp: number; /** * Returns the type of event, e.g. "click", "hashchange", or "submit". */ readonly type: string; /** * Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. */ composedPath(): EventTarget[]; initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void; /** * If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. */ preventDefault(): void; /** * Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. */ stopImmediatePropagation(): void; /** * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. */ stopPropagation(): void; readonly AT_TARGET: number; readonly BUBBLING_PHASE: number; readonly CAPTURING_PHASE: number; readonly NONE: number; } declare var Event: { prototype: Event; new(type: string, eventInitDict?: EventInit): Event; readonly AT_TARGET: number; readonly BUBBLING_PHASE: number; readonly CAPTURING_PHASE: number; readonly NONE: number; }; /** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ interface AbortSignal extends EventTarget { /** * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */ readonly aborted: boolean; onabort: ((this: AbortSignal, ev: Event) => any) | null; // addEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; // removeEventListener(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; }; interface CredentialCreationOptions { publicKey?: PublicKeyCredentialCreationOptions; signal?: AbortSignal; } type CredentialMediationRequirement = "silent" | "optional" | "required"; interface PublicKeyCredentialRequestOptions { allowCredentials?: PublicKeyCredentialDescriptor[]; challenge: BufferSource; extensions?: AuthenticationExtensionsClientInputs; rpId?: string; timeout?: number; userVerification?: UserVerificationRequirement; } interface CredentialRequestOptions { mediation?: CredentialMediationRequirement; publicKey?: PublicKeyCredentialRequestOptions; signal?: AbortSignal; } interface CustomEventInit 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 DelayOptions extends AudioNodeOptions { delayTime?: number; maxDelayTime?: number; } interface DeviceLightEventInit extends EventInit { value?: number; } interface DeviceMotionEventAccelerationInit { x?: number | null; y?: number | null; z?: number | null; } interface DeviceMotionEventRotationRateInit { alpha?: number | null; beta?: number | null; gamma?: number | null; } interface DeviceMotionEventInit extends EventInit { acceleration?: DeviceMotionEventAccelerationInit; accelerationIncludingGravity?: DeviceMotionEventAccelerationInit; interval?: number; rotationRate?: DeviceMotionEventRotationRateInit; } interface DeviceOrientationEventInit extends EventInit { absolute?: boolean; alpha?: number | null; beta?: number | null; gamma?: number | null; } type PermissionName = "geolocation" | "notifications" | "push" | "midi" | "camera" | "microphone" | "speaker" | "device-info" | "background-sync" | "bluetooth" | "persistent-storage" | "ambient-light-sensor" | "accelerometer" | "gyroscope" | "magnetometer" | "clipboard"; interface PermissionDescriptor { name: PermissionName; } interface DevicePermissionDescriptor extends PermissionDescriptor { deviceId?: string; name: "camera" | "microphone" | "speaker"; } interface DocumentTimelineOptions { originTime?: number; } interface EventModifierInit extends UIEventInit { altKey?: boolean; ctrlKey?: boolean; metaKey?: boolean; modifierAltGraph?: boolean; modifierCapsLock?: boolean; modifierFn?: boolean; modifierFnLock?: boolean; modifierHyper?: boolean; modifierNumLock?: boolean; modifierScrollLock?: boolean; modifierSuper?: boolean; modifierSymbol?: boolean; modifierSymbolLock?: boolean; shiftKey?: boolean; } interface MouseEventInit extends EventModifierInit { button?: number; buttons?: number; clientX?: number; clientY?: number; movementX?: number; movementY?: number; relatedTarget?: EventTarget | null; screenX?: number; screenY?: number; } interface DragEventInit extends MouseEventInit { dataTransfer?: DataTransfer | null; } interface DynamicsCompressorOptions extends AudioNodeOptions { attack?: number; knee?: number; ratio?: number; release?: number; threshold?: number; } interface ElementCreationOptions { is?: string; } interface ElementDefinitionOptions { extends?: string; } interface ErrorEventInit extends EventInit { colno?: number; error?: any; filename?: string; lineno?: number; message?: string; } interface EventSourceInit { withCredentials?: boolean; } interface FocusEventInit extends UIEventInit { relatedTarget?: EventTarget | null; } interface FocusNavigationEventInit extends EventInit { navigationReason?: string | null; originHeight?: number; originLeft?: number; originTop?: number; originWidth?: number; } interface FocusNavigationOrigin { originHeight?: number; originLeft?: number; originTop?: number; originWidth?: number; } interface FocusOptions { preventScroll?: boolean; } type FullscreenNavigationUI = "auto" | "show" | "hide"; interface FullscreenOptions { navigationUI?: FullscreenNavigationUI; } interface GainOptions extends AudioNodeOptions { gain?: number; } /** An individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device. */ interface GamepadButton { readonly pressed: boolean; readonly touched: boolean; readonly value: number; } declare var GamepadButton: { prototype: GamepadButton; new(): GamepadButton; }; type GamepadHand = "" | "left" | "right"; type GamepadHapticActuatorType = "vibration"; /** This Gamepad API interface represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware. */ interface GamepadHapticActuator { readonly type: GamepadHapticActuatorType; pulse(value: number, duration: number): Promise; } declare var GamepadHapticActuator: { prototype: GamepadHapticActuator; new(): GamepadHapticActuator; }; type GamepadMappingType = "" | "standard"; /** This Gamepad API interface represents the pose of a WebVR controller at a given timestamp (which includes orientation, position, velocity, and acceleration information.) */ interface GamepadPose { readonly angularAcceleration: Float32Array | null; readonly angularVelocity: Float32Array | null; readonly hasOrientation: boolean; readonly hasPosition: boolean; readonly linearAcceleration: Float32Array | null; readonly linearVelocity: Float32Array | null; readonly orientation: Float32Array | null; readonly position: Float32Array | null; } declare var GamepadPose: { prototype: GamepadPose; new(): GamepadPose; }; /** This Gamepad API interface defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id. */ interface Gamepad { readonly axes: ReadonlyArray; readonly buttons: ReadonlyArray; readonly connected: boolean; readonly hand: GamepadHand; readonly hapticActuators: ReadonlyArray; readonly id: string; readonly index: number; readonly mapping: GamepadMappingType; readonly pose: GamepadPose | null; readonly timestamp: number; } declare var Gamepad: { prototype: Gamepad; new(): Gamepad; }; interface GamepadEventInit extends EventInit { gamepad: Gamepad; } interface GetNotificationOptions { tag?: string; } interface GetRootNodeOptions { composed?: boolean; } interface HashChangeEventInit extends EventInit { newURL?: string; oldURL?: string; } interface HkdfParams extends Algorithm { hash: HashAlgorithmIdentifier; info: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; } interface HmacImportParams extends Algorithm { hash: HashAlgorithmIdentifier; length?: number; } interface HmacKeyAlgorithm extends KeyAlgorithm { hash: KeyAlgorithm; length: number; } interface HmacKeyGenParams extends Algorithm { hash: HashAlgorithmIdentifier; length?: number; } interface IDBIndexParameters { multiEntry?: boolean; unique?: boolean; } interface IDBObjectStoreParameters { autoIncrement?: boolean; keyPath?: string | string[] | null; } interface IDBVersionChangeEventInit extends EventInit { newVersion?: number | null; oldVersion?: number; } interface IIRFilterOptions extends AudioNodeOptions { feedback: number[]; feedforward: number[]; } interface ImageBitmapRenderingContextSettings { alpha?: boolean; } interface ImageEncodeOptions { quality?: number; type?: string; } interface InputEventInit extends UIEventInit { data?: string | null; inputType?: string; isComposing?: boolean; } interface IntersectionObserverEntryInit { boundingClientRect: DOMRectInit; intersectionRatio: number; intersectionRect: DOMRectInit; isIntersecting: boolean; rootBounds: DOMRectInit | null; // target: Element; time: number; } interface IntersectionObserverInit { // root?: Element | null; rootMargin?: string; threshold?: number | number[]; } interface RsaOtherPrimesInfo { d?: string; r?: string; t?: 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 KeyboardEventInit extends EventModifierInit { code?: string; isComposing?: boolean; key?: string; location?: number; repeat?: boolean; } interface Keyframe { composite?: CompositeOperationOrAuto; easing?: string; offset?: number | null; [property: string]: string | number | null | undefined; } interface KeyframeEffectOptions extends EffectTiming { composite?: CompositeOperation; iterationComposite?: IterationCompositeOperation; } interface KeyframeAnimationOptions extends KeyframeEffectOptions { id?: string; } // interface MediaElementAudioSourceOptions { // mediaElement: HTMLMediaElement; // } interface MediaEncryptedEventInit extends EventInit { initData?: ArrayBuffer | null; initDataType?: string; } type MediaKeyMessageType = "license-request" | "license-renewal" | "license-release" | "individualization-request"; interface MediaKeyMessageEventInit extends EventInit { message: ArrayBuffer; messageType: MediaKeyMessageType; } interface MediaKeySystemMediaCapability { contentType?: string; robustness?: string; } type MediaKeysRequirement = "required" | "optional" | "not-allowed"; interface MediaKeySystemConfiguration { audioCapabilities?: MediaKeySystemMediaCapability[]; distinctiveIdentifier?: MediaKeysRequirement; initDataTypes?: string[]; label?: string; persistentState?: MediaKeysRequirement; sessionTypes?: string[]; videoCapabilities?: MediaKeySystemMediaCapability[]; } interface MediaQueryListEventInit extends EventInit { matches?: boolean; media?: string; } type MediaStreamTrackState = "live" | "ended"; type ConstrainULong = number | ConstrainULongRange; type ConstrainDouble = number | ConstrainDoubleRange; type ConstrainBoolean = boolean | ConstrainBooleanParameters; type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; interface MediaTrackConstraintSet { aspectRatio?: ConstrainDouble; autoGainControl?: ConstrainBoolean; channelCount?: ConstrainULong; deviceId?: ConstrainDOMString; echoCancellation?: ConstrainBoolean; facingMode?: ConstrainDOMString; frameRate?: ConstrainDouble; groupId?: ConstrainDOMString; height?: ConstrainULong; latency?: ConstrainDouble; noiseSuppression?: ConstrainBoolean; resizeMode?: ConstrainDOMString; sampleRate?: ConstrainULong; sampleSize?: ConstrainULong; width?: ConstrainULong; } interface MediaTrackConstraints extends MediaTrackConstraintSet { advanced?: MediaTrackConstraintSet[]; } interface MediaTrackCapabilities { aspectRatio?: DoubleRange; autoGainControl?: boolean[]; channelCount?: ULongRange; deviceId?: string; echoCancellation?: boolean[]; facingMode?: string[]; frameRate?: DoubleRange; groupId?: string; height?: ULongRange; latency?: DoubleRange; noiseSuppression?: boolean[]; resizeMode?: string[]; sampleRate?: ULongRange; sampleSize?: ULongRange; width?: ULongRange; } interface MediaTrackSettings { aspectRatio?: number; autoGainControl?: boolean; channelCount?: number; deviceId?: string; echoCancellation?: boolean; facingMode?: string; frameRate?: number; groupId?: string; height?: number; latency?: number; noiseSuppression?: boolean; resizeMode?: string; sampleRate?: number; sampleSize?: number; width?: number; } /** A single media track within a stream; typically, these are audio or video tracks, but other track types may exist as well. */ interface MediaStreamTrack extends EventTarget { enabled: boolean; readonly id: string; readonly isolated: boolean; readonly kind: string; readonly label: string; readonly muted: boolean; onended: ((this: MediaStreamTrack, ev: Event) => any) | null; onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null; onmute: ((this: MediaStreamTrack, ev: Event) => any) | null; onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null; readonly readyState: MediaStreamTrackState; applyConstraints(constraints?: MediaTrackConstraints): Promise; clone(): MediaStreamTrack; getCapabilities(): MediaTrackCapabilities; getConstraints(): MediaTrackConstraints; getSettings(): MediaTrackSettings; stop(): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MediaStreamTrack: { prototype: MediaStreamTrack; new(): MediaStreamTrack; }; /** Events which indicate that a MediaStream has had tracks added to or removed from the stream through calls to Media Stream API methods. These events are sent to the stream when these changes occur. */ interface MediaStreamTrackEvent extends Event { readonly track: MediaStreamTrack; } /** A stream of media content. A stream consists of several tracks such as video or audio tracks. Each track is specified as an instance of MediaStreamTrack. */ interface MediaStream extends EventTarget { readonly active: boolean; readonly id: string; onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null; onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null; addTrack(track: MediaStreamTrack): void; clone(): MediaStream; getAudioTracks(): MediaStreamTrack[]; getTrackById(trackId: string): MediaStreamTrack | null; getTracks(): MediaStreamTrack[]; getVideoTracks(): MediaStreamTrack[]; removeTrack(track: MediaStreamTrack): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MediaStream: { prototype: MediaStream; new(): MediaStream; new(stream: MediaStream): MediaStream; new(tracks: MediaStreamTrack[]): MediaStream; }; interface MediaStreamAudioSourceOptions { mediaStream: MediaStream; } /** A type of AudioNode which operates as an audio source whose media is received from a MediaStream obtained using the WebRTC or Media Capture and Streams APIs. */ interface MediaStreamAudioSourceNode extends AudioNode { readonly mediaStream: MediaStream; } declare var MediaStreamAudioSourceNode: { prototype: MediaStreamAudioSourceNode; new(context: AudioContext, options: MediaStreamAudioSourceOptions): MediaStreamAudioSourceNode; }; interface MediaStreamConstraints { audio?: boolean | MediaTrackConstraints; peerIdentity?: string; video?: boolean | MediaTrackConstraints; } interface MediaStreamError { readonly constraintName: string | null; readonly message: string | null; readonly name: string; } declare var MediaStreamError: { prototype: MediaStreamError; new(): MediaStreamError; }; interface MediaStreamErrorEventInit extends EventInit { error?: MediaStreamError | null; } interface MediaStreamEventInit extends EventInit { stream?: MediaStream; } interface MediaStreamTrackAudioSourceOptions { mediaStreamTrack: MediaStreamTrack; } interface MediaStreamTrackEventInit extends EventInit { track: MediaStreamTrack; } interface MediaTrackSupportedConstraints { aspectRatio?: boolean; autoGainControl?: boolean; channelCount?: boolean; deviceId?: boolean; echoCancellation?: boolean; facingMode?: boolean; frameRate?: boolean; groupId?: boolean; height?: boolean; latency?: boolean; noiseSuppression?: boolean; resizeMode?: boolean; sampleRate?: boolean; sampleSize?: boolean; width?: boolean; } /** A message received by a target object. */ interface MessageEvent extends Event { /** * Returns the data of the message. */ readonly data: any; /** * Returns the last event ID string, for server-sent events. */ readonly lastEventId: string; /** * Returns the origin of the message, for server-sent events and cross-document messaging. */ readonly origin: string; /** * Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging. */ readonly ports: ReadonlyArray; /** * Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects. */ readonly source: MessageEventSource | null; } declare var MessageEvent: { prototype: MessageEvent; new(type: string, eventInitDict?: MessageEventInit): MessageEvent; }; interface PostMessageOptions { transfer?: any[]; } /** This Channel Messaging API interface represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other. */ interface MessagePort extends EventTarget { onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null; onmessageerror: ((this: MessagePort, ev: MessageEvent) => any) | null; /** * Disconnects the port, so that it is no longer active. */ close(): void; /** * Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side. * * Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned. */ postMessage(message: any, options?: Transferable[] | PostMessageOptions): void; /** * Begins dispatching messages received on the port. */ start(): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } interface ImageBitmap { /** * Returns the intrinsic height of the image, in CSS pixels. */ readonly height: number; /** * Returns the intrinsic width of the image, in CSS pixels. */ readonly width: number; /** * Releases imageBitmap's underlying bitmap data. */ close(): void; } declare var ImageBitmap: { prototype: ImageBitmap; new(): ImageBitmap; }; type Transferable = ArrayBuffer | MessagePort | ImageBitmap; declare var MessagePort: { prototype: MessagePort; new(): MessagePort; }; type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant"; /** Events providing information related to errors in scripts or in files. */ interface ErrorEvent extends Event { readonly colno: number; readonly error: any; readonly filename: string; readonly lineno: number; readonly message: string; } declare var ErrorEvent: { prototype: ErrorEvent; new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent; }; interface AbstractWorker { onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } type WorkerType = "classic" | "module"; type ServiceWorkerUpdateViaCache = "imports" | "all" | "none"; /** This ServiceWorker API interface provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object. */ interface ServiceWorker extends EventTarget, AbstractWorker { onstatechange: ((this: ServiceWorker, ev: Event) => any) | null; readonly scriptURL: string; readonly state: ServiceWorkerState; postMessage(message: any, options?: Transferable[] | PostMessageOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var ServiceWorker: { prototype: ServiceWorker; new(): ServiceWorker; }; //type WindowProxy = Window; type MessageEventSource = MessagePort | ServiceWorker// | WindowProxy; interface MessageEventInit extends EventInit { data?: any; lastEventId?: string; origin?: string; ports?: MessagePort[]; source?: MessageEventSource | null; } interface MidiPermissionDescriptor extends PermissionDescriptor { name: "midi"; sysex?: boolean; } interface MultiCacheQueryOptions extends CacheQueryOptions { cacheName?: string; } interface MutationObserverInit { /** * Set to a list of attribute local names (without namespace) if not all attribute mutations need to be observed and attributes is true or omitted. */ attributeFilter?: string[]; /** * Set to true if attributes is true or omitted and target's attribute value before the mutation needs to be recorded. */ attributeOldValue?: boolean; /** * Set to true if mutations to target's attributes are to be observed. Can be omitted if attributeOldValue or attributeFilter is specified. */ attributes?: boolean; /** * Set to true if mutations to target's data are to be observed. Can be omitted if characterDataOldValue is specified. */ characterData?: boolean; /** * Set to true if characterData is set to true or omitted and target's data before the mutation needs to be recorded. */ characterDataOldValue?: boolean; /** * Set to true if mutations to target's children are to be observed. */ childList?: boolean; /** * Set to true if mutations to not just target, but also target's descendants are to be observed. */ subtree?: boolean; } interface NavigationPreloadState { enabled?: boolean; headerValue?: string; } interface NotificationAction { action: string; icon?: string; title: string; } type NotificationDirection = "auto" | "ltr" | "rtl"; type VibratePattern = number | number[]; interface NotificationOptions { actions?: NotificationAction[]; badge?: string; body?: string; data?: any; dir?: NotificationDirection; icon?: string; image?: string; lang?: string; renotify?: boolean; requireInteraction?: boolean; silent?: boolean; tag?: string; timestamp?: number; vibrate?: VibratePattern; } interface OfflineAudioCompletionEventInit extends EventInit { renderedBuffer: AudioBuffer; } interface OfflineAudioContextOptions { length: number; numberOfChannels?: number; sampleRate: number; } interface OptionalEffectTiming { delay?: number; direction?: PlaybackDirection; duration?: number | string; easing?: string; endDelay?: number; fill?: FillMode; iterationStart?: number; iterations?: number; } /** PeriodicWave has no inputs or outputs; it is used to define custom oscillators when calling OscillatorNode.setPeriodicWave(). The PeriodicWave itself is created/returned by AudioContext.createPeriodicWave(). */ interface PeriodicWave {} type RequestCredentials = "omit" | "same-origin" | "include"; interface WorkletOptions { credentials?: RequestCredentials; } interface Worklet { addModule(moduleURL: string, options?: WorkletOptions): Promise; } declare var Worklet: { prototype: Worklet; new(): Worklet; }; interface AudioWorklet extends Worklet {} declare var AudioWorklet: { prototype: AudioWorklet; new(): AudioWorklet; }; /** A generic interface for representing an audio processing module. Examples include: */ interface AudioNode extends EventTarget { channelCount: number; channelCountMode: ChannelCountMode; channelInterpretation: ChannelInterpretation; //readonly context: BaseAudioContext; readonly numberOfInputs: number; readonly numberOfOutputs: number; connect(destinationNode: AudioNode, output?: number, input?: number): AudioNode; disconnect(destinationParam?: AudioNode | number | AudioParam, output?: number, input?: number): void; } declare var AudioNode: { prototype: AudioNode; new(): AudioNode; }; /** AudioDestinationNode has no output (as it is the output, no more AudioNode can be linked after it in the audio graph) and one input. The number of channels in the input must be between 0 and the maxChannelCount value or an exception is raised. */ interface AudioDestinationNode extends AudioNode { readonly maxChannelCount: number; } declare var AudioDestinationNode: { prototype: AudioDestinationNode; new(): AudioDestinationNode; }; /** The Web Audio API's AudioParam interface represents an audio-related parameter, usually a parameter of an AudioNode (such as GainNode.gain). */ interface AudioParam { automationRate: AutomationRate; readonly defaultValue: number; readonly maxValue: number; readonly minValue: number; value: number; cancelAndHoldAtTime(cancelTime: number): AudioParam; cancelScheduledValues(cancelTime: number): AudioParam; exponentialRampToValueAtTime(value: number, endTime: number): AudioParam; linearRampToValueAtTime(value: number, endTime: number): AudioParam; setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam; setValueAtTime(value: number, startTime: number): AudioParam; setValueCurveAtTime(values: number[] | Float32Array, startTime: number, duration: number): AudioParam; } declare var AudioParam: { prototype: AudioParam; new(): AudioParam; }; /** The position and orientation of the unique person listening to the audio scene, and is used in audio spatialization. All PannerNodes spatialize in relation to the AudioListener stored in the BaseAudioContext.listener attribute. */ interface AudioListener { readonly forwardX: AudioParam; readonly forwardY: AudioParam; readonly forwardZ: AudioParam; readonly positionX: AudioParam; readonly positionY: AudioParam; readonly positionZ: AudioParam; readonly upX: AudioParam; readonly upY: AudioParam; readonly upZ: AudioParam; /** @deprecated */ setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; /** @deprecated */ setPosition(x: number, y: number, z: number): void; } declare var AudioListener: { prototype: AudioListener; new(): AudioListener; }; type AudioContextState = "suspended" | "running" | "closed"; /** A node able to provide real-time frequency and time-domain analysis information. It is an AudioNode that passes the audio stream unchanged from the input to the output, but allows you to take the generated data, process it, and create audio visualizations. */ interface AnalyserNode extends AudioNode { fftSize: number; readonly frequencyBinCount: number; maxDecibels: number; minDecibels: number; smoothingTimeConstant: number; getByteFrequencyData(array: Uint8Array): void; getByteTimeDomainData(array: Uint8Array): void; getFloatFrequencyData(array: Float32Array): void; getFloatTimeDomainData(array: Float32Array): void; } /** A simple low-order filter, and is created using the AudioContext.createBiquadFilter() method. It is an AudioNode that can represent different kinds of filters, tone control devices, and graphic equalizers. */ interface BiquadFilterNode extends AudioNode { readonly Q: AudioParam; readonly detune: AudioParam; readonly frequency: AudioParam; readonly gain: AudioParam; type: BiquadFilterType; getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; } interface AudioScheduledSourceNode extends AudioNode { onended: ((this: AudioScheduledSourceNode, ev: Event) => any) | null; start(when?: number): void; stop(when?: number): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var AudioScheduledSourceNode: { prototype: AudioScheduledSourceNode; new(): AudioScheduledSourceNode; }; /** An AudioScheduledSourceNode which represents an audio source consisting of in-memory audio data, stored in an AudioBuffer. It's especially useful for playing back audio which has particularly stringent timing accuracy requirements, such as for sounds that must match a specific rhythm and can be kept in memory rather than being played from disk or the network. */ interface AudioBufferSourceNode extends AudioScheduledSourceNode { buffer: AudioBuffer | null; readonly detune: AudioParam; loop: boolean; loopEnd: number; loopStart: number; readonly playbackRate: AudioParam; start(when?: number, offset?: number, duration?: number): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } /** The ChannelMergerNode interface, often used in conjunction with its opposite, ChannelSplitterNode, reunites different mono inputs into a single output. Each input is used to fill a channel of the output. This is useful for accessing each channels separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. */ interface ChannelMergerNode extends AudioNode {} /** The ChannelSplitterNode interface, often used in conjunction with its opposite, ChannelMergerNode, separates the different channels of an audio source into a set of mono outputs. This is useful for accessing each channel separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. */ interface ChannelSplitterNode extends AudioNode { } interface ConstantSourceNode extends AudioScheduledSourceNode { readonly offset: AudioParam; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } /** An AudioNode that performs a Linear Convolution on a given AudioBuffer, often used to achieve a reverb effect. A ConvolverNode always has exactly one input and one output. */ interface ConvolverNode extends AudioNode { buffer: AudioBuffer | null; normalize: boolean; } /** A delay-line; an AudioNode audio-processing module that causes a delay between the arrival of an input data and its propagation to the output. */ interface DelayNode extends AudioNode { readonly delayTime: AudioParam; } /** Inherits properties from its parent, AudioNode. */ interface DynamicsCompressorNode extends AudioNode { readonly attack: AudioParam; readonly knee: AudioParam; readonly ratio: AudioParam; readonly reduction: number; readonly release: AudioParam; readonly threshold: AudioParam; } /** A change in volume. It is an AudioNode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. A GainNode always has exactly one input and one output, both with the same number of channels. */ interface GainNode extends AudioNode { readonly gain: AudioParam; } /** The IIRFilterNode interface of the Web Audio API is a AudioNode processor which implements a general infinite impulse response (IIR)  filter; this type of filter can be used to implement tone control devices and graphic equalizers as well. It lets the parameters of the filter response be specified, so that it can be tuned as needed. */ interface IIRFilterNode extends AudioNode { getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; } /** The OscillatorNode interface represents a periodic waveform, such as a sine wave. It is an AudioScheduledSourceNode audio-processing module that causes a specified frequency of a given wave to be created—in effect, a constant tone. */ interface OscillatorNode extends AudioScheduledSourceNode { readonly detune: AudioParam; readonly frequency: AudioParam; type: OscillatorType; setPeriodicWave(periodicWave: PeriodicWave): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } type DistanceModelType = "linear" | "inverse" | "exponential"; type PanningModelType = "equalpower" | "HRTF"; /** A PannerNode always has exactly one input and one output: the input can be mono or stereo but the output is always stereo (2 channels); you can't have panning effects without at least two audio channels! */ interface PannerNode extends AudioNode { coneInnerAngle: number; coneOuterAngle: number; coneOuterGain: number; distanceModel: DistanceModelType; maxDistance: number; readonly orientationX: AudioParam; readonly orientationY: AudioParam; readonly orientationZ: AudioParam; panningModel: PanningModelType; readonly positionX: AudioParam; readonly positionY: AudioParam; readonly positionZ: AudioParam; refDistance: number; rolloffFactor: number; /** @deprecated */ setOrientation(x: number, y: number, z: number): void; /** @deprecated */ setPosition(x: number, y: number, z: number): void; } interface PeriodicWaveConstraints { disableNormalization?: boolean; } interface PeriodicWaveOptions extends PeriodicWaveConstraints { imag?: number[] | Float32Array; real?: number[] | Float32Array; } /** The Web Audio API events that occur when a ScriptProcessorNode input buffer is ready to be processed. */ interface AudioProcessingEvent extends Event { readonly inputBuffer: AudioBuffer; readonly outputBuffer: AudioBuffer; readonly playbackTime: number; } declare var AudioProcessingEvent: { prototype: AudioProcessingEvent; new(type: string, eventInitDict: AudioProcessingEventInit): AudioProcessingEvent; }; /** Allows the generation, processing, or analyzing of audio using JavaScript. */ interface ScriptProcessorNode extends AudioNode { /** @deprecated */ readonly bufferSize: number; /** @deprecated */ onaudioprocess: ((this: ScriptProcessorNode, ev: AudioProcessingEvent) => any) | null; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var ScriptProcessorNode: { prototype: ScriptProcessorNode; new(): ScriptProcessorNode; }; /** The pan property takes a unitless value between -1 (full left pan) and 1 (full right pan). This interface was introduced as a much simpler way to apply a simple panning effect than having to use a full PannerNode. */ interface StereoPannerNode extends AudioNode { readonly pan: AudioParam; } /** A WaveShaperNode always has exactly one input and one output. */ interface WaveShaperNode extends AudioNode { curve: Float32Array | null; oversample: OverSampleType; } /** An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. */ interface DOMException { readonly code: number; readonly message: string; readonly name: string; readonly ABORT_ERR: number; readonly DATA_CLONE_ERR: number; readonly DOMSTRING_SIZE_ERR: number; readonly HIERARCHY_REQUEST_ERR: number; readonly INDEX_SIZE_ERR: number; readonly INUSE_ATTRIBUTE_ERR: number; readonly INVALID_ACCESS_ERR: number; readonly INVALID_CHARACTER_ERR: number; readonly INVALID_MODIFICATION_ERR: number; readonly INVALID_NODE_TYPE_ERR: number; readonly INVALID_STATE_ERR: number; readonly NAMESPACE_ERR: number; readonly NETWORK_ERR: number; readonly NOT_FOUND_ERR: number; readonly NOT_SUPPORTED_ERR: number; readonly NO_DATA_ALLOWED_ERR: number; readonly NO_MODIFICATION_ALLOWED_ERR: number; readonly QUOTA_EXCEEDED_ERR: number; readonly SECURITY_ERR: number; readonly SYNTAX_ERR: number; readonly TIMEOUT_ERR: number; readonly TYPE_MISMATCH_ERR: number; readonly URL_MISMATCH_ERR: number; readonly VALIDATION_ERR: number; readonly WRONG_DOCUMENT_ERR: number; } declare var DOMException: { prototype: DOMException; new(message?: string, name?: string): DOMException; readonly ABORT_ERR: number; readonly DATA_CLONE_ERR: number; readonly DOMSTRING_SIZE_ERR: number; readonly HIERARCHY_REQUEST_ERR: number; readonly INDEX_SIZE_ERR: number; readonly INUSE_ATTRIBUTE_ERR: number; readonly INVALID_ACCESS_ERR: number; readonly INVALID_CHARACTER_ERR: number; readonly INVALID_MODIFICATION_ERR: number; readonly INVALID_NODE_TYPE_ERR: number; readonly INVALID_STATE_ERR: number; readonly NAMESPACE_ERR: number; readonly NETWORK_ERR: number; readonly NOT_FOUND_ERR: number; readonly NOT_SUPPORTED_ERR: number; readonly NO_DATA_ALLOWED_ERR: number; readonly NO_MODIFICATION_ALLOWED_ERR: number; readonly QUOTA_EXCEEDED_ERR: number; readonly SECURITY_ERR: number; readonly SYNTAX_ERR: number; readonly TIMEOUT_ERR: number; readonly TYPE_MISMATCH_ERR: number; readonly URL_MISMATCH_ERR: number; readonly VALIDATION_ERR: number; readonly WRONG_DOCUMENT_ERR: number; }; type DecodeSuccessCallback = (decodedData: AudioBuffer) => void; type DecodeErrorCallback = (error: DOMException) => void; interface BaseAudioContext extends EventTarget { readonly audioWorklet: AudioWorklet; readonly currentTime: number; readonly destination: AudioDestinationNode; readonly listener: AudioListener; onstatechange: ((this: BaseAudioContext, ev: Event) => any) | null; readonly sampleRate: number; readonly state: AudioContextState; createAnalyser(): AnalyserNode; createBiquadFilter(): BiquadFilterNode; createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; createBufferSource(): AudioBufferSourceNode; createChannelMerger(numberOfInputs?: number): ChannelMergerNode; createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; createConstantSource(): ConstantSourceNode; createConvolver(): ConvolverNode; createDelay(maxDelayTime?: number): DelayNode; createDynamicsCompressor(): DynamicsCompressorNode; createGain(): GainNode; createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode; createOscillator(): OscillatorNode; createPanner(): PannerNode; createPeriodicWave(real: number[] | Float32Array, imag: number[] | Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; createStereoPanner(): StereoPannerNode; createWaveShaper(): WaveShaperNode; decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback | null, errorCallback?: DecodeErrorCallback | null): Promise; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var BaseAudioContext: { prototype: BaseAudioContext; new(): BaseAudioContext; }; declare var AnalyserNode: { prototype: AnalyserNode; new(context: BaseAudioContext, options?: AnalyserOptions): AnalyserNode; }; declare var BiquadFilterNode: { prototype: BiquadFilterNode; new(context: BaseAudioContext, options?: BiquadFilterOptions): BiquadFilterNode; }; declare var AudioBufferSourceNode: { prototype: AudioBufferSourceNode; new(context: BaseAudioContext, options?: AudioBufferSourceOptions): AudioBufferSourceNode; }; declare var ChannelMergerNode: { prototype: ChannelMergerNode; new(context: BaseAudioContext, options?: ChannelMergerOptions): ChannelMergerNode; }; declare var ChannelSplitterNode: { prototype: ChannelSplitterNode; new(context: BaseAudioContext, options?: ChannelSplitterOptions): ChannelSplitterNode; }; declare var ConstantSourceNode: { prototype: ConstantSourceNode; new(context: BaseAudioContext, options?: ConstantSourceOptions): ConstantSourceNode; }; declare var GainNode: { prototype: GainNode; new(context: BaseAudioContext, options?: GainOptions): GainNode; }; declare var ConvolverNode: { prototype: ConvolverNode; new(context: BaseAudioContext, options?: ConvolverOptions): ConvolverNode; }; declare var DelayNode: { prototype: DelayNode; new(context: BaseAudioContext, options?: DelayOptions): DelayNode; }; declare var IIRFilterNode: { prototype: IIRFilterNode; new(context: BaseAudioContext, options: IIRFilterOptions): IIRFilterNode; }; declare var PeriodicWave: { prototype: PeriodicWave; new(context: BaseAudioContext, options?: PeriodicWaveOptions): PeriodicWave; }; declare var DynamicsCompressorNode: { prototype: DynamicsCompressorNode; new(context: BaseAudioContext, options?: DynamicsCompressorOptions): DynamicsCompressorNode; }; type OscillatorType = "sine" | "square" | "sawtooth" | "triangle" | "custom"; interface OscillatorOptions extends AudioNodeOptions { detune?: number; frequency?: number; periodicWave?: PeriodicWave; type?: OscillatorType; } declare var OscillatorNode: { prototype: OscillatorNode; new(context: BaseAudioContext, options?: OscillatorOptions): OscillatorNode; }; interface PannerOptions extends AudioNodeOptions { coneInnerAngle?: number; coneOuterAngle?: number; coneOuterGain?: number; distanceModel?: DistanceModelType; maxDistance?: number; orientationX?: number; orientationY?: number; orientationZ?: number; panningModel?: PanningModelType; positionX?: number; positionY?: number; positionZ?: number; refDistance?: number; rolloffFactor?: number; } declare var PannerNode: { prototype: PannerNode; new(context: BaseAudioContext, options?: PannerOptions): PannerNode; }; interface StereoPannerOptions extends AudioNodeOptions { pan?: number; } declare var StereoPannerNode: { prototype: StereoPannerNode; new(context: BaseAudioContext, options?: StereoPannerOptions): StereoPannerNode; }; type OverSampleType = "none" | "2x" | "4x"; interface WaveShaperOptions extends AudioNodeOptions { curve?: number[] | Float32Array; oversample?: OverSampleType; } declare var WaveShaperNode: { prototype: WaveShaperNode; new(context: BaseAudioContext, options?: WaveShaperOptions): WaveShaperNode; }; interface PaymentCurrencyAmount { currency: string; currencySystem?: string; value: string; } interface PaymentItem { amount: PaymentCurrencyAmount; label: string; pending?: boolean; } interface PaymentDetailsModifier { additionalDisplayItems?: PaymentItem[]; data?: any; supportedMethods: string | string[]; total?: PaymentItem; } interface PaymentShippingOption { amount: PaymentCurrencyAmount; id: string; label: string; selected?: boolean; } interface PaymentDetailsBase { displayItems?: PaymentItem[]; modifiers?: PaymentDetailsModifier[]; shippingOptions?: PaymentShippingOption[]; } interface PaymentDetailsInit extends PaymentDetailsBase { id?: string; total: PaymentItem; } interface PaymentDetailsUpdate extends PaymentDetailsBase { error?: string; total?: PaymentItem; } interface PaymentMethodData { data?: any; supportedMethods: string | string[]; } interface PaymentOptions { requestPayerEmail?: boolean; requestPayerName?: boolean; requestPayerPhone?: boolean; requestShipping?: boolean; shippingType?: string; } interface PaymentRequestUpdateEventInit extends EventInit {} interface Pbkdf2Params extends Algorithm { hash: HashAlgorithmIdentifier; iterations: number; salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; } interface PerformanceObserverInit { buffered?: boolean; entryTypes?: string[]; type?: string; } interface PipeOptions { preventAbort?: boolean; preventCancel?: boolean; preventClose?: boolean; signal?: AbortSignal; } interface PointerEventInit extends MouseEventInit { height?: number; isPrimary?: boolean; pointerId?: number; pointerType?: string; pressure?: number; tangentialPressure?: number; tiltX?: number; tiltY?: number; twist?: number; width?: number; } interface PopStateEventInit extends EventInit { state?: any; } interface PositionOptions { enableHighAccuracy?: boolean; maximumAge?: number; timeout?: number; } interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; total?: number; } /** Events measuring progress of an underlying process, like an HTTP request (for an XMLHttpRequest, or the loading of the underlying resource of an ,