1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

feat(cli): update to TypeScript 4.8 (#15064)

This commit is contained in:
Kitson Kelly 2022-09-20 07:00:01 +10:00 committed by GitHub
parent 79aee3668d
commit 73e89844ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 9863 additions and 5280 deletions

318
cli/dts/lib.dom.d.ts vendored
View file

@ -16,7 +16,7 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
/// <reference lib="dom.extras" />
///////////////////////////// /////////////////////////////
/// Window APIs /// Window APIs
@ -590,6 +590,10 @@ interface IDBObjectStoreParameters {
keyPath?: string | string[] | null; keyPath?: string | string[] | null;
} }
interface IDBTransactionOptions {
durability?: IDBTransactionDurability;
}
interface IDBVersionChangeEventInit extends EventInit { interface IDBVersionChangeEventInit extends EventInit {
newVersion?: number | null; newVersion?: number | null;
oldVersion?: number; oldVersion?: number;
@ -721,19 +725,6 @@ interface LockOptions {
steal?: boolean; steal?: boolean;
} }
interface MIDIConnectionEventInit extends EventInit {
port?: MIDIPort;
}
interface MIDIMessageEventInit extends EventInit {
data?: Uint8Array;
}
interface MIDIOptions {
software?: boolean;
sysex?: boolean;
}
interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo { interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo {
configuration?: MediaDecodingConfiguration; configuration?: MediaDecodingConfiguration;
} }
@ -1514,12 +1505,12 @@ interface RTCTransportStats extends RTCStats {
tlsVersion?: string; tlsVersion?: string;
} }
interface ReadableStreamDefaultReadDoneResult { interface ReadableStreamReadDoneResult {
done: true; done: true;
value?: undefined; value?: undefined;
} }
interface ReadableStreamDefaultReadValueResult<T> { interface ReadableStreamReadValueResult<T> {
done: false; done: false;
value: T; value: T;
} }
@ -1815,6 +1806,19 @@ interface UnderlyingSource<R = any> {
type?: undefined; type?: undefined;
} }
interface ValidityStateFlags {
badInput?: boolean;
customError?: boolean;
patternMismatch?: boolean;
rangeOverflow?: boolean;
rangeUnderflow?: boolean;
stepMismatch?: boolean;
tooLong?: boolean;
tooShort?: boolean;
typeMismatch?: boolean;
valueMissing?: boolean;
}
interface VideoColorSpaceInit { interface VideoColorSpaceInit {
fullRange?: boolean; fullRange?: boolean;
matrix?: VideoMatrixCoefficients; matrix?: VideoMatrixCoefficients;
@ -2191,6 +2195,7 @@ declare var AudioBufferSourceNode: {
/** An audio-processing graph built from audio modules linked together, each represented by an AudioNode. */ /** An audio-processing graph built from audio modules linked together, each represented by an AudioNode. */
interface AudioContext extends BaseAudioContext { interface AudioContext extends BaseAudioContext {
readonly baseLatency: number; readonly baseLatency: number;
readonly outputLatency: number;
close(): Promise<void>; close(): Promise<void>;
createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;
createMediaStreamDestination(): MediaStreamAudioDestinationNode; createMediaStreamDestination(): MediaStreamAudioDestinationNode;
@ -2567,7 +2572,7 @@ declare var CSSAnimation: {
/** A single condition CSS at-rule, which consists of a condition and a statement block. It is a child of CSSGroupingRule. */ /** A single condition CSS at-rule, which consists of a condition and a statement block. It is a child of CSSGroupingRule. */
interface CSSConditionRule extends CSSGroupingRule { interface CSSConditionRule extends CSSGroupingRule {
conditionText: string; readonly conditionText: string;
} }
declare var CSSConditionRule: { declare var CSSConditionRule: {
@ -2853,7 +2858,6 @@ interface CSSStyleDeclaration {
columns: string; columns: string;
contain: string; contain: string;
content: string; content: string;
contentVisibility: string;
counterIncrement: string; counterIncrement: string;
counterReset: string; counterReset: string;
counterSet: string; counterSet: string;
@ -3227,6 +3231,8 @@ interface CSSStyleDeclaration {
/** @deprecated This is a legacy alias of `perspectiveOrigin`. */ /** @deprecated This is a legacy alias of `perspectiveOrigin`. */
webkitPerspectiveOrigin: string; webkitPerspectiveOrigin: string;
webkitTextFillColor: string; webkitTextFillColor: string;
/** @deprecated This is a legacy alias of `textSizeAdjust`. */
webkitTextSizeAdjust: string;
webkitTextStroke: string; webkitTextStroke: string;
webkitTextStrokeColor: string; webkitTextStrokeColor: string;
webkitTextStrokeWidth: string; webkitTextStrokeWidth: string;
@ -3294,6 +3300,8 @@ interface CSSStyleSheet extends StyleSheet {
insertRule(rule: string, index?: number): number; insertRule(rule: string, index?: number): number;
/** @deprecated */ /** @deprecated */
removeRule(index?: number): void; removeRule(index?: number): void;
replace(text: string): Promise<CSSStyleSheet>;
replaceSync(text: string): void;
} }
declare var CSSStyleSheet: { declare var CSSStyleSheet: {
@ -3777,6 +3785,7 @@ declare var CustomEvent: {
/** An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. */ /** 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 extends Error { interface DOMException extends Error {
/** @deprecated */
readonly code: number; readonly code: number;
readonly message: string; readonly message: string;
readonly name: string; readonly name: string;
@ -4521,8 +4530,6 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent;
createEvent(eventInterface: "InputEvent"): InputEvent; createEvent(eventInterface: "InputEvent"): InputEvent;
createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent;
createEvent(eventInterface: "MIDIConnectionEvent"): MIDIConnectionEvent;
createEvent(eventInterface: "MIDIMessageEvent"): MIDIMessageEvent;
createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent; createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent;
createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent; createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent;
createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent; createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent;
@ -4734,6 +4741,7 @@ interface DocumentOrShadowRoot {
* Similarly, when the focused element is in a different node tree than documentOrShadowRoot, the element returned will be the host that's located in the same node tree as documentOrShadowRoot if documentOrShadowRoot is a shadow-including inclusive ancestor of the focused element, and null if not. * Similarly, when the focused element is in a different node tree than documentOrShadowRoot, the element returned will be the host that's located in the same node tree as documentOrShadowRoot if documentOrShadowRoot is a shadow-including inclusive ancestor of the focused element, and null if not.
*/ */
readonly activeElement: Element | null; readonly activeElement: Element | null;
adoptedStyleSheets: CSSStyleSheet[];
/** Returns document's fullscreen element. */ /** Returns document's fullscreen element. */
readonly fullscreenElement: Element | null; readonly fullscreenElement: Element | null;
readonly pictureInPictureElement: Element | null; readonly pictureInPictureElement: Element | null;
@ -4981,14 +4989,24 @@ interface ElementInternals extends ARIAMixin {
readonly labels: NodeList; readonly labels: NodeList;
/** Returns the ShadowRoot for internals's target element, if the target element is a shadow host, or null otherwise. */ /** Returns the ShadowRoot for internals's target element, if the target element is a shadow host, or null otherwise. */
readonly shadowRoot: ShadowRoot | null; readonly shadowRoot: ShadowRoot | null;
/** Returns the error message that would be shown to the user if internals's target element was to be checked for validity. */
readonly validationMessage: string;
/** Returns the ValidityState object for internals's target element. */
readonly validity: ValidityState;
/** Returns true if internals's target element will be validated when the form is submitted; false otherwise. */ /** Returns true if internals's target element will be validated when the form is submitted; false otherwise. */
readonly willValidate: boolean; readonly willValidate: boolean;
/** Returns true if internals's target element has no validity problems; false otherwise. Fires an invalid event at the element in the latter case. */
checkValidity(): boolean;
/** Returns true if internals's target element has no validity problems; otherwise, returns false, fires an invalid event at the element, and (if the event isn't canceled) reports the problem to the user. */
reportValidity(): boolean;
/** /**
* Sets both the state and submission value of internals's target element to value. * Sets both the state and submission value of internals's target element to value.
* *
* If value is null, the element won't participate in form submission. * If value is null, the element won't participate in form submission.
*/ */
setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void; setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
/** Marks internals's target element as suffering from the constraints indicated by the flags argument, and sets the element's validation message to message. If anchor is specified, the user agent might use it to indicate problems with the constraints of internals's target element when the form owner is validated interactively or reportValidity() is called. */
setValidity(flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement): void;
} }
declare var ElementInternals: { declare var ElementInternals: {
@ -6072,7 +6090,6 @@ declare var HTMLBaseElement: {
}; };
interface HTMLBodyElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap { interface HTMLBodyElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap {
"orientationchange": Event;
} }
/** Provides special properties (beyond those inherited from the regular HTMLElement interface) for manipulating <body> elements. */ /** Provides special properties (beyond those inherited from the regular HTMLElement interface) for manipulating <body> elements. */
@ -6086,8 +6103,6 @@ interface HTMLBodyElement extends HTMLElement, WindowEventHandlers {
/** @deprecated */ /** @deprecated */
link: string; link: string;
/** @deprecated */ /** @deprecated */
onorientationchange: ((this: HTMLBodyElement, ev: Event) => any) | null;
/** @deprecated */
text: string; text: string;
/** @deprecated */ /** @deprecated */
vLink: string; vLink: string;
@ -6346,6 +6361,7 @@ interface HTMLElement extends Element, DocumentAndElementEventHandlers, ElementC
dir: string; dir: string;
draggable: boolean; draggable: boolean;
hidden: boolean; hidden: boolean;
inert: boolean;
innerText: string; innerText: string;
lang: string; lang: string;
readonly offsetHeight: number; readonly offsetHeight: number;
@ -7009,6 +7025,7 @@ interface HTMLInputElement extends HTMLElement {
* @param direction The direction in which the selection is performed. * @param direction The direction in which the selection is performed.
*/ */
setSelectionRange(start: number | null, end: number | null, direction?: "forward" | "backward" | "none"): void; setSelectionRange(start: number | null, end: number | null, direction?: "forward" | "backward" | "none"): void;
showPicker(): void;
/** /**
* Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value.
* @param n Value to decrement the value by. * @param n Value to decrement the value by.
@ -7236,6 +7253,7 @@ interface HTMLMediaElement extends HTMLElement {
readonly played: TimeRanges; readonly played: TimeRanges;
/** Gets or sets a value indicating what data should be preloaded, if any. */ /** Gets or sets a value indicating what data should be preloaded, if any. */
preload: "none" | "metadata" | "auto" | ""; preload: "none" | "metadata" | "auto" | "";
preservesPitch: boolean;
readonly readyState: number; readonly readyState: number;
readonly remote: RemotePlayback; readonly remote: RemotePlayback;
/** Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. */ /** Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. */
@ -7602,16 +7620,25 @@ declare var HTMLParagraphElement: {
new(): HTMLParagraphElement; new(): HTMLParagraphElement;
}; };
/** Provides special properties (beyond those of the regular HTMLElement object interface it inherits) for manipulating <param> elements, representing a pair of a key and a value that acts as a parameter for an <object> element. */ /**
* Provides special properties (beyond those of the regular HTMLElement object interface it inherits) for manipulating <param> elements, representing a pair of a key and a value that acts as a parameter for an <object> element.
* @deprecated
*/
interface HTMLParamElement extends HTMLElement { interface HTMLParamElement extends HTMLElement {
/** Sets or retrieves the name of an input parameter for an element. */ /**
* Sets or retrieves the name of an input parameter for an element.
* @deprecated
*/
name: string; name: string;
/** /**
* Sets or retrieves the content type of the resource designated by the value attribute. * Sets or retrieves the content type of the resource designated by the value attribute.
* @deprecated * @deprecated
*/ */
type: string; type: string;
/** Sets or retrieves the value of an input parameter for an element. */ /**
* Sets or retrieves the value of an input parameter for an element.
* @deprecated
*/
value: string; value: string;
/** /**
* Sets or retrieves the data type of the value attribute. * Sets or retrieves the data type of the value attribute.
@ -7624,6 +7651,7 @@ interface HTMLParamElement extends HTMLElement {
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
} }
/** @deprecated */
declare var HTMLParamElement: { declare var HTMLParamElement: {
prototype: HTMLParamElement; prototype: HTMLParamElement;
new(): HTMLParamElement; new(): HTMLParamElement;
@ -8517,7 +8545,7 @@ interface IDBDatabase extends EventTarget {
*/ */
deleteObjectStore(name: string): void; deleteObjectStore(name: string): void;
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */ /** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction; transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@ -9103,126 +9131,6 @@ declare var LockManager: {
new(): LockManager; new(): LockManager;
}; };
interface MIDIAccessEventMap {
"statechange": Event;
}
/** Available only in secure contexts. */
interface MIDIAccess extends EventTarget {
readonly inputs: MIDIInputMap;
onstatechange: ((this: MIDIAccess, ev: Event) => any) | null;
readonly outputs: MIDIOutputMap;
readonly sysexEnabled: boolean;
addEventListener<K extends keyof MIDIAccessEventMap>(type: K, listener: (this: MIDIAccess, ev: MIDIAccessEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MIDIAccessEventMap>(type: K, listener: (this: MIDIAccess, ev: MIDIAccessEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var MIDIAccess: {
prototype: MIDIAccess;
new(): MIDIAccess;
};
/** Available only in secure contexts. */
interface MIDIConnectionEvent extends Event {
readonly port: MIDIPort;
}
declare var MIDIConnectionEvent: {
prototype: MIDIConnectionEvent;
new(type: string, eventInitDict?: MIDIConnectionEventInit): MIDIConnectionEvent;
};
interface MIDIInputEventMap extends MIDIPortEventMap {
"midimessage": Event;
}
/** Available only in secure contexts. */
interface MIDIInput extends MIDIPort {
onmidimessage: ((this: MIDIInput, ev: Event) => any) | null;
addEventListener<K extends keyof MIDIInputEventMap>(type: K, listener: (this: MIDIInput, ev: MIDIInputEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MIDIInputEventMap>(type: K, listener: (this: MIDIInput, ev: MIDIInputEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var MIDIInput: {
prototype: MIDIInput;
new(): MIDIInput;
};
/** Available only in secure contexts. */
interface MIDIInputMap {
forEach(callbackfn: (value: MIDIInput, key: string, parent: MIDIInputMap) => void, thisArg?: any): void;
}
declare var MIDIInputMap: {
prototype: MIDIInputMap;
new(): MIDIInputMap;
};
/** Available only in secure contexts. */
interface MIDIMessageEvent extends Event {
readonly data: Uint8Array;
}
declare var MIDIMessageEvent: {
prototype: MIDIMessageEvent;
new(type: string, eventInitDict?: MIDIMessageEventInit): MIDIMessageEvent;
};
/** Available only in secure contexts. */
interface MIDIOutput extends MIDIPort {
send(data: number[], timestamp?: DOMHighResTimeStamp): void;
addEventListener<K extends keyof MIDIPortEventMap>(type: K, listener: (this: MIDIOutput, ev: MIDIPortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MIDIPortEventMap>(type: K, listener: (this: MIDIOutput, ev: MIDIPortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var MIDIOutput: {
prototype: MIDIOutput;
new(): MIDIOutput;
};
/** Available only in secure contexts. */
interface MIDIOutputMap {
forEach(callbackfn: (value: MIDIOutput, key: string, parent: MIDIOutputMap) => void, thisArg?: any): void;
}
declare var MIDIOutputMap: {
prototype: MIDIOutputMap;
new(): MIDIOutputMap;
};
interface MIDIPortEventMap {
"statechange": Event;
}
/** Available only in secure contexts. */
interface MIDIPort extends EventTarget {
readonly connection: MIDIPortConnectionState;
readonly id: string;
readonly manufacturer: string | null;
readonly name: string | null;
onstatechange: ((this: MIDIPort, ev: Event) => any) | null;
readonly state: MIDIPortDeviceState;
readonly type: MIDIPortType;
readonly version: string | null;
close(): Promise<MIDIPort>;
open(): Promise<MIDIPort>;
addEventListener<K extends keyof MIDIPortEventMap>(type: K, listener: (this: MIDIPort, ev: MIDIPortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MIDIPortEventMap>(type: K, listener: (this: MIDIPort, ev: MIDIPortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var MIDIPort: {
prototype: MIDIPort;
new(): MIDIPort;
};
interface MathMLElementEventMap extends ElementEventMap, DocumentAndElementEventHandlersEventMap, GlobalEventHandlersEventMap { interface MathMLElementEventMap extends ElementEventMap, DocumentAndElementEventHandlersEventMap, GlobalEventHandlersEventMap {
} }
@ -9925,7 +9833,7 @@ declare var NavigationPreloadManager: {
}; };
/** The state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. */ /** The state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. */
interface Navigator extends NavigatorAutomationInformation, NavigatorConcurrentHardware, NavigatorContentUtils, NavigatorCookies, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorNetworkInformation, NavigatorOnLine, NavigatorPlugins, NavigatorStorage { interface Navigator extends NavigatorAutomationInformation, NavigatorConcurrentHardware, NavigatorContentUtils, NavigatorCookies, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorPlugins, NavigatorStorage {
/** Available only in secure contexts. */ /** Available only in secure contexts. */
readonly clipboard: Clipboard; readonly clipboard: Clipboard;
/** Available only in secure contexts. */ /** Available only in secure contexts. */
@ -9944,8 +9852,6 @@ interface Navigator extends NavigatorAutomationInformation, NavigatorConcurrentH
canShare(data?: ShareData): boolean; canShare(data?: ShareData): boolean;
getGamepads(): (Gamepad | null)[]; getGamepads(): (Gamepad | null)[];
/** Available only in secure contexts. */ /** Available only in secure contexts. */
requestMIDIAccess(options?: MIDIOptions): Promise<MIDIAccess>;
/** Available only in secure contexts. */
requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise<MediaKeySystemAccess>; requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise<MediaKeySystemAccess>;
sendBeacon(url: string | URL, data?: BodyInit | null): boolean; sendBeacon(url: string | URL, data?: BodyInit | null): boolean;
/** Available only in secure contexts. */ /** Available only in secure contexts. */
@ -9982,7 +9888,6 @@ interface NavigatorID {
readonly appName: string; readonly appName: string;
/** @deprecated */ /** @deprecated */
readonly appVersion: string; readonly appVersion: string;
/** @deprecated */
readonly platform: string; readonly platform: string;
/** @deprecated */ /** @deprecated */
readonly product: string; readonly product: string;
@ -10004,10 +9909,6 @@ interface NavigatorLocks {
readonly locks: LockManager; readonly locks: LockManager;
} }
interface NavigatorNetworkInformation {
readonly connection: NetworkInformation;
}
interface NavigatorOnLine { interface NavigatorOnLine {
readonly onLine: boolean; readonly onLine: boolean;
} }
@ -10027,15 +9928,6 @@ interface NavigatorStorage {
readonly storage: StorageManager; readonly storage: StorageManager;
} }
interface NetworkInformation extends EventTarget {
readonly type: ConnectionType;
}
declare var NetworkInformation: {
prototype: NetworkInformation;
new(): NetworkInformation;
};
/** Node is an interface from which a number of DOM API object types inherit. It allows those types to be treated similarly; for example, inheriting the same set of methods, or being tested in the same way. */ /** Node is an interface from which a number of DOM API object types inherit. It allows those types to be treated similarly; for example, inheriting the same set of methods, or being tested in the same way. */
interface Node extends EventTarget { interface Node extends EventTarget {
/** Returns node's node document's document base URL. */ /** Returns node's node document's document base URL. */
@ -10994,6 +10886,7 @@ declare var PushManager: {
*/ */
interface PushSubscription { interface PushSubscription {
readonly endpoint: string; readonly endpoint: string;
readonly expirationTime: EpochTimeStamp | null;
readonly options: PushSubscriptionOptions; readonly options: PushSubscriptionOptions;
getKey(name: PushEncryptionKeyName): ArrayBuffer | null; getKey(name: PushEncryptionKeyName): ArrayBuffer | null;
toJSON(): PushSubscriptionJSON; toJSON(): PushSubscriptionJSON;
@ -11475,6 +11368,19 @@ declare var Range: {
toString(): string; toString(): string;
}; };
interface ReadableByteStreamController {
readonly byobRequest: ReadableStreamBYOBRequest | null;
readonly desiredSize: number | null;
close(): void;
enqueue(chunk: ArrayBufferView): void;
error(e?: any): void;
}
declare var ReadableByteStreamController: {
prototype: ReadableByteStreamController;
new(): ReadableByteStreamController;
};
/** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */ /** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */
interface ReadableStream<R = any> { interface ReadableStream<R = any> {
readonly locked: boolean; readonly locked: boolean;
@ -11490,6 +11396,27 @@ declare var ReadableStream: {
new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>; new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
}; };
interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
read(view: ArrayBufferView): Promise<ReadableStreamReadResult<ArrayBufferView>>;
releaseLock(): void;
}
declare var ReadableStreamBYOBReader: {
prototype: ReadableStreamBYOBReader;
new(stream: ReadableStream): ReadableStreamBYOBReader;
};
interface ReadableStreamBYOBRequest {
readonly view: ArrayBufferView | null;
respond(bytesWritten: number): void;
respondWithNewView(view: ArrayBufferView): void;
}
declare var ReadableStreamBYOBRequest: {
prototype: ReadableStreamBYOBRequest;
new(): ReadableStreamBYOBRequest;
};
interface ReadableStreamDefaultController<R = any> { interface ReadableStreamDefaultController<R = any> {
readonly desiredSize: number | null; readonly desiredSize: number | null;
close(): void; close(): void;
@ -11503,7 +11430,7 @@ declare var ReadableStreamDefaultController: {
}; };
interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader { interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
read(): Promise<ReadableStreamDefaultReadResult<R>>; read(): Promise<ReadableStreamReadResult<R>>;
releaseLock(): void; releaseLock(): void;
} }
@ -11627,7 +11554,6 @@ interface Response extends Body {
declare var Response: { declare var Response: {
prototype: Response; prototype: Response;
new(body?: BodyInit | null, init?: ResponseInit): Response; new(body?: BodyInit | null, init?: ResponseInit): Response;
json(data: unknown, init?: ResponseInit): Response;
error(): Response; error(): Response;
redirect(url: string | URL, status?: number): Response; redirect(url: string | URL, status?: number): Response;
}; };
@ -13922,11 +13848,11 @@ declare var SubmitEvent: {
* Available only in secure contexts. * Available only in secure contexts.
*/ */
interface SubtleCrypto { interface SubtleCrypto {
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>; decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>; deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>; digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>; encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>; exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>; exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>; generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
@ -16684,7 +16610,7 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
/** Returns true if the toolbar is visible; otherwise, returns false. */ /** Returns true if the toolbar is visible; otherwise, returns false. */
readonly toolbar: BarProp; readonly toolbar: BarProp;
readonly top: WindowProxy | null; readonly top: WindowProxy | null;
readonly visualViewport: VisualViewport; readonly visualViewport: VisualViewport | null;
readonly window: Window & typeof globalThis; readonly window: Window & typeof globalThis;
alert(message?: any): void; alert(message?: any): void;
blur(): void; blur(): void;
@ -16803,8 +16729,8 @@ interface WindowOrWorkerGlobalScope {
readonly performance: Performance; readonly performance: Performance;
atob(data: string): string; atob(data: string): string;
btoa(data: string): string; btoa(data: string): string;
clearInterval(id?: number): void; clearInterval(id: number | undefined): void;
clearTimeout(id?: number): void; clearTimeout(id: number | undefined): void;
createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>; createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>; createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>; fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
@ -16876,6 +16802,7 @@ declare var WritableStream: {
/** This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */ /** This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */
interface WritableStreamDefaultController { interface WritableStreamDefaultController {
readonly signal: AbortSignal;
error(e?: any): void; error(e?: any): void;
} }
@ -17494,7 +17421,6 @@ interface HTMLElementTagNameMap {
"details": HTMLDetailsElement; "details": HTMLDetailsElement;
"dfn": HTMLElement; "dfn": HTMLElement;
"dialog": HTMLDialogElement; "dialog": HTMLDialogElement;
"dir": HTMLDirectoryElement;
"div": HTMLDivElement; "div": HTMLDivElement;
"dl": HTMLDListElement; "dl": HTMLDListElement;
"dt": HTMLElement; "dt": HTMLElement;
@ -17503,11 +17429,8 @@ interface HTMLElementTagNameMap {
"fieldset": HTMLFieldSetElement; "fieldset": HTMLFieldSetElement;
"figcaption": HTMLElement; "figcaption": HTMLElement;
"figure": HTMLElement; "figure": HTMLElement;
"font": HTMLFontElement;
"footer": HTMLElement; "footer": HTMLElement;
"form": HTMLFormElement; "form": HTMLFormElement;
"frame": HTMLFrameElement;
"frameset": HTMLFrameSetElement;
"h1": HTMLHeadingElement; "h1": HTMLHeadingElement;
"h2": HTMLHeadingElement; "h2": HTMLHeadingElement;
"h3": HTMLHeadingElement; "h3": HTMLHeadingElement;
@ -17532,7 +17455,6 @@ interface HTMLElementTagNameMap {
"main": HTMLElement; "main": HTMLElement;
"map": HTMLMapElement; "map": HTMLMapElement;
"mark": HTMLElement; "mark": HTMLElement;
"marquee": HTMLMarqueeElement;
"menu": HTMLMenuElement; "menu": HTMLMenuElement;
"meta": HTMLMetaElement; "meta": HTMLMetaElement;
"meter": HTMLMeterElement; "meter": HTMLMeterElement;
@ -17544,7 +17466,6 @@ interface HTMLElementTagNameMap {
"option": HTMLOptionElement; "option": HTMLOptionElement;
"output": HTMLOutputElement; "output": HTMLOutputElement;
"p": HTMLParagraphElement; "p": HTMLParagraphElement;
"param": HTMLParamElement;
"picture": HTMLPictureElement; "picture": HTMLPictureElement;
"pre": HTMLPreElement; "pre": HTMLPreElement;
"progress": HTMLProgressElement; "progress": HTMLProgressElement;
@ -17586,7 +17507,34 @@ interface HTMLElementTagNameMap {
} }
interface HTMLElementDeprecatedTagNameMap { interface HTMLElementDeprecatedTagNameMap {
"acronym": HTMLElement;
"applet": HTMLUnknownElement;
"basefont": HTMLElement;
"bgsound": HTMLUnknownElement;
"big": HTMLElement;
"blink": HTMLUnknownElement;
"center": HTMLElement;
"dir": HTMLDirectoryElement;
"font": HTMLFontElement;
"frame": HTMLFrameElement;
"frameset": HTMLFrameSetElement;
"isindex": HTMLUnknownElement;
"keygen": HTMLUnknownElement;
"listing": HTMLPreElement; "listing": HTMLPreElement;
"marquee": HTMLMarqueeElement;
"menuitem": HTMLElement;
"multicol": HTMLUnknownElement;
"nextid": HTMLUnknownElement;
"nobr": HTMLElement;
"noembed": HTMLElement;
"noframes": HTMLElement;
"param": HTMLParamElement;
"plaintext": HTMLElement;
"rb": HTMLElement;
"rtc": HTMLElement;
"spacer": HTMLUnknownElement;
"strike": HTMLElement;
"tt": HTMLElement;
"xmp": HTMLPreElement; "xmp": HTMLPreElement;
} }
@ -17735,7 +17683,7 @@ declare var statusbar: BarProp;
/** Returns true if the toolbar is visible; otherwise, returns false. */ /** Returns true if the toolbar is visible; otherwise, returns false. */
declare var toolbar: BarProp; declare var toolbar: BarProp;
declare var top: WindowProxy | null; declare var top: WindowProxy | null;
declare var visualViewport: VisualViewport; declare var visualViewport: VisualViewport | null;
declare var window: Window & typeof globalThis; declare var window: Window & typeof globalThis;
declare function alert(message?: any): void; declare function alert(message?: any): void;
declare function blur(): void; declare function blur(): void;
@ -18089,8 +18037,8 @@ declare var origin: string;
declare var performance: Performance; declare var performance: Performance;
declare function atob(data: string): string; declare function atob(data: string): string;
declare function btoa(data: string): string; declare function btoa(data: string): string;
declare function clearInterval(id?: number): void; declare function clearInterval(id: number | undefined): void;
declare function clearTimeout(id?: number): void; declare function clearTimeout(id: number | undefined): void;
declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>; declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>; declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>; declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
@ -18139,7 +18087,7 @@ type GLuint64 = number;
type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement; type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement;
type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement; type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement;
type HashAlgorithmIdentifier = AlgorithmIdentifier; type HashAlgorithmIdentifier = AlgorithmIdentifier;
type HeadersInit = string[][] | Record<string, string> | Headers; type HeadersInit = [string, string][] | Record<string, string> | Headers;
type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[]; type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[];
type ImageBitmapSource = CanvasImageSource | Blob | ImageData; type ImageBitmapSource = CanvasImageSource | Blob | ImageData;
type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend";
@ -18153,7 +18101,7 @@ type OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null;
type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
type PerformanceEntryList = PerformanceEntry[]; type PerformanceEntryList = PerformanceEntry[];
type ReadableStreamController<T> = ReadableStreamDefaultController<T>; type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult; type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult;
type ReadableStreamReader<T> = ReadableStreamDefaultReader<T>; type ReadableStreamReader<T> = ReadableStreamDefaultReader<T>;
type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext; type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
type RequestInfo = Request | string; type RequestInfo = Request | string;
@ -18197,11 +18145,10 @@ type ColorGamut = "p3" | "rec2020" | "srgb";
type ColorSpaceConversion = "default" | "none"; type ColorSpaceConversion = "default" | "none";
type CompositeOperation = "accumulate" | "add" | "replace"; type CompositeOperation = "accumulate" | "add" | "replace";
type CompositeOperationOrAuto = "accumulate" | "add" | "auto" | "replace"; type CompositeOperationOrAuto = "accumulate" | "add" | "auto" | "replace";
type ConnectionType = "bluetooth" | "cellular" | "ethernet" | "mixed" | "none" | "other" | "unknown" | "wifi";
type CredentialMediationRequirement = "optional" | "required" | "silent"; type CredentialMediationRequirement = "optional" | "required" | "silent";
type DOMParserSupportedType = "application/xhtml+xml" | "application/xml" | "image/svg+xml" | "text/html" | "text/xml"; type DOMParserSupportedType = "application/xhtml+xml" | "application/xml" | "image/svg+xml" | "text/html" | "text/xml";
type DirectionSetting = "" | "lr" | "rl"; type DirectionSetting = "" | "lr" | "rl";
type DisplayCaptureSurfaceType = "application" | "browser" | "monitor" | "window"; type DisplayCaptureSurfaceType = "browser" | "monitor" | "window";
type DistanceModelType = "exponential" | "inverse" | "linear"; type DistanceModelType = "exponential" | "inverse" | "linear";
type DocumentReadyState = "complete" | "interactive" | "loading"; type DocumentReadyState = "complete" | "interactive" | "loading";
type DocumentVisibilityState = "hidden" | "visible"; type DocumentVisibilityState = "hidden" | "visible";
@ -18228,9 +18175,6 @@ type KeyType = "private" | "public" | "secret";
type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey"; type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
type LineAlignSetting = "center" | "end" | "start"; type LineAlignSetting = "center" | "end" | "start";
type LockMode = "exclusive" | "shared"; type LockMode = "exclusive" | "shared";
type MIDIPortConnectionState = "closed" | "open" | "pending";
type MIDIPortDeviceState = "connected" | "disconnected";
type MIDIPortType = "input" | "output";
type MediaDecodingType = "file" | "media-source" | "webrtc"; type MediaDecodingType = "file" | "media-source" | "webrtc";
type MediaDeviceKind = "audioinput" | "audiooutput" | "videoinput"; type MediaDeviceKind = "audioinput" | "audiooutput" | "videoinput";
type MediaEncodingType = "record" | "webrtc"; type MediaEncodingType = "record" | "webrtc";

View file

@ -121,7 +121,7 @@ interface Headers {
interface IDBDatabase { interface IDBDatabase {
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */ /** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction; transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
} }
interface IDBObjectStore { interface IDBObjectStore {
@ -133,16 +133,6 @@ interface IDBObjectStore {
createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex; createIndex(name: string, keyPath: string | Iterable<string>, options?: IDBIndexParameters): IDBIndex;
} }
interface MIDIInputMap extends ReadonlyMap<string, MIDIInput> {
}
interface MIDIOutput {
send(data: Iterable<number>, timestamp?: DOMHighResTimeStamp): void;
}
interface MIDIOutputMap extends ReadonlyMap<string, MIDIOutput> {
}
interface MediaKeyStatusMap { interface MediaKeyStatusMap {
[Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>; [Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>;
entries(): IterableIterator<[BufferSource, MediaKeyStatus]>; entries(): IterableIterator<[BufferSource, MediaKeyStatus]>;

View file

@ -19,18 +19,38 @@ and limitations under the License.
interface Map<K, V> { interface Map<K, V> {
clear(): void; clear(): void;
/**
* @returns true if an element in the Map existed and has been removed, or false if the element does not exist.
*/
delete(key: K): boolean; delete(key: K): boolean;
/**
* Executes a provided function once per each key/value pair in the Map, in insertion order.
*/
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void; forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
/**
* Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.
* @returns Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
*/
get(key: K): V | undefined; get(key: K): V | undefined;
/**
* @returns boolean indicating whether an element with the specified key exists or not.
*/
has(key: K): boolean; has(key: K): boolean;
/**
* Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
*/
set(key: K, value: V): this; set(key: K, value: V): this;
/**
* @returns the number of elements in the Map.
*/
readonly size: number; readonly size: number;
} }
interface MapConstructor { interface MapConstructor {
new(): Map<any, any>; new(): Map<any, any>;
new<K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>; new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
readonly prototype: Map<any, any>; readonly prototype: Map<any, any>;
} }
declare var Map: MapConstructor; declare var Map: MapConstructor;
@ -43,9 +63,23 @@ interface ReadonlyMap<K, V> {
} }
interface WeakMap<K extends object, V> { interface WeakMap<K extends object, V> {
/**
* Removes the specified element from the WeakMap.
* @returns true if the element was successfully removed, or false if it was not present.
*/
delete(key: K): boolean; delete(key: K): boolean;
/**
* @returns a specified element.
*/
get(key: K): V | undefined; get(key: K): V | undefined;
/**
* @returns a boolean indicating whether an element with the specified key exists or not.
*/
has(key: K): boolean; has(key: K): boolean;
/**
* Adds a new element with a specified key and value.
* @param key Must be an object.
*/
set(key: K, value: V): this; set(key: K, value: V): this;
} }
@ -56,11 +90,28 @@ interface WeakMapConstructor {
declare var WeakMap: WeakMapConstructor; declare var WeakMap: WeakMapConstructor;
interface Set<T> { interface Set<T> {
/**
* Appends a new element with a specified value to the end of the Set.
*/
add(value: T): this; add(value: T): this;
clear(): void; clear(): void;
/**
* Removes a specified value from the Set.
* @returns Returns true if an element in the Set existed and has been removed, or false if the element does not exist.
*/
delete(value: T): boolean; delete(value: T): boolean;
/**
* Executes a provided function once per each value in the Set object, in insertion order.
*/
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void; forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
/**
* @returns a boolean indicating whether an element with the specified value exists in the Set or not.
*/
has(value: T): boolean; has(value: T): boolean;
/**
* @returns the number of (unique) elements in Set.
*/
readonly size: number; readonly size: number;
} }
@ -77,8 +128,18 @@ interface ReadonlySet<T> {
} }
interface WeakSet<T extends object> { interface WeakSet<T extends object> {
/**
* Appends a new object to the end of the WeakSet.
*/
add(value: T): this; add(value: T): this;
/**
* Removes the specified element from the WeakSet.
* @returns Returns true if the element existed and has been removed, or false if the element does not exist.
*/
delete(value: T): boolean; delete(value: T): boolean;
/**
* @returns a boolean indicating whether an object exists in the WeakSet or not.
*/
has(value: T): boolean; has(value: T): boolean;
} }

View file

@ -19,23 +19,112 @@ and limitations under the License.
interface ProxyHandler<T extends object> { interface ProxyHandler<T extends object> {
/**
* A trap method for a function call.
* @param target The original callable object which is being proxied.
*/
apply?(target: T, thisArg: any, argArray: any[]): any; apply?(target: T, thisArg: any, argArray: any[]): any;
/**
* A trap for the `new` operator.
* @param target The original object which is being proxied.
* @param newTarget The constructor that was originally called.
*/
construct?(target: T, argArray: any[], newTarget: Function): object; construct?(target: T, argArray: any[], newTarget: Function): object;
defineProperty?(target: T, p: string | symbol, attributes: PropertyDescriptor): boolean;
/**
* A trap for `Object.defineProperty()`.
* @param target The original object which is being proxied.
* @returns A `Boolean` indicating whether or not the property has been defined.
*/
defineProperty?(target: T, property: string | symbol, attributes: PropertyDescriptor): boolean;
/**
* A trap for the `delete` operator.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to delete.
* @returns A `Boolean` indicating whether or not the property was deleted.
*/
deleteProperty?(target: T, p: string | symbol): boolean; deleteProperty?(target: T, p: string | symbol): boolean;
/**
* A trap for getting a property value.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to get.
* @param receiver The proxy or an object that inherits from the proxy.
*/
get?(target: T, p: string | symbol, receiver: any): any; get?(target: T, p: string | symbol, receiver: any): any;
/**
* A trap for `Object.getOwnPropertyDescriptor()`.
* @param target The original object which is being proxied.
* @param p The name of the property whose description should be retrieved.
*/
getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined; getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined;
/**
* A trap for the `[[GetPrototypeOf]]` internal method.
* @param target The original object which is being proxied.
*/
getPrototypeOf?(target: T): object | null; getPrototypeOf?(target: T): object | null;
/**
* A trap for the `in` operator.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to check for existence.
*/
has?(target: T, p: string | symbol): boolean; has?(target: T, p: string | symbol): boolean;
/**
* A trap for `Object.isExtensible()`.
* @param target The original object which is being proxied.
*/
isExtensible?(target: T): boolean; isExtensible?(target: T): boolean;
/**
* A trap for `Reflect.ownKeys()`.
* @param target The original object which is being proxied.
*/
ownKeys?(target: T): ArrayLike<string | symbol>; ownKeys?(target: T): ArrayLike<string | symbol>;
/**
* A trap for `Object.preventExtensions()`.
* @param target The original object which is being proxied.
*/
preventExtensions?(target: T): boolean; preventExtensions?(target: T): boolean;
set?(target: T, p: string | symbol, value: any, receiver: any): boolean;
/**
* A trap for setting a property value.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to set.
* @param receiver The object to which the assignment was originally directed.
* @returns `A `Boolean` indicating whether or not the property was set.
*/
set?(target: T, p: string | symbol, newValue: any, receiver: any): boolean;
/**
* A trap for `Object.setPrototypeOf()`.
* @param target The original object which is being proxied.
* @param newPrototype The object's new prototype or `null`.
*/
setPrototypeOf?(target: T, v: object | null): boolean; setPrototypeOf?(target: T, v: object | null): boolean;
} }
interface ProxyConstructor { interface ProxyConstructor {
/**
* Creates a revocable Proxy object.
* @param target A target object to wrap with Proxy.
* @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
*/
revocable<T extends object>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; }; revocable<T extends object>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
/**
* Creates a Proxy object. The Proxy object allows you to create an object that can be used in place of the
* original object, but which may redefine fundamental Object operations like getting, setting, and defining
* properties. Proxy objects are commonly used to log property accesses, validate, format, or sanitize inputs.
* @param target A target object to wrap with Proxy.
* @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
*/
new <T extends object>(target: T, handler: ProxyHandler<T>): T; new <T extends object>(target: T, handler: ProxyHandler<T>): T;
} }
declare var Proxy: ProxyConstructor; declare var Proxy: ProxyConstructor;

View file

@ -19,7 +19,22 @@ and limitations under the License.
declare namespace Intl { declare namespace Intl {
type DateTimeFormatPartTypes = "day" | "dayPeriod" | "era" | "hour" | "literal" | "minute" | "month" | "second" | "timeZoneName" | "weekday" | "year";
interface DateTimeFormatPartTypesRegistry {
day: any
dayPeriod: any
era: any
hour: any
literal: any
minute: any
month: any
second: any
timeZoneName: any
weekday: any
year: any
}
type DateTimeFormatPartTypes = keyof DateTimeFormatPartTypesRegistry;
interface DateTimeFormatPart { interface DateTimeFormatPart {
type: DateTimeFormatPartTypes; type: DateTimeFormatPartTypes;

View file

@ -18,6 +18,7 @@ and limitations under the License.
/// <reference no-default-lib="true"/> /// <reference no-default-lib="true"/>
/// <reference lib="es2018.intl" />
declare namespace Intl { declare namespace Intl {
/** /**
@ -50,6 +51,25 @@ declare namespace Intl {
| "second" | "second"
| "seconds"; | "seconds";
/**
* Value of the `unit` property in objects returned by
* `Intl.RelativeTimeFormat.prototype.formatToParts()`. `formatToParts` and
* `format` methods accept either singular or plural unit names as input,
* but `formatToParts` only outputs singular (e.g. "day") not plural (e.g.
* "days").
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).
*/
type RelativeTimeFormatUnitSingular =
| "year"
| "quarter"
| "month"
| "week"
| "day"
| "hour"
| "minute"
| "second";
/** /**
* The locale matching algorithm to use. * The locale matching algorithm to use.
* *
@ -120,11 +140,16 @@ declare namespace Intl {
* *
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts). * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).
*/ */
interface RelativeTimeFormatPart { type RelativeTimeFormatPart =
type: string; | {
value: string; type: "literal";
unit?: RelativeTimeFormatUnit; value: string;
} }
| {
type: Exclude<NumberFormatPartTypes, "literal">;
value: string;
unit: RelativeTimeFormatUnitSingular;
};
interface RelativeTimeFormat { interface RelativeTimeFormat {
/** /**

View file

@ -20,17 +20,25 @@ and limitations under the License.
declare namespace Intl { declare namespace Intl {
interface DateTimeFormatPartTypesRegistry {
fractionalSecond: any
}
interface DateTimeFormatOptions { interface DateTimeFormatOptions {
formatMatcher?: "basic" | "best fit" | "best fit" | undefined; formatMatcher?: "basic" | "best fit" | "best fit" | undefined;
dateStyle?: "full" | "long" | "medium" | "short" | undefined; dateStyle?: "full" | "long" | "medium" | "short" | undefined;
timeStyle?: "full" | "long" | "medium" | "short" | undefined; timeStyle?: "full" | "long" | "medium" | "short" | undefined;
dayPeriod?: "narrow" | "short" | "long" | undefined; dayPeriod?: "narrow" | "short" | "long" | undefined;
fractionalSecondDigits?: 0 | 1 | 2 | 3 | undefined; fractionalSecondDigits?: 1 | 2 | 3 | undefined;
}
interface DateTimeRangeFormatPart extends DateTimeFormatPart {
source: "startRange" | "endRange" | "shared"
} }
interface DateTimeFormat { interface DateTimeFormat {
formatRange(startDate: Date | number | bigint, endDate: Date | number | bigint): string; formatRange(startDate: Date | number | bigint, endDate: Date | number | bigint): string;
formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeFormatPart[]; formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeRangeFormatPart[];
} }
interface ResolvedDateTimeFormatOptions { interface ResolvedDateTimeFormatOptions {
@ -39,7 +47,7 @@ declare namespace Intl {
timeStyle?: "full" | "long" | "medium" | "short"; timeStyle?: "full" | "long" | "medium" | "short";
hourCycle?: "h11" | "h12" | "h23" | "h24"; hourCycle?: "h11" | "h12" | "h23" | "h24";
dayPeriod?: "narrow" | "short" | "long"; dayPeriod?: "narrow" | "short" | "long";
fractionalSecondDigits?: 0 | 1 | 2 | 3; fractionalSecondDigits?: 1 | 2 | 3;
} }
/** /**

View file

@ -23,4 +23,5 @@ and limitations under the License.
/// <reference lib="es2022.error" /> /// <reference lib="es2022.error" />
/// <reference lib="es2022.intl" /> /// <reference lib="es2022.intl" />
/// <reference lib="es2022.object" /> /// <reference lib="es2022.object" />
/// <reference lib="es2022.sharedmemory" />
/// <reference lib="es2022.string" /> /// <reference lib="es2022.string" />

View file

@ -19,11 +19,11 @@ and limitations under the License.
interface ErrorOptions { interface ErrorOptions {
cause?: Error; cause?: unknown;
} }
interface Error { interface Error {
cause?: Error; cause?: unknown;
} }
interface ErrorConstructor { interface ErrorConstructor {

27
cli/dts/lib.es2022.sharedmemory.d.ts vendored Normal file
View file

@ -0,0 +1,27 @@
/*! *****************************************************************************
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"/>
interface Atomics {
/**
* A non-blocking, asynchronous version of wait which is usable on the main thread.
* Waits asynchronously on a shared memory location and returns a Promise
*/
waitAsync(typedArray: BigInt64Array | Int32Array, index: number, value: bigint, timeout?: number): { async: false, value: "ok" | "not-equal" | "timed-out" } | { async: true, value: Promise<"ok" | "not-equal" | "timed-out"> };
}

14
cli/dts/lib.es5.d.ts vendored
View file

@ -933,12 +933,24 @@ interface DateConstructor {
declare var Date: DateConstructor; declare var Date: DateConstructor;
interface RegExpMatchArray extends Array<string> { interface RegExpMatchArray extends Array<string> {
/**
* The index of the search at which the result was found.
*/
index?: number; index?: number;
/**
* A copy of the search string.
*/
input?: string; input?: string;
} }
interface RegExpExecArray extends Array<string> { interface RegExpExecArray extends Array<string> {
/**
* The index of the search at which the result was found.
*/
index: number; index: number;
/**
* A copy of the search string.
*/
input: string; input: string;
} }
@ -1584,7 +1596,7 @@ type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
/** /**
* Exclude null and undefined from T * Exclude null and undefined from T
*/ */
type NonNullable<T> = T extends null | undefined ? never : T; type NonNullable<T> = T & {};
/** /**
* Obtain the parameters of a function type in a tuple * Obtain the parameters of a function type in a tuple

View file

@ -19,8 +19,12 @@ and limitations under the License.
declare namespace Intl { declare namespace Intl {
interface NumberRangeFormatPart extends NumberFormatPart {
source: "startRange" | "endRange" | "shared"
}
interface NumberFormat { interface NumberFormat {
formatRange(start: number | bigint, end: number | bigint): string; formatRange(start: number | bigint, end: number | bigint): string;
formatRangeToParts(start: number | bigint, end: number | bigint): NumberFormatPart[]; formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[];
} }
} }

View file

@ -271,6 +271,10 @@ interface IDBObjectStoreParameters {
keyPath?: string | string[] | null; keyPath?: string | string[] | null;
} }
interface IDBTransactionOptions {
durability?: IDBTransactionDurability;
}
interface IDBVersionChangeEventInit extends EventInit { interface IDBVersionChangeEventInit extends EventInit {
newVersion?: number | null; newVersion?: number | null;
oldVersion?: number; oldVersion?: number;
@ -496,12 +500,12 @@ interface RTCEncodedVideoFrameMetadata {
width?: number; width?: number;
} }
interface ReadableStreamDefaultReadDoneResult { interface ReadableStreamReadDoneResult {
done: true; done: true;
value?: undefined; value?: undefined;
} }
interface ReadableStreamDefaultReadValueResult<T> { interface ReadableStreamReadValueResult<T> {
done: false; done: false;
value: T; value: T;
} }
@ -1004,6 +1008,7 @@ declare var CustomEvent: {
/** An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. */ /** 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 extends Error { interface DOMException extends Error {
/** @deprecated */
readonly code: number; readonly code: number;
readonly message: string; readonly message: string;
readonly name: string; readonly name: string;
@ -1466,7 +1471,7 @@ declare var EventTarget: {
/** Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries. */ /** Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries. */
interface ExtendableEvent extends Event { interface ExtendableEvent extends Event {
waitUntil(f: any): void; waitUntil(f: Promise<any>): void;
} }
declare var ExtendableEvent: { declare var ExtendableEvent: {
@ -1801,7 +1806,7 @@ interface IDBDatabase extends EventTarget {
*/ */
deleteObjectStore(name: string): void; deleteObjectStore(name: string): void;
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */ /** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction; transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@ -2287,7 +2292,6 @@ interface NavigatorID {
readonly appName: string; readonly appName: string;
/** @deprecated */ /** @deprecated */
readonly appVersion: string; readonly appVersion: string;
/** @deprecated */
readonly platform: string; readonly platform: string;
/** @deprecated */ /** @deprecated */
readonly product: string; readonly product: string;
@ -2304,10 +2308,6 @@ interface NavigatorLocks {
readonly locks: LockManager; readonly locks: LockManager;
} }
interface NavigatorNetworkInformation {
readonly connection: NetworkInformation;
}
interface NavigatorOnLine { interface NavigatorOnLine {
readonly onLine: boolean; readonly onLine: boolean;
} }
@ -2317,15 +2317,6 @@ interface NavigatorStorage {
readonly storage: StorageManager; readonly storage: StorageManager;
} }
interface NetworkInformation extends EventTarget {
readonly type: ConnectionType;
}
declare var NetworkInformation: {
prototype: NetworkInformation;
new(): NetworkInformation;
};
interface NotificationEventMap { interface NotificationEventMap {
"click": Event; "click": Event;
"close": Event; "close": Event;
@ -2658,6 +2649,7 @@ declare var PushMessageData: {
*/ */
interface PushSubscription { interface PushSubscription {
readonly endpoint: string; readonly endpoint: string;
readonly expirationTime: EpochTimeStamp | null;
readonly options: PushSubscriptionOptions; readonly options: PushSubscriptionOptions;
getKey(name: PushEncryptionKeyName): ArrayBuffer | null; getKey(name: PushEncryptionKeyName): ArrayBuffer | null;
toJSON(): PushSubscriptionJSON; toJSON(): PushSubscriptionJSON;
@ -2702,6 +2694,19 @@ declare var RTCEncodedVideoFrame: {
new(): RTCEncodedVideoFrame; new(): RTCEncodedVideoFrame;
}; };
interface ReadableByteStreamController {
readonly byobRequest: ReadableStreamBYOBRequest | null;
readonly desiredSize: number | null;
close(): void;
enqueue(chunk: ArrayBufferView): void;
error(e?: any): void;
}
declare var ReadableByteStreamController: {
prototype: ReadableByteStreamController;
new(): ReadableByteStreamController;
};
/** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */ /** This Streams API interface represents a readable stream of byte data. The Fetch API offers a concrete instance of a ReadableStream through the body property of a Response object. */
interface ReadableStream<R = any> { interface ReadableStream<R = any> {
readonly locked: boolean; readonly locked: boolean;
@ -2717,6 +2722,27 @@ declare var ReadableStream: {
new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>; new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
}; };
interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
read(view: ArrayBufferView): Promise<ReadableStreamReadResult<ArrayBufferView>>;
releaseLock(): void;
}
declare var ReadableStreamBYOBReader: {
prototype: ReadableStreamBYOBReader;
new(stream: ReadableStream): ReadableStreamBYOBReader;
};
interface ReadableStreamBYOBRequest {
readonly view: ArrayBufferView | null;
respond(bytesWritten: number): void;
respondWithNewView(view: ArrayBufferView): void;
}
declare var ReadableStreamBYOBRequest: {
prototype: ReadableStreamBYOBRequest;
new(): ReadableStreamBYOBRequest;
};
interface ReadableStreamDefaultController<R = any> { interface ReadableStreamDefaultController<R = any> {
readonly desiredSize: number | null; readonly desiredSize: number | null;
close(): void; close(): void;
@ -2730,7 +2756,7 @@ declare var ReadableStreamDefaultController: {
}; };
interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader { interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
read(): Promise<ReadableStreamDefaultReadResult<R>>; read(): Promise<ReadableStreamReadResult<R>>;
releaseLock(): void; releaseLock(): void;
} }
@ -2899,6 +2925,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
onnotificationclose: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null; onnotificationclose: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;
onpush: ((this: ServiceWorkerGlobalScope, ev: PushEvent) => any) | null; onpush: ((this: ServiceWorkerGlobalScope, ev: PushEvent) => any) | null;
readonly registration: ServiceWorkerRegistration; readonly registration: ServiceWorkerRegistration;
readonly serviceWorker: ServiceWorker;
skipWaiting(): Promise<void>; skipWaiting(): Promise<void>;
addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener<K extends keyof ServiceWorkerGlobalScopeEventMap>(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@ -2981,11 +3008,11 @@ declare var StorageManager: {
* Available only in secure contexts. * Available only in secure contexts.
*/ */
interface SubtleCrypto { interface SubtleCrypto {
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>; decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>; deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>; deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>; digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>; encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>; exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>; exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>; generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
@ -5278,8 +5305,8 @@ interface WindowOrWorkerGlobalScope {
readonly performance: Performance; readonly performance: Performance;
atob(data: string): string; atob(data: string): string;
btoa(data: string): string; btoa(data: string): string;
clearInterval(id?: number): void; clearInterval(id: number | undefined): void;
clearTimeout(id?: number): void; clearTimeout(id: number | undefined): void;
createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>; createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>; createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>; fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
@ -5371,7 +5398,7 @@ declare var WorkerLocation: {
}; };
/** A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator. */ /** A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator. */
interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorNetworkInformation, NavigatorOnLine, NavigatorStorage { interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorStorage {
readonly mediaCapabilities: MediaCapabilities; readonly mediaCapabilities: MediaCapabilities;
} }
@ -5395,6 +5422,7 @@ declare var WritableStream: {
/** This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */ /** This Streams API interface represents a controller allowing control of a WritableStream's state. When constructing a WritableStream, the underlying sink is given a corresponding WritableStreamDefaultController instance to manipulate. */
interface WritableStreamDefaultController { interface WritableStreamDefaultController {
readonly signal: AbortSignal;
error(e?: any): void; error(e?: any): void;
} }
@ -5818,8 +5846,8 @@ declare var origin: string;
declare var performance: Performance; declare var performance: Performance;
declare function atob(data: string): string; declare function atob(data: string): string;
declare function btoa(data: string): string; declare function btoa(data: string): string;
declare function clearInterval(id?: number): void; declare function clearInterval(id: number | undefined): void;
declare function clearTimeout(id?: number): void; declare function clearTimeout(id: number | undefined): void;
declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>; declare function createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>; declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>; declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
@ -5859,7 +5887,7 @@ type GLsizeiptr = number;
type GLuint = number; type GLuint = number;
type GLuint64 = number; type GLuint64 = number;
type HashAlgorithmIdentifier = AlgorithmIdentifier; type HashAlgorithmIdentifier = AlgorithmIdentifier;
type HeadersInit = string[][] | Record<string, string> | Headers; type HeadersInit = [string, string][] | Record<string, string> | Headers;
type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[]; type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[];
type ImageBitmapSource = CanvasImageSource | Blob | ImageData; type ImageBitmapSource = CanvasImageSource | Blob | ImageData;
type Int32List = Int32Array | GLint[]; type Int32List = Int32Array | GLint[];
@ -5869,7 +5897,7 @@ type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
type PerformanceEntryList = PerformanceEntry[]; type PerformanceEntryList = PerformanceEntry[];
type PushMessageDataInit = BufferSource | string; type PushMessageDataInit = BufferSource | string;
type ReadableStreamController<T> = ReadableStreamDefaultController<T>; type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult; type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult;
type ReadableStreamReader<T> = ReadableStreamDefaultReader<T>; type ReadableStreamReader<T> = ReadableStreamDefaultReader<T>;
type RequestInfo = Request | string; type RequestInfo = Request | string;
type TexImageSource = ImageBitmap | ImageData | OffscreenCanvas; type TexImageSource = ImageBitmap | ImageData | OffscreenCanvas;
@ -5882,7 +5910,6 @@ type BinaryType = "arraybuffer" | "blob";
type ClientTypes = "all" | "sharedworker" | "window" | "worker"; type ClientTypes = "all" | "sharedworker" | "window" | "worker";
type ColorGamut = "p3" | "rec2020" | "srgb"; type ColorGamut = "p3" | "rec2020" | "srgb";
type ColorSpaceConversion = "default" | "none"; type ColorSpaceConversion = "default" | "none";
type ConnectionType = "bluetooth" | "cellular" | "ethernet" | "mixed" | "none" | "other" | "unknown" | "wifi";
type DocumentVisibilityState = "hidden" | "visible"; type DocumentVisibilityState = "hidden" | "visible";
type EndingType = "native" | "transparent"; type EndingType = "native" | "transparent";
type FileSystemHandleKind = "directory" | "file"; type FileSystemHandleKind = "directory" | "file";

View file

@ -59,7 +59,7 @@ interface Headers {
interface IDBDatabase { interface IDBDatabase {
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */ /** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction; transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
} }
interface IDBObjectStore { interface IDBObjectStore {

File diff suppressed because it is too large Load diff

View file

@ -3775,7 +3775,7 @@ mod tests {
// You might have found this assertion starts failing after upgrading TypeScript. // You might have found this assertion starts failing after upgrading TypeScript.
// Just update the new number of assets (declaration files) for this number. // Just update the new number of assets (declaration files) for this number.
assert_eq!(assets.len(), 69); assert_eq!(assets.len(), 70);
// get some notification when the size of the assets grows // get some notification when the size of the assets grows
let mut total_size = 0; let mut total_size = 0;

View file

@ -72,53 +72,6 @@
"fixId": "fixMissingImport" "fixId": "fixMissingImport"
} }
}, },
{
"title": "Add missing function declaration 'abc'",
"kind": "quickfix",
"diagnostics": [
{
"range": {
"start": {
"line": 1,
"character": 12
},
"end": {
"line": 1,
"character": 15
}
},
"severity": 1,
"code": 2304,
"source": "deno-ts",
"message": "Cannot find name 'abc'."
}
],
"edit": {
"documentChanges": [
{
"textDocument": {
"uri": "file:///a/file01.ts",
"version": 1
},
"edits": [
{
"range": {
"start": {
"line": 3,
"character": 0
},
"end": {
"line": 3,
"character": 0
}
},
"newText": "\nfunction abc(abc: any) {\nthrow new Error(\"Function not implemented.\");\n}\n"
}
]
}
]
}
},
{ {
"title": "Add import from \"./file00.ts\"", "title": "Add import from \"./file00.ts\"",
"kind": "quickfix", "kind": "quickfix",
@ -165,78 +118,5 @@
} }
] ]
} }
},
{
"title": "Add missing function declaration 'def'",
"kind": "quickfix",
"diagnostics": [
{
"range": {
"start": {
"line": 2,
"character": 12
},
"end": {
"line": 2,
"character": 15
}
},
"severity": 1,
"code": 2304,
"source": "deno-ts",
"message": "Cannot find name 'def'."
}
],
"edit": {
"documentChanges": [
{
"textDocument": {
"uri": "file:///a/file01.ts",
"version": 1
},
"edits": [
{
"range": {
"start": {
"line": 3,
"character": 0
},
"end": {
"line": 3,
"character": 0
}
},
"newText": "\nfunction def(def: any) {\nthrow new Error(\"Function not implemented.\");\n}\n"
}
]
}
]
}
},
{
"title": "Add all missing function declarations",
"kind": "quickfix",
"diagnostics": [
{
"range": {
"start": {
"line": 1,
"character": 12
},
"end": {
"line": 1,
"character": 15
}
},
"severity": 1,
"code": 2304,
"source": "deno-ts",
"message": "Cannot find name 'abc'."
}
],
"data": {
"specifier": "file:///a/file01.ts",
"fixId": "fixMissingFunctionDeclaration"
}
} }
] ]

View file

@ -1,3 +1,3 @@
{ {
"importMap": "import-map.json" "importMap": "import-map.json"
} }

View file

@ -1918,7 +1918,7 @@ Deno.test(function inspectErrorCircular() {
cause: new Error("This is a cause error"), cause: new Error("This is a cause error"),
}); });
error1.cause = error1; error1.cause = error1;
assert(error2.cause); assert(error2.cause instanceof Error);
error2.cause.cause = error2; error2.cause.cause = error2;
assertStringIncludes( assertStringIncludes(

View file

@ -1214,7 +1214,9 @@ Deno.test(
async function client() { async function client() {
const socket = new WebSocket(`ws://${hostname}:${port}/`); const socket = new WebSocket(`ws://${hostname}:${port}/`);
socket.onopen = () => socket.send("bla bla"); socket.onopen = () => socket.send("bla bla");
const { data } = await new Promise((res) => socket.onmessage = res); const { data } = await new Promise<MessageEvent<string>>((res) =>
socket.onmessage = res
);
assertStrictEquals(data, "bla bla"); assertStrictEquals(data, "bla bla");
socket.close(); socket.close();
} }

13688
cli/tsc/00_typescript.js vendored

File diff suppressed because it is too large Load diff