1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -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 lib="dom.extras" />
/////////////////////////////
/// Window APIs
@ -590,6 +590,10 @@ interface IDBObjectStoreParameters {
keyPath?: string | string[] | null;
}
interface IDBTransactionOptions {
durability?: IDBTransactionDurability;
}
interface IDBVersionChangeEventInit extends EventInit {
newVersion?: number | null;
oldVersion?: number;
@ -721,19 +725,6 @@ interface LockOptions {
steal?: boolean;
}
interface MIDIConnectionEventInit extends EventInit {
port?: MIDIPort;
}
interface MIDIMessageEventInit extends EventInit {
data?: Uint8Array;
}
interface MIDIOptions {
software?: boolean;
sysex?: boolean;
}
interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo {
configuration?: MediaDecodingConfiguration;
}
@ -1514,12 +1505,12 @@ interface RTCTransportStats extends RTCStats {
tlsVersion?: string;
}
interface ReadableStreamDefaultReadDoneResult {
interface ReadableStreamReadDoneResult {
done: true;
value?: undefined;
}
interface ReadableStreamDefaultReadValueResult<T> {
interface ReadableStreamReadValueResult<T> {
done: false;
value: T;
}
@ -1815,6 +1806,19 @@ interface UnderlyingSource<R = any> {
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 {
fullRange?: boolean;
matrix?: VideoMatrixCoefficients;
@ -2191,6 +2195,7 @@ declare var AudioBufferSourceNode: {
/** An audio-processing graph built from audio modules linked together, each represented by an AudioNode. */
interface AudioContext extends BaseAudioContext {
readonly baseLatency: number;
readonly outputLatency: number;
close(): Promise<void>;
createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;
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. */
interface CSSConditionRule extends CSSGroupingRule {
conditionText: string;
readonly conditionText: string;
}
declare var CSSConditionRule: {
@ -2853,7 +2858,6 @@ interface CSSStyleDeclaration {
columns: string;
contain: string;
content: string;
contentVisibility: string;
counterIncrement: string;
counterReset: string;
counterSet: string;
@ -3227,6 +3231,8 @@ interface CSSStyleDeclaration {
/** @deprecated This is a legacy alias of `perspectiveOrigin`. */
webkitPerspectiveOrigin: string;
webkitTextFillColor: string;
/** @deprecated This is a legacy alias of `textSizeAdjust`. */
webkitTextSizeAdjust: string;
webkitTextStroke: string;
webkitTextStrokeColor: string;
webkitTextStrokeWidth: string;
@ -3294,6 +3300,8 @@ interface CSSStyleSheet extends StyleSheet {
insertRule(rule: string, index?: number): number;
/** @deprecated */
removeRule(index?: number): void;
replace(text: string): Promise<CSSStyleSheet>;
replaceSync(text: string): void;
}
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. */
interface DOMException extends Error {
/** @deprecated */
readonly code: number;
readonly message: string;
readonly name: string;
@ -4521,8 +4530,6 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent;
createEvent(eventInterface: "InputEvent"): InputEvent;
createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent;
createEvent(eventInterface: "MIDIConnectionEvent"): MIDIConnectionEvent;
createEvent(eventInterface: "MIDIMessageEvent"): MIDIMessageEvent;
createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent;
createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent;
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.
*/
readonly activeElement: Element | null;
adoptedStyleSheets: CSSStyleSheet[];
/** Returns document's fullscreen element. */
readonly fullscreenElement: Element | null;
readonly pictureInPictureElement: Element | null;
@ -4981,14 +4989,24 @@ interface ElementInternals extends ARIAMixin {
readonly labels: NodeList;
/** Returns the ShadowRoot for internals's target element, if the target element is a shadow host, or null otherwise. */
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. */
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.
*
* If value is null, the element won't participate in form submission.
*/
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: {
@ -6072,7 +6090,6 @@ declare var HTMLBaseElement: {
};
interface HTMLBodyElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap {
"orientationchange": Event;
}
/** 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 */
link: string;
/** @deprecated */
onorientationchange: ((this: HTMLBodyElement, ev: Event) => any) | null;
/** @deprecated */
text: string;
/** @deprecated */
vLink: string;
@ -6346,6 +6361,7 @@ interface HTMLElement extends Element, DocumentAndElementEventHandlers, ElementC
dir: string;
draggable: boolean;
hidden: boolean;
inert: boolean;
innerText: string;
lang: string;
readonly offsetHeight: number;
@ -7009,6 +7025,7 @@ interface HTMLInputElement extends HTMLElement {
* @param direction The direction in which the selection is performed.
*/
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.
* @param n Value to decrement the value by.
@ -7236,6 +7253,7 @@ interface HTMLMediaElement extends HTMLElement {
readonly played: TimeRanges;
/** Gets or sets a value indicating what data should be preloaded, if any. */
preload: "none" | "metadata" | "auto" | "";
preservesPitch: boolean;
readonly readyState: number;
readonly remote: RemotePlayback;
/** 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;
};
/** 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 {
/** 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;
/**
* Sets or retrieves the content type of the resource designated by the value attribute.
* @deprecated
*/
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;
/**
* 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;
}
/** @deprecated */
declare var HTMLParamElement: {
prototype: HTMLParamElement;
new(): HTMLParamElement;
@ -8517,7 +8545,7 @@ interface IDBDatabase extends EventTarget {
*/
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. */
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(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;
@ -9103,126 +9131,6 @@ declare var 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 {
}
@ -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. */
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. */
readonly clipboard: Clipboard;
/** Available only in secure contexts. */
@ -9944,8 +9852,6 @@ interface Navigator extends NavigatorAutomationInformation, NavigatorConcurrentH
canShare(data?: ShareData): boolean;
getGamepads(): (Gamepad | null)[];
/** Available only in secure contexts. */
requestMIDIAccess(options?: MIDIOptions): Promise<MIDIAccess>;
/** Available only in secure contexts. */
requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise<MediaKeySystemAccess>;
sendBeacon(url: string | URL, data?: BodyInit | null): boolean;
/** Available only in secure contexts. */
@ -9982,7 +9888,6 @@ interface NavigatorID {
readonly appName: string;
/** @deprecated */
readonly appVersion: string;
/** @deprecated */
readonly platform: string;
/** @deprecated */
readonly product: string;
@ -10004,10 +9909,6 @@ interface NavigatorLocks {
readonly locks: LockManager;
}
interface NavigatorNetworkInformation {
readonly connection: NetworkInformation;
}
interface NavigatorOnLine {
readonly onLine: boolean;
}
@ -10027,15 +9928,6 @@ interface NavigatorStorage {
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. */
interface Node extends EventTarget {
/** Returns node's node document's document base URL. */
@ -10994,6 +10886,7 @@ declare var PushManager: {
*/
interface PushSubscription {
readonly endpoint: string;
readonly expirationTime: EpochTimeStamp | null;
readonly options: PushSubscriptionOptions;
getKey(name: PushEncryptionKeyName): ArrayBuffer | null;
toJSON(): PushSubscriptionJSON;
@ -11475,6 +11368,19 @@ declare var Range: {
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. */
interface ReadableStream<R = any> {
readonly locked: boolean;
@ -11490,6 +11396,27 @@ declare var ReadableStream: {
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> {
readonly desiredSize: number | null;
close(): void;
@ -11503,7 +11430,7 @@ declare var ReadableStreamDefaultController: {
};
interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
read(): Promise<ReadableStreamDefaultReadResult<R>>;
read(): Promise<ReadableStreamReadResult<R>>;
releaseLock(): void;
}
@ -11627,7 +11554,6 @@ interface Response extends Body {
declare var Response: {
prototype: Response;
new(body?: BodyInit | null, init?: ResponseInit): Response;
json(data: unknown, init?: ResponseInit): Response;
error(): Response;
redirect(url: string | URL, status?: number): Response;
};
@ -13922,11 +13848,11 @@ declare var SubmitEvent: {
* Available only in secure contexts.
*/
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>;
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>;
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: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
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. */
readonly toolbar: BarProp;
readonly top: WindowProxy | null;
readonly visualViewport: VisualViewport;
readonly visualViewport: VisualViewport | null;
readonly window: Window & typeof globalThis;
alert(message?: any): void;
blur(): void;
@ -16803,8 +16729,8 @@ interface WindowOrWorkerGlobalScope {
readonly performance: Performance;
atob(data: string): string;
btoa(data: string): string;
clearInterval(id?: number): void;
clearTimeout(id?: number): void;
clearInterval(id: number | undefined): void;
clearTimeout(id: number | undefined): void;
createImageBitmap(image: ImageBitmapSource, 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>;
@ -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. */
interface WritableStreamDefaultController {
readonly signal: AbortSignal;
error(e?: any): void;
}
@ -17494,7 +17421,6 @@ interface HTMLElementTagNameMap {
"details": HTMLDetailsElement;
"dfn": HTMLElement;
"dialog": HTMLDialogElement;
"dir": HTMLDirectoryElement;
"div": HTMLDivElement;
"dl": HTMLDListElement;
"dt": HTMLElement;
@ -17503,11 +17429,8 @@ interface HTMLElementTagNameMap {
"fieldset": HTMLFieldSetElement;
"figcaption": HTMLElement;
"figure": HTMLElement;
"font": HTMLFontElement;
"footer": HTMLElement;
"form": HTMLFormElement;
"frame": HTMLFrameElement;
"frameset": HTMLFrameSetElement;
"h1": HTMLHeadingElement;
"h2": HTMLHeadingElement;
"h3": HTMLHeadingElement;
@ -17532,7 +17455,6 @@ interface HTMLElementTagNameMap {
"main": HTMLElement;
"map": HTMLMapElement;
"mark": HTMLElement;
"marquee": HTMLMarqueeElement;
"menu": HTMLMenuElement;
"meta": HTMLMetaElement;
"meter": HTMLMeterElement;
@ -17544,7 +17466,6 @@ interface HTMLElementTagNameMap {
"option": HTMLOptionElement;
"output": HTMLOutputElement;
"p": HTMLParagraphElement;
"param": HTMLParamElement;
"picture": HTMLPictureElement;
"pre": HTMLPreElement;
"progress": HTMLProgressElement;
@ -17586,7 +17507,34 @@ interface HTMLElementTagNameMap {
}
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;
"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;
}
@ -17735,7 +17683,7 @@ declare var statusbar: BarProp;
/** Returns true if the toolbar is visible; otherwise, returns false. */
declare var toolbar: BarProp;
declare var top: WindowProxy | null;
declare var visualViewport: VisualViewport;
declare var visualViewport: VisualViewport | null;
declare var window: Window & typeof globalThis;
declare function alert(message?: any): void;
declare function blur(): void;
@ -18089,8 +18037,8 @@ declare var origin: string;
declare var performance: Performance;
declare function atob(data: string): string;
declare function btoa(data: string): string;
declare function clearInterval(id?: number): void;
declare function clearTimeout(id?: number): void;
declare function clearInterval(id: number | undefined): void;
declare function clearTimeout(id: number | undefined): void;
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 fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
@ -18139,7 +18087,7 @@ type GLuint64 = number;
type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement;
type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement;
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 ImageBitmapSource = CanvasImageSource | Blob | ImageData;
type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend";
@ -18153,7 +18101,7 @@ type OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null;
type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
type PerformanceEntryList = PerformanceEntry[];
type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult;
type ReadableStreamReader<T> = ReadableStreamDefaultReader<T>;
type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
type RequestInfo = Request | string;
@ -18197,11 +18145,10 @@ type ColorGamut = "p3" | "rec2020" | "srgb";
type ColorSpaceConversion = "default" | "none";
type CompositeOperation = "accumulate" | "add" | "replace";
type CompositeOperationOrAuto = "accumulate" | "add" | "auto" | "replace";
type ConnectionType = "bluetooth" | "cellular" | "ethernet" | "mixed" | "none" | "other" | "unknown" | "wifi";
type CredentialMediationRequirement = "optional" | "required" | "silent";
type DOMParserSupportedType = "application/xhtml+xml" | "application/xml" | "image/svg+xml" | "text/html" | "text/xml";
type DirectionSetting = "" | "lr" | "rl";
type DisplayCaptureSurfaceType = "application" | "browser" | "monitor" | "window";
type DisplayCaptureSurfaceType = "browser" | "monitor" | "window";
type DistanceModelType = "exponential" | "inverse" | "linear";
type DocumentReadyState = "complete" | "interactive" | "loading";
type DocumentVisibilityState = "hidden" | "visible";
@ -18228,9 +18175,6 @@ type KeyType = "private" | "public" | "secret";
type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
type LineAlignSetting = "center" | "end" | "start";
type LockMode = "exclusive" | "shared";
type MIDIPortConnectionState = "closed" | "open" | "pending";
type MIDIPortDeviceState = "connected" | "disconnected";
type MIDIPortType = "input" | "output";
type MediaDecodingType = "file" | "media-source" | "webrtc";
type MediaDeviceKind = "audioinput" | "audiooutput" | "videoinput";
type MediaEncodingType = "record" | "webrtc";

View file

@ -121,7 +121,7 @@ interface Headers {
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. */
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
}
interface IDBObjectStore {
@ -133,16 +133,6 @@ interface IDBObjectStore {
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 {
[Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>;
entries(): IterableIterator<[BufferSource, MediaKeyStatus]>;

View file

@ -19,18 +19,38 @@ and limitations under the License.
interface Map<K, V> {
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;
/**
* 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;
/**
* 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;
/**
* @returns boolean indicating whether an element with the specified key exists or not.
*/
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;
/**
* @returns the number of elements in the Map.
*/
readonly size: number;
}
interface MapConstructor {
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>;
}
declare var Map: MapConstructor;
@ -43,9 +63,23 @@ interface ReadonlyMap<K, 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;
/**
* @returns a specified element.
*/
get(key: K): V | undefined;
/**
* @returns a boolean indicating whether an element with the specified key exists or not.
*/
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;
}
@ -56,11 +90,28 @@ interface WeakMapConstructor {
declare var WeakMap: WeakMapConstructor;
interface Set<T> {
/**
* Appends a new element with a specified value to the end of the Set.
*/
add(value: T): this;
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;
/**
* 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;
/**
* @returns a boolean indicating whether an element with the specified value exists in the Set or not.
*/
has(value: T): boolean;
/**
* @returns the number of (unique) elements in Set.
*/
readonly size: number;
}
@ -77,8 +128,18 @@ interface ReadonlySet<T> {
}
interface WeakSet<T extends object> {
/**
* Appends a new object to the end of the WeakSet.
*/
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;
/**
* @returns a boolean indicating whether an object exists in the WeakSet or not.
*/
has(value: T): boolean;
}

View file

@ -19,23 +19,112 @@ and limitations under the License.
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;
/**
* 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;
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;
/**
* 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;
/**
* 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;
/**
* A trap for the `[[GetPrototypeOf]]` internal method.
* @param target The original object which is being proxied.
*/
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;
/**
* A trap for `Object.isExtensible()`.
* @param target The original object which is being proxied.
*/
isExtensible?(target: T): boolean;
/**
* A trap for `Reflect.ownKeys()`.
* @param target The original object which is being proxied.
*/
ownKeys?(target: T): ArrayLike<string | symbol>;
/**
* A trap for `Object.preventExtensions()`.
* @param target The original object which is being proxied.
*/
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;
}
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; };
/**
* 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;
}
declare var Proxy: ProxyConstructor;

View file

@ -19,7 +19,22 @@ and limitations under the License.
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 {
type: DateTimeFormatPartTypes;

View file

@ -18,6 +18,7 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference lib="es2018.intl" />
declare namespace Intl {
/**
@ -50,6 +51,25 @@ declare namespace Intl {
| "second"
| "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.
*
@ -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).
*/
interface RelativeTimeFormatPart {
type: string;
value: string;
unit?: RelativeTimeFormatUnit;
}
type RelativeTimeFormatPart =
| {
type: "literal";
value: string;
}
| {
type: Exclude<NumberFormatPartTypes, "literal">;
value: string;
unit: RelativeTimeFormatUnitSingular;
};
interface RelativeTimeFormat {
/**

View file

@ -20,17 +20,25 @@ and limitations under the License.
declare namespace Intl {
interface DateTimeFormatPartTypesRegistry {
fractionalSecond: any
}
interface DateTimeFormatOptions {
formatMatcher?: "basic" | "best fit" | "best fit" | undefined;
dateStyle?: "full" | "long" | "medium" | "short" | undefined;
timeStyle?: "full" | "long" | "medium" | "short" | 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 {
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 {
@ -39,7 +47,7 @@ declare namespace Intl {
timeStyle?: "full" | "long" | "medium" | "short";
hourCycle?: "h11" | "h12" | "h23" | "h24";
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.intl" />
/// <reference lib="es2022.object" />
/// <reference lib="es2022.sharedmemory" />
/// <reference lib="es2022.string" />

View file

@ -19,11 +19,11 @@ and limitations under the License.
interface ErrorOptions {
cause?: Error;
cause?: unknown;
}
interface Error {
cause?: Error;
cause?: unknown;
}
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;
interface RegExpMatchArray extends Array<string> {
/**
* The index of the search at which the result was found.
*/
index?: number;
/**
* A copy of the search string.
*/
input?: string;
}
interface RegExpExecArray extends Array<string> {
/**
* The index of the search at which the result was found.
*/
index: number;
/**
* A copy of the search 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
*/
type NonNullable<T> = T extends null | undefined ? never : T;
type NonNullable<T> = T & {};
/**
* Obtain the parameters of a function type in a tuple

View file

@ -19,8 +19,12 @@ and limitations under the License.
declare namespace Intl {
interface NumberRangeFormatPart extends NumberFormatPart {
source: "startRange" | "endRange" | "shared"
}
interface NumberFormat {
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;
}
interface IDBTransactionOptions {
durability?: IDBTransactionDurability;
}
interface IDBVersionChangeEventInit extends EventInit {
newVersion?: number | null;
oldVersion?: number;
@ -496,12 +500,12 @@ interface RTCEncodedVideoFrameMetadata {
width?: number;
}
interface ReadableStreamDefaultReadDoneResult {
interface ReadableStreamReadDoneResult {
done: true;
value?: undefined;
}
interface ReadableStreamDefaultReadValueResult<T> {
interface ReadableStreamReadValueResult<T> {
done: false;
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. */
interface DOMException extends Error {
/** @deprecated */
readonly code: number;
readonly message: 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. */
interface ExtendableEvent extends Event {
waitUntil(f: any): void;
waitUntil(f: Promise<any>): void;
}
declare var ExtendableEvent: {
@ -1801,7 +1806,7 @@ interface IDBDatabase extends EventTarget {
*/
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. */
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(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;
@ -2287,7 +2292,6 @@ interface NavigatorID {
readonly appName: string;
/** @deprecated */
readonly appVersion: string;
/** @deprecated */
readonly platform: string;
/** @deprecated */
readonly product: string;
@ -2304,10 +2308,6 @@ interface NavigatorLocks {
readonly locks: LockManager;
}
interface NavigatorNetworkInformation {
readonly connection: NetworkInformation;
}
interface NavigatorOnLine {
readonly onLine: boolean;
}
@ -2317,15 +2317,6 @@ interface NavigatorStorage {
readonly storage: StorageManager;
}
interface NetworkInformation extends EventTarget {
readonly type: ConnectionType;
}
declare var NetworkInformation: {
prototype: NetworkInformation;
new(): NetworkInformation;
};
interface NotificationEventMap {
"click": Event;
"close": Event;
@ -2658,6 +2649,7 @@ declare var PushMessageData: {
*/
interface PushSubscription {
readonly endpoint: string;
readonly expirationTime: EpochTimeStamp | null;
readonly options: PushSubscriptionOptions;
getKey(name: PushEncryptionKeyName): ArrayBuffer | null;
toJSON(): PushSubscriptionJSON;
@ -2702,6 +2694,19 @@ declare var 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. */
interface ReadableStream<R = any> {
readonly locked: boolean;
@ -2717,6 +2722,27 @@ declare var ReadableStream: {
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> {
readonly desiredSize: number | null;
close(): void;
@ -2730,7 +2756,7 @@ declare var ReadableStreamDefaultController: {
};
interface ReadableStreamDefaultReader<R = any> extends ReadableStreamGenericReader {
read(): Promise<ReadableStreamDefaultReadResult<R>>;
read(): Promise<ReadableStreamReadResult<R>>;
releaseLock(): void;
}
@ -2899,6 +2925,7 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
onnotificationclose: ((this: ServiceWorkerGlobalScope, ev: NotificationEvent) => any) | null;
onpush: ((this: ServiceWorkerGlobalScope, ev: PushEvent) => any) | null;
readonly registration: ServiceWorkerRegistration;
readonly serviceWorker: ServiceWorker;
skipWaiting(): Promise<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;
@ -2981,11 +3008,11 @@ declare var StorageManager: {
* Available only in secure contexts.
*/
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>;
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>;
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: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
@ -5278,8 +5305,8 @@ interface WindowOrWorkerGlobalScope {
readonly performance: Performance;
atob(data: string): string;
btoa(data: string): string;
clearInterval(id?: number): void;
clearTimeout(id?: number): void;
clearInterval(id: number | undefined): void;
clearTimeout(id: number | undefined): void;
createImageBitmap(image: ImageBitmapSource, 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>;
@ -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. */
interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorNetworkInformation, NavigatorOnLine, NavigatorStorage {
interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorStorage {
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. */
interface WritableStreamDefaultController {
readonly signal: AbortSignal;
error(e?: any): void;
}
@ -5818,8 +5846,8 @@ declare var origin: string;
declare var performance: Performance;
declare function atob(data: string): string;
declare function btoa(data: string): string;
declare function clearInterval(id?: number): void;
declare function clearTimeout(id?: number): void;
declare function clearInterval(id: number | undefined): void;
declare function clearTimeout(id: number | undefined): void;
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 fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
@ -5859,7 +5887,7 @@ type GLsizeiptr = number;
type GLuint = number;
type GLuint64 = number;
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 ImageBitmapSource = CanvasImageSource | Blob | ImageData;
type Int32List = Int32Array | GLint[];
@ -5869,7 +5897,7 @@ type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
type PerformanceEntryList = PerformanceEntry[];
type PushMessageDataInit = BufferSource | string;
type ReadableStreamController<T> = ReadableStreamDefaultController<T>;
type ReadableStreamDefaultReadResult<T> = ReadableStreamDefaultReadValueResult<T> | ReadableStreamDefaultReadDoneResult;
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult;
type ReadableStreamReader<T> = ReadableStreamDefaultReader<T>;
type RequestInfo = Request | string;
type TexImageSource = ImageBitmap | ImageData | OffscreenCanvas;
@ -5882,7 +5910,6 @@ type BinaryType = "arraybuffer" | "blob";
type ClientTypes = "all" | "sharedworker" | "window" | "worker";
type ColorGamut = "p3" | "rec2020" | "srgb";
type ColorSpaceConversion = "default" | "none";
type ConnectionType = "bluetooth" | "cellular" | "ethernet" | "mixed" | "none" | "other" | "unknown" | "wifi";
type DocumentVisibilityState = "hidden" | "visible";
type EndingType = "native" | "transparent";
type FileSystemHandleKind = "directory" | "file";

View file

@ -59,7 +59,7 @@ interface Headers {
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. */
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
}
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.
// 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
let mut total_size = 0;

View file

@ -72,53 +72,6 @@
"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\"",
"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"
}
}

View file

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

View file

@ -1214,7 +1214,9 @@ Deno.test(
async function client() {
const socket = new WebSocket(`ws://${hostname}:${port}/`);
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");
socket.close();
}

13688
cli/tsc/00_typescript.js vendored

File diff suppressed because it is too large Load diff