feat: update to TypeScript 4.7 (#14242)

This commit is contained in:
Kitson Kelly 2022-06-01 10:19:18 +10:00 committed by GitHub
parent c41544ac7b
commit 7eee521199
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 24474 additions and 20858 deletions

1
Cargo.lock generated
View file

@ -792,6 +792,7 @@ dependencies = [
"rustyline-derive",
"semver-parser 0.10.2",
"serde",
"serde_repr",
"shell-escape",
"tempfile",
"test_util",

View file

@ -91,6 +91,7 @@ rustyline-derive = "=0.6.0"
secure_tempfile = { version = "=3.3.0", package = "tempfile" } # different name to discourage use in tests
semver-parser = "=0.10.2"
serde = { version = "=1.0.136", features = ["derive"] }
serde_repr = "=0.1.8"
shell-escape = "=0.1.5"
text-size = "=1.1.0"
text_lines = "=0.4.1"

View file

@ -141,7 +141,9 @@ fn create_compiler_snapshot(
"es2019.symbol",
"es2020.bigint",
"es2020",
"es2020.date",
"es2020.intl",
"es2020.number",
"es2020.promise",
"es2020.sharedmemory",
"es2020.string",
@ -154,6 +156,7 @@ fn create_compiler_snapshot(
"es2022",
"es2022.array",
"es2022.error",
"es2022.intl",
"es2022.object",
"es2022.string",
"esnext",

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

@ -721,6 +721,19 @@ 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;
}
@ -951,6 +964,11 @@ interface MutationObserverInit {
subtree?: boolean;
}
interface NavigationPreloadState {
enabled?: boolean;
headerValue?: string;
}
interface NotificationAction {
action: string;
icon?: string;
@ -1263,6 +1281,35 @@ interface RTCDtlsFingerprint {
value?: string;
}
interface RTCEncodedAudioFrameMetadata {
contributingSources?: number[];
synchronizationSource?: number;
}
interface RTCEncodedVideoFrameMetadata {
contributingSources?: number[];
dependencies?: number[];
frameId?: number;
height?: number;
spatialIndex?: number;
synchronizationSource?: number;
temporalIndex?: number;
width?: number;
}
interface RTCErrorEventInit extends EventInit {
error: RTCError;
}
interface RTCErrorInit {
errorDetail: RTCErrorDetailType;
httpRequestStatusCode?: number;
receivedAlert?: number;
sctpCauseCode?: number;
sdpLineNumber?: number;
sentAlert?: number;
}
interface RTCIceCandidateInit {
candidate?: string;
sdpMLineIndex?: number | null;
@ -1768,6 +1815,13 @@ interface UnderlyingSource<R = any> {
type?: undefined;
}
interface VideoColorSpaceInit {
fullRange?: boolean;
matrix?: VideoMatrixCoefficients;
primaries?: VideoColorPrimaries;
transfer?: VideoTransferCharacteristics;
}
interface VideoConfiguration {
bitrate: number;
colorGamut?: ColorGamut;
@ -1780,6 +1834,19 @@ interface VideoConfiguration {
width: number;
}
interface VideoFrameMetadata {
captureTime?: DOMHighResTimeStamp;
expectedDisplayTime: DOMHighResTimeStamp;
height: number;
mediaTime: number;
presentationTime: DOMHighResTimeStamp;
presentedFrames: number;
processingDuration?: number;
receiveTime?: DOMHighResTimeStamp;
rtpTimestamp?: number;
width: number;
}
interface WaveShaperOptions extends AudioNodeOptions {
curve?: number[] | Float32Array;
oversample?: OverSampleType;
@ -1914,6 +1981,8 @@ interface AbortSignal extends EventTarget {
/** Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */
readonly aborted: boolean;
onabort: ((this: AbortSignal, ev: Event) => any) | null;
readonly reason: any;
throwIfAborted(): void;
addEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@ -2409,7 +2478,7 @@ interface Blob {
readonly type: string;
arrayBuffer(): Promise<ArrayBuffer>;
slice(start?: number, end?: number, contentType?: string): Blob;
stream(): ReadableStream;
stream(): ReadableStream<Uint8Array>;
text(): Promise<string>;
}
@ -2784,6 +2853,7 @@ interface CSSStyleDeclaration {
columns: string;
contain: string;
content: string;
contentVisibility: string;
counterIncrement: string;
counterReset: string;
counterSet: string;
@ -2819,7 +2889,6 @@ interface CSSStyleDeclaration {
fontStyle: string;
fontSynthesis: string;
fontVariant: string;
/** @deprecated */
fontVariantAlternates: string;
fontVariantCaps: string;
fontVariantEastAsian: string;
@ -2893,6 +2962,14 @@ interface CSSStyleDeclaration {
markerMid: string;
markerStart: string;
mask: string;
maskClip: string;
maskComposite: string;
maskImage: string;
maskMode: string;
maskOrigin: string;
maskPosition: string;
maskRepeat: string;
maskSize: string;
maskType: string;
maxBlockSize: string;
maxHeight: string;
@ -2906,7 +2983,6 @@ interface CSSStyleDeclaration {
objectFit: string;
objectPosition: string;
offset: string;
offsetAnchor: string;
offsetDistance: string;
offsetPath: string;
offsetRotate: string;
@ -2951,6 +3027,7 @@ interface CSSStyleDeclaration {
placeSelf: string;
pointerEvents: string;
position: string;
printColorAdjust: string;
quotes: string;
resize: string;
right: string;
@ -3251,13 +3328,13 @@ declare var CSSTransition: {
* Available only in secure contexts.
*/
interface Cache {
add(request: RequestInfo): Promise<void>;
add(request: RequestInfo | URL): Promise<void>;
addAll(requests: RequestInfo[]): Promise<void>;
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
keys(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>;
match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>;
matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>;
put(request: RequestInfo, response: Response): Promise<void>;
delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<boolean>;
keys(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>;
match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<Response | undefined>;
matchAll(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>;
put(request: RequestInfo | URL, response: Response): Promise<void>;
}
declare var Cache: {
@ -3273,7 +3350,7 @@ interface CacheStorage {
delete(cacheName: string): Promise<boolean>;
has(cacheName: string): Promise<boolean>;
keys(): Promise<string[]>;
match(request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>;
match(request: RequestInfo | URL, options?: MultiCacheQueryOptions): Promise<Response | undefined>;
open(cacheName: string): Promise<Cache>;
}
@ -3538,6 +3615,7 @@ declare var ClipboardEvent: {
new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;
};
/** Available only in secure contexts. */
interface ClipboardItem {
readonly types: ReadonlyArray<string>;
getType(type: string): Promise<Blob>;
@ -3545,7 +3623,7 @@ interface ClipboardItem {
declare var ClipboardItem: {
prototype: ClipboardItem;
new(items: Record<string, ClipboardItemDataType | PromiseLike<ClipboardItemDataType>>, options?: ClipboardItemOptions): ClipboardItem;
new(items: Record<string, string | Blob | PromiseLike<string | Blob>>, options?: ClipboardItemOptions): ClipboardItem;
};
/** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */
@ -4215,6 +4293,7 @@ declare var DeviceOrientationEvent: {
};
interface DocumentEventMap extends DocumentAndElementEventHandlersEventMap, GlobalEventHandlersEventMap {
"DOMContentLoaded": Event;
"fullscreenchange": Event;
"fullscreenerror": Event;
"pointerlockchange": Event;
@ -4432,6 +4511,8 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent;
createEvent(eventInterface: "DragEvent"): DragEvent;
createEvent(eventInterface: "ErrorEvent"): ErrorEvent;
createEvent(eventInterface: "Event"): Event;
createEvent(eventInterface: "Events"): Event;
createEvent(eventInterface: "FocusEvent"): FocusEvent;
createEvent(eventInterface: "FontFaceSetLoadEvent"): FontFaceSetLoadEvent;
createEvent(eventInterface: "FormDataEvent"): FormDataEvent;
@ -4440,6 +4521,8 @@ 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;
@ -4460,6 +4543,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
createEvent(eventInterface: "PromiseRejectionEvent"): PromiseRejectionEvent;
createEvent(eventInterface: "RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent;
createEvent(eventInterface: "RTCDataChannelEvent"): RTCDataChannelEvent;
createEvent(eventInterface: "RTCErrorEvent"): RTCErrorEvent;
createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent;
createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent;
createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent;
@ -4891,8 +4975,20 @@ interface ElementContentEditable {
}
interface ElementInternals extends ARIAMixin {
/** Returns the form owner of internals's target element. */
readonly form: HTMLFormElement | null;
/** Returns a NodeList of all the label elements that internals's target element is associated with. */
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 true if internals's target element will be validated when the form is submitted; false otherwise. */
readonly willValidate: 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;
}
declare var ElementInternals: {
@ -4966,6 +5062,15 @@ declare var Event: {
readonly NONE: number;
};
interface EventCounts {
forEach(callbackfn: (value: number, key: string, parent: EventCounts) => void, thisArg?: any): void;
}
declare var EventCounts: {
prototype: EventCounts;
new(): EventCounts;
};
interface EventListener {
(evt: Event): void;
}
@ -6159,14 +6264,29 @@ declare var HTMLDetailsElement: {
new(): HTMLDetailsElement;
};
/** @deprecated this is not available in most browsers */
interface HTMLDialogElement extends HTMLElement {
open: boolean;
returnValue: string;
/**
* Closes the dialog element.
*
* The argument, if provided, provides a return value.
*/
close(returnValue?: string): void;
/** Displays the dialog element. */
show(): void;
showModal(): void;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDialogElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLDialogElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var HTMLDialogElement: {
prototype: HTMLDialogElement;
new(): HTMLDialogElement;
};
/** @deprecated */
interface HTMLDirectoryElement extends HTMLElement {
/** @deprecated */
@ -7614,6 +7734,7 @@ interface HTMLScriptElement extends HTMLElement {
declare var HTMLScriptElement: {
prototype: HTMLScriptElement;
new(): HTMLScriptElement;
supports(type: string): boolean;
};
/** A <select> HTML Element. These elements also share all of the properties and methods of other HTML elements via the HTMLElement interface. */
@ -7745,6 +7866,8 @@ declare var HTMLSpanElement: {
/** A <style> element. It inherits properties and methods from its parent, HTMLElement, and from LinkStyle. */
interface HTMLStyleElement extends HTMLElement, LinkStyle {
/** Enables or disables the style sheet. */
disabled: boolean;
/** Sets or retrieves the media type. */
media: string;
/**
@ -8251,8 +8374,10 @@ interface HTMLVideoElement extends HTMLMediaElement {
readonly videoWidth: number;
/** Gets or sets the width of the video element. */
width: number;
cancelVideoFrameCallback(handle: number): void;
getVideoPlaybackQuality(): VideoPlaybackQuality;
requestPictureInPicture(): Promise<PictureInPictureWindow>;
requestVideoFrameCallback(callback: VideoFrameRequestCallback): number;
addEventListener<K extends keyof HTMLVideoElementEventMap>(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLVideoElementEventMap>(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@ -8759,6 +8884,7 @@ declare var ImageBitmapRenderingContext: {
/** The underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */
interface ImageData {
readonly colorSpace: PredefinedColorSpace;
/** Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. */
readonly data: Uint8ClampedArray;
/** Returns the actual dimensions of the data in the ImageData object, in pixels. */
@ -8977,6 +9103,126 @@ 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 {
}
@ -9665,8 +9911,21 @@ declare var NamedNodeMap: {
new(): NamedNodeMap;
};
/** Available only in secure contexts. */
interface NavigationPreloadManager {
disable(): Promise<void>;
enable(): Promise<void>;
getState(): Promise<NavigationPreloadState>;
setHeaderValue(value: string): Promise<void>;
}
declare var NavigationPreloadManager: {
prototype: NavigationPreloadManager;
new(): 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, NavigatorNetworkInformation, NavigatorOnLine, NavigatorPlugins, NavigatorStorage {
interface Navigator extends NavigatorAutomationInformation, NavigatorConcurrentHardware, NavigatorContentUtils, NavigatorCookies, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorNetworkInformation, NavigatorOnLine, NavigatorPlugins, NavigatorStorage {
/** Available only in secure contexts. */
readonly clipboard: Clipboard;
/** Available only in secure contexts. */
@ -9685,6 +9944,8 @@ 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. */
@ -9738,6 +9999,11 @@ interface NavigatorLanguage {
readonly languages: ReadonlyArray<string>;
}
/** Available only in secure contexts. */
interface NavigatorLocks {
readonly locks: LockManager;
}
interface NavigatorNetworkInformation {
readonly connection: NetworkInformation;
}
@ -9749,6 +10015,7 @@ interface NavigatorOnLine {
interface NavigatorPlugins {
/** @deprecated */
readonly mimeTypes: MimeTypeArray;
readonly pdfViewerEnabled: boolean;
/** @deprecated */
readonly plugins: PluginArray;
/** @deprecated */
@ -10256,6 +10523,7 @@ interface PerformanceEventMap {
/** Provides access to performance-related information for the current page. It's part of the High Resolution Time API, but is enhanced by the Performance Timeline API, the Navigation Timing API, the User Timing API, and the Resource Timing API. */
interface Performance extends EventTarget {
readonly eventCounts: EventCounts;
/** @deprecated */
readonly navigation: PerformanceNavigation;
onresourcetimingbufferfull: ((this: Performance, ev: Event) => any) | null;
@ -10367,7 +10635,7 @@ interface PerformanceNavigationTiming extends PerformanceResourceTiming {
readonly loadEventEnd: DOMHighResTimeStamp;
readonly loadEventStart: DOMHighResTimeStamp;
readonly redirectCount: number;
readonly type: NavigationType;
readonly type: NavigationTimingType;
readonly unloadEventEnd: DOMHighResTimeStamp;
readonly unloadEventStart: DOMHighResTimeStamp;
toJSON(): any;
@ -10790,6 +11058,7 @@ declare var RTCDTMFToneChangeEvent: {
interface RTCDataChannelEventMap {
"bufferedamountlow": Event;
"close": Event;
"closing": Event;
"error": Event;
"message": MessageEvent;
"open": Event;
@ -10806,6 +11075,7 @@ interface RTCDataChannel extends EventTarget {
readonly negotiated: boolean;
onbufferedamountlow: ((this: RTCDataChannel, ev: Event) => any) | null;
onclose: ((this: RTCDataChannel, ev: Event) => any) | null;
onclosing: ((this: RTCDataChannel, ev: Event) => any) | null;
onerror: ((this: RTCDataChannel, ev: Event) => any) | null;
onmessage: ((this: RTCDataChannel, ev: MessageEvent) => any) | null;
onopen: ((this: RTCDataChannel, ev: Event) => any) | null;
@ -10838,12 +11108,16 @@ declare var RTCDataChannelEvent: {
};
interface RTCDtlsTransportEventMap {
"error": Event;
"statechange": Event;
}
interface RTCDtlsTransport extends EventTarget {
readonly iceTransport: RTCIceTransport;
onerror: ((this: RTCDtlsTransport, ev: Event) => any) | null;
onstatechange: ((this: RTCDtlsTransport, ev: Event) => any) | null;
readonly state: RTCDtlsTransportState;
getRemoteCertificates(): ArrayBuffer[];
addEventListener<K extends keyof RTCDtlsTransportEventMap>(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof RTCDtlsTransportEventMap>(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@ -10855,6 +11129,51 @@ declare var RTCDtlsTransport: {
new(): RTCDtlsTransport;
};
interface RTCEncodedAudioFrame {
data: ArrayBuffer;
readonly timestamp: number;
getMetadata(): RTCEncodedAudioFrameMetadata;
}
declare var RTCEncodedAudioFrame: {
prototype: RTCEncodedAudioFrame;
new(): RTCEncodedAudioFrame;
};
interface RTCEncodedVideoFrame {
data: ArrayBuffer;
readonly timestamp: number;
readonly type: RTCEncodedVideoFrameType;
getMetadata(): RTCEncodedVideoFrameMetadata;
}
declare var RTCEncodedVideoFrame: {
prototype: RTCEncodedVideoFrame;
new(): RTCEncodedVideoFrame;
};
interface RTCError extends DOMException {
readonly errorDetail: RTCErrorDetailType;
readonly receivedAlert: number | null;
readonly sctpCauseCode: number | null;
readonly sdpLineNumber: number | null;
readonly sentAlert: number | null;
}
declare var RTCError: {
prototype: RTCError;
new(init: RTCErrorInit, message?: string): RTCError;
};
interface RTCErrorEvent extends Event {
readonly error: RTCError;
}
declare var RTCErrorEvent: {
prototype: RTCErrorEvent;
new(type: string, eventInitDict: RTCErrorEventInit): RTCErrorEvent;
};
/** The RTCIceCandidate interface—part of the WebRTC API—represents a candidate Internet Connectivity Establishment (ICE) configuration which may be used to establish an RTCPeerConnection. */
interface RTCIceCandidate {
readonly address: string | null;
@ -10879,10 +11198,21 @@ declare var RTCIceCandidate: {
new(candidateInitDict?: RTCIceCandidateInit): RTCIceCandidate;
};
interface RTCIceTransportEventMap {
"gatheringstatechange": Event;
"statechange": Event;
}
/** Provides access to information about the ICE transport layer over which the data is being sent and received. */
interface RTCIceTransport extends EventTarget {
readonly gatheringState: RTCIceGathererState;
ongatheringstatechange: ((this: RTCIceTransport, ev: Event) => any) | null;
onstatechange: ((this: RTCIceTransport, ev: Event) => any) | null;
readonly state: RTCIceTransportState;
addEventListener<K extends keyof RTCIceTransportEventMap>(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof RTCIceTransportEventMap>(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var RTCIceTransport: {
@ -10923,6 +11253,7 @@ interface RTCPeerConnection extends EventTarget {
readonly pendingLocalDescription: RTCSessionDescription | null;
readonly pendingRemoteDescription: RTCSessionDescription | null;
readonly remoteDescription: RTCSessionDescription | null;
readonly sctp: RTCSctpTransport | null;
readonly signalingState: RTCSignalingState;
addIceCandidate(candidate?: RTCIceCandidateInit): Promise<void>;
/** @deprecated */
@ -11035,6 +11366,27 @@ declare var RTCRtpTransceiver: {
new(): RTCRtpTransceiver;
};
interface RTCSctpTransportEventMap {
"statechange": Event;
}
interface RTCSctpTransport extends EventTarget {
readonly maxChannels: number | null;
readonly maxMessageSize: number;
onstatechange: ((this: RTCSctpTransport, ev: Event) => any) | null;
readonly state: RTCSctpTransportState;
readonly transport: RTCDtlsTransport;
addEventListener<K extends keyof RTCSctpTransportEventMap>(type: K, listener: (this: RTCSctpTransport, ev: RTCSctpTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof RTCSctpTransportEventMap>(type: K, listener: (this: RTCSctpTransport, ev: RTCSctpTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var RTCSctpTransport: {
prototype: RTCSctpTransport;
new(): RTCSctpTransport;
};
/** One end of a connection—or potential connection—and how it's configured. Each RTCSessionDescription consists of a description type indicating which part of the offer/answer negotiation process it describes and of the SDP descriptor of the session. */
interface RTCSessionDescription {
readonly sdp: string;
@ -11223,7 +11575,7 @@ interface Request extends Body {
declare var Request: {
prototype: Request;
new(input: RequestInfo, init?: RequestInit): Request;
new(input: RequestInfo | URL, init?: RequestInit): Request;
};
interface ResizeObserver {
@ -13183,6 +13535,7 @@ interface ServiceWorkerRegistrationEventMap {
interface ServiceWorkerRegistration extends EventTarget {
readonly active: ServiceWorker | null;
readonly installing: ServiceWorker | null;
readonly navigationPreload: NavigationPreloadManager;
onupdatefound: ((this: ServiceWorkerRegistration, ev: Event) => any) | null;
readonly pushManager: PushManager;
readonly scope: string;
@ -13576,10 +13929,10 @@ interface SubtleCrypto {
encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
@ -14097,6 +14450,19 @@ declare var ValidityState: {
new(): ValidityState;
};
interface VideoColorSpace {
readonly fullRange: boolean | null;
readonly matrix: VideoMatrixCoefficients | null;
readonly primaries: VideoColorPrimaries | null;
readonly transfer: VideoTransferCharacteristics | null;
toJSON(): VideoColorSpaceInit;
}
declare var VideoColorSpace: {
prototype: VideoColorSpace;
new(init?: VideoColorSpaceInit): VideoColorSpace;
};
/** Returned by the HTMLVideoElement.getVideoPlaybackQuality() method and contains metrics that can be used to determine the playback quality of a video. */
interface VideoPlaybackQuality {
/** @deprecated */
@ -14192,13 +14558,6 @@ interface WEBGL_compressed_texture_etc1 {
readonly COMPRESSED_RGB_ETC1_WEBGL: GLenum;
}
interface WEBGL_compressed_texture_pvrtc {
readonly COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: GLenum;
readonly COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: GLenum;
readonly COMPRESSED_RGB_PVRTC_2BPPV1_IMG: GLenum;
readonly COMPRESSED_RGB_PVRTC_4BPPV1_IMG: GLenum;
}
/** The WEBGL_compressed_texture_s3tc extension is part of the WebGL API and exposes four S3TC compressed texture formats. */
interface WEBGL_compressed_texture_s3tc {
readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum;
@ -15701,7 +16060,6 @@ interface WebGLRenderingContextBase {
getExtension(extensionName: "WEBGL_compressed_texture_astc"): WEBGL_compressed_texture_astc | null;
getExtension(extensionName: "WEBGL_compressed_texture_etc"): WEBGL_compressed_texture_etc | null;
getExtension(extensionName: "WEBGL_compressed_texture_etc1"): WEBGL_compressed_texture_etc1 | null;
getExtension(extensionName: "WEBGL_compressed_texture_pvrtc"): WEBGL_compressed_texture_pvrtc | null;
getExtension(extensionName: "WEBGL_compressed_texture_s3tc_srgb"): WEBGL_compressed_texture_s3tc_srgb | null;
getExtension(extensionName: "WEBGL_debug_shaders"): WEBGL_debug_shaders | null;
getExtension(extensionName: "WEBGL_draw_buffers"): WEBGL_draw_buffers | null;
@ -16249,6 +16607,7 @@ declare var WheelEvent: {
};
interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandlersEventMap {
"DOMContentLoaded": Event;
"devicemotion": DeviceMotionEvent;
"deviceorientation": DeviceOrientationEvent;
"gamepadconnected": GamepadEvent;
@ -16448,11 +16807,12 @@ interface WindowOrWorkerGlobalScope {
clearTimeout(id?: number): 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, init?: RequestInit): Promise<Response>;
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
queueMicrotask(callback: VoidFunction): void;
reportError(e: any): void;
setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
structuredClone(value: any, options?: StructuredSerializeOptions): any;
}
interface WindowSessionStorage {
@ -17097,6 +17457,10 @@ interface UnderlyingSourceStartCallback<R> {
(controller: ReadableStreamController<R>): any;
}
interface VideoFrameRequestCallback {
(now: DOMHighResTimeStamp, metadata: VideoFrameMetadata): void;
}
interface VoidFunction {
(): void;
}
@ -17729,11 +18093,12 @@ declare function clearInterval(id?: number): void;
declare function clearTimeout(id?: number): 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, init?: RequestInit): Promise<Response>;
declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
declare function queueMicrotask(callback: VoidFunction): void;
declare function reportError(e: any): void;
declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function structuredClone(value: any, options?: StructuredSerializeOptions): any;
declare var sessionStorage: Storage;
declare function addEventListener<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
@ -17748,8 +18113,7 @@ type BufferSource = ArrayBufferView | ArrayBuffer;
type COSEAlgorithmIdentifier = number;
type CSSNumberish = number;
type CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap;
type ClipboardItemData = Promise<ClipboardItemDataType>;
type ClipboardItemDataType = string | Blob;
type ClipboardItemData = Promise<string | Blob>;
type ClipboardItems = ClipboardItem[];
type ConstrainBoolean = boolean | ConstrainBooleanParameters;
type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters;
@ -17864,6 +18228,9 @@ 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";
@ -17875,7 +18242,7 @@ type MediaKeysRequirement = "not-allowed" | "optional" | "required";
type MediaSessionAction = "hangup" | "nexttrack" | "pause" | "play" | "previoustrack" | "seekbackward" | "seekforward" | "seekto" | "skipad" | "stop" | "togglecamera" | "togglemicrophone";
type MediaSessionPlaybackState = "none" | "paused" | "playing";
type MediaStreamTrackState = "ended" | "live";
type NavigationType = "back_forward" | "navigate" | "prerender" | "reload";
type NavigationTimingType = "back_forward" | "navigate" | "prerender" | "reload";
type NotificationDirection = "auto" | "ltr" | "rtl";
type NotificationPermission = "default" | "denied" | "granted";
type OrientationLockType = "any" | "landscape" | "landscape-primary" | "landscape-secondary" | "natural" | "portrait" | "portrait-primary" | "portrait-secondary";
@ -17897,6 +18264,8 @@ type RTCBundlePolicy = "balanced" | "max-bundle" | "max-compat";
type RTCDataChannelState = "closed" | "closing" | "connecting" | "open";
type RTCDegradationPreference = "balanced" | "maintain-framerate" | "maintain-resolution";
type RTCDtlsTransportState = "closed" | "connected" | "connecting" | "failed" | "new";
type RTCEncodedVideoFrameType = "delta" | "empty" | "key";
type RTCErrorDetailType = "data-channel-failure" | "dtls-failure" | "fingerprint-failure" | "hardware-encoder-error" | "hardware-encoder-not-available" | "sctp-failure" | "sdp-syntax-error";
type RTCIceCandidateType = "host" | "prflx" | "relay" | "srflx";
type RTCIceComponent = "rtcp" | "rtp";
type RTCIceConnectionState = "checking" | "closed" | "completed" | "connected" | "disconnected" | "failed" | "new";
@ -17911,6 +18280,7 @@ type RTCPeerConnectionState = "closed" | "connected" | "connecting" | "disconnec
type RTCPriorityType = "high" | "low" | "medium" | "very-low";
type RTCRtcpMuxPolicy = "require";
type RTCRtpTransceiverDirection = "inactive" | "recvonly" | "sendonly" | "sendrecv" | "stopped";
type RTCSctpTransportState = "closed" | "connected" | "connecting";
type RTCSdpType = "answer" | "offer" | "pranswer" | "rollback";
type RTCSignalingState = "closed" | "have-local-offer" | "have-local-pranswer" | "have-remote-offer" | "have-remote-pranswer" | "stable";
type RTCStatsIceCandidatePairState = "failed" | "frozen" | "in-progress" | "inprogress" | "succeeded" | "waiting";
@ -17944,7 +18314,10 @@ type TextTrackMode = "disabled" | "hidden" | "showing";
type TouchType = "direct" | "stylus";
type TransferFunction = "hlg" | "pq" | "srgb";
type UserVerificationRequirement = "discouraged" | "preferred" | "required";
type VideoColorPrimaries = "bt470bg" | "bt709" | "smpte170m";
type VideoFacingModeEnum = "environment" | "left" | "right" | "user";
type VideoMatrixCoefficients = "bt470bg" | "bt709" | "rgb" | "smpte170m";
type VideoTransferCharacteristics = "bt709" | "iec61966-2-1" | "smpte170m";
type WebGLPowerPreference = "default" | "high-performance" | "low-power";
type WorkerType = "classic" | "module";
type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";

View file

@ -7,10 +7,6 @@
/// <reference no-default-lib="true"/>
interface AbortSignal extends EventTarget {
readonly reason?: unknown;
}
declare interface URLPatternInit {
protocol?: string;
username?: string;

View file

@ -69,6 +69,9 @@ interface DataTransferItemList {
[Symbol.iterator](): IterableIterator<DataTransferItem>;
}
interface EventCounts extends ReadonlyMap<string, number> {
}
interface FileList {
[Symbol.iterator](): IterableIterator<File>;
}
@ -130,6 +133,16 @@ 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]>;
@ -233,10 +246,10 @@ interface StyleSheetList {
interface SubtleCrypto {
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
}

View file

@ -283,7 +283,7 @@ interface ObjectConstructor {
* @param target The target object to copy to.
* @param source The source object from which to copy properties.
*/
assign<T, U>(target: T, source: U): T & U;
assign<T extends {}, U>(target: T, source: U): T & U;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
@ -292,7 +292,7 @@ interface ObjectConstructor {
* @param source1 The first source object from which to copy properties.
* @param source2 The second source object from which to copy properties.
*/
assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
@ -302,7 +302,7 @@ interface ObjectConstructor {
* @param source2 The second source object from which to copy properties.
* @param source3 The third source object from which to copy properties.
*/
assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a

View file

@ -44,7 +44,7 @@ declare namespace Reflect {
* @param propertyKey The property name.
* @param attributes Descriptor for the property. It can be for a data property or an accessor property.
*/
function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): boolean;
/**
* Removes a property from an object, equivalent to `delete target[propertyKey]`,

View file

@ -18,6 +18,8 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference lib="es2020.intl" />
interface BigIntToLocaleStringOptions {
/**
* The locale matching algorithm to use.The default is "best fit". For information about this option, see the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation Intl page}.
@ -112,7 +114,7 @@ interface BigInt {
toString(radix?: number): string;
/** Returns a string representation appropriate to the host environment's current locale. */
toLocaleString(locales?: string, options?: BigIntToLocaleStringOptions): string;
toLocaleString(locales?: Intl.LocalesArgument, options?: BigIntToLocaleStringOptions): string;
/** Returns the primitive value of the specified object. */
valueOf(): bigint;
@ -691,6 +693,7 @@ interface DataView {
* Gets the BigInt64 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getBigInt64(byteOffset: number, littleEndian?: boolean): bigint;
@ -698,6 +701,7 @@ interface DataView {
* Gets the BigUint64 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getBigUint64(byteOffset: number, littleEndian?: boolean): bigint;
@ -705,8 +709,7 @@ interface DataView {
* Stores a BigInt64 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setBigInt64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
@ -714,8 +717,7 @@ interface DataView {
* Stores a BigUint64 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
}

View file

@ -20,6 +20,8 @@ and limitations under the License.
/// <reference lib="es2019" />
/// <reference lib="es2020.bigint" />
/// <reference lib="es2020.date" />
/// <reference lib="es2020.number" />
/// <reference lib="es2020.promise" />
/// <reference lib="es2020.sharedmemory" />
/// <reference lib="es2020.string" />

44
cli/dts/lib.es2020.date.d.ts vendored Normal file
View file

@ -0,0 +1,44 @@
/*! *****************************************************************************
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"/>
/// <reference lib="es2020.intl" />
interface Date {
/**
* Converts a date and time to a string by using the current or specified locale.
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
* @param options An object that contains one or more properties that specify comparison options.
*/
toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
/**
* Converts a date to a string by using the current or specified locale.
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
* @param options An object that contains one or more properties that specify comparison options.
*/
toLocaleDateString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
/**
* Converts a time to a string by using the current or specified locale.
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
* @param options An object that contains one or more properties that specify comparison options.
*/
toLocaleTimeString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
}

View file

@ -78,6 +78,13 @@ declare namespace Intl {
*/
type BCP47LanguageTag = string;
/**
* The locale(s) to use
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
*/
type LocalesArgument = UnicodeBCP47LocaleIdentifier | Locale | (UnicodeBCP47LocaleIdentifier | Locale)[] | undefined;
/**
* An object with some or all of properties of `options` parameter
* of `Intl.RelativeTimeFormat` constructor.
@ -274,6 +281,10 @@ declare namespace Intl {
}
interface Locale extends LocaleOptions {
/** A string containing the language, and the script and region if available. */
baseName: string;
/** The primary language subtag associated with the locale. */
language: string;
/** Gets the most likely values for the language, script, and region of the locale based on existing values. */
maximize(): Locale;
/** Attempts to remove information about the locale that would be added by calling `Locale.maximize()`. */
@ -297,15 +308,39 @@ declare namespace Intl {
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale).
*/
const Locale: {
new (tag?: BCP47LanguageTag, options?: LocaleOptions): Locale;
new (tag: BCP47LanguageTag | Locale, options?: LocaleOptions): Locale;
};
interface DisplayNamesOptions {
type DisplayNamesFallback =
| "code"
| "none";
type DisplayNamesType =
| "language"
| "region"
| "script"
| "calendar"
| "dateTimeField"
| "currency";
type DisplayNamesLanguageDisplay =
| "dialect"
| "standard";
interface DisplayNamesOptions {
localeMatcher?: RelativeTimeFormatLocaleMatcher;
style?: RelativeTimeFormatStyle;
type: DisplayNamesType;
languageDisplay?: DisplayNamesLanguageDisplay;
fallback?: DisplayNamesFallback;
}
interface ResolvedDisplayNamesOptions {
locale: UnicodeBCP47LocaleIdentifier;
localeMatcher: RelativeTimeFormatLocaleMatcher;
style: RelativeTimeFormatStyle;
type: "language" | "region" | "script" | "currency";
fallback: "code" | "none";
type: DisplayNamesType;
fallback: DisplayNamesFallback;
languageDisplay?: DisplayNamesLanguageDisplay;
}
interface DisplayNames {
@ -331,7 +366,7 @@ declare namespace Intl {
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/resolvedOptions).
*/
resolvedOptions(): DisplayNamesOptions;
resolvedOptions(): ResolvedDisplayNamesOptions;
}
/**
@ -352,7 +387,7 @@ declare namespace Intl {
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames).
*/
new(locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: Partial<DisplayNamesOptions>): DisplayNames;
new(locales: LocalesArgument, options: DisplayNamesOptions): DisplayNames;
/**
* Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale.
@ -367,7 +402,7 @@ declare namespace Intl {
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
*/
supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: {localeMatcher: RelativeTimeFormatLocaleMatcher}): BCP47LanguageTag[];
supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher }): BCP47LanguageTag[];
};
}

30
cli/dts/lib.es2020.number.d.ts vendored Normal file
View file

@ -0,0 +1,30 @@
/*! *****************************************************************************
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"/>
/// <reference lib="es2020.intl" />
interface Number {
/**
* Converts a number to a string by using the current or specified locale.
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
* @param options An object that contains one or more properties that specify comparison options.
*/
toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.NumberFormatOptions): string;
}

View file

@ -28,6 +28,11 @@ declare namespace Intl {
fractionalSecondDigits?: 0 | 1 | 2 | 3 | undefined;
}
interface DateTimeFormat {
formatRange(startDate: Date | number | bigint, endDate: Date | number | bigint): string;
formatRangeToParts(startDate: Date | number | bigint, endDate: Date | number | bigint): DateTimeFormatPart[];
}
interface ResolvedDateTimeFormatOptions {
formatMatcher?: "basic" | "best fit" | "best fit";
dateStyle?: "full" | "long" | "medium" | "short";
@ -37,15 +42,10 @@ declare namespace Intl {
fractionalSecondDigits?: 0 | 1 | 2 | 3;
}
interface NumberFormat {
formatRange(startDate: number | bigint, endDate: number | bigint): string;
formatRangeToParts(startDate: number | bigint, endDate: number | bigint): NumberFormatPart[];
}
/**
* The locale matching algorithm to use.
*
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
type ListFormatLocaleMatcher = "lookup" | "best fit";
@ -70,11 +70,11 @@ declare namespace Intl {
*/
interface ListFormatOptions {
/** The locale matching algorithm to use. For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation). */
localeMatcher?: ListFormatLocaleMatcher;
localeMatcher?: ListFormatLocaleMatcher | undefined;
/** The format of output message. */
type?: ListFormatType;
type?: ListFormatType | undefined;
/** The length of the internationalized message. */
style?: ListFormatStyle;
style?: ListFormatStyle | undefined;
}
interface ListFormat {
@ -143,4 +143,4 @@ declare namespace Intl {
*/
supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick<ListFormatOptions, "localeMatcher">): BCP47LanguageTag[];
};
}
}

View file

@ -21,5 +21,6 @@ and limitations under the License.
/// <reference lib="es2021" />
/// <reference lib="es2022.array" />
/// <reference lib="es2022.error" />
/// <reference lib="es2022.intl" />
/// <reference lib="es2022.object" />
/// <reference lib="es2022.string" />

111
cli/dts/lib.es2022.intl.d.ts vendored Normal file
View file

@ -0,0 +1,111 @@
/*! *****************************************************************************
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"/>
declare namespace Intl {
/**
* An object with some or all properties of the `Intl.Segmenter` constructor `options` parameter.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter#parameters)
*/
interface SegmenterOptions {
/** The locale matching algorithm to use. For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation). */
localeMatcher?: "best fit" | "lookup" | undefined;
/** The type of input to be split */
granularity?: "grapheme" | "word" | "sentence" | undefined;
}
interface Segmenter {
/**
* Returns `Segments` object containing the segments of the input string, using the segmenter's locale and granularity.
*
* @param input - The text to be segmented as a `string`.
*
* @returns A new iterable Segments object containing the segments of the input string, using the segmenter's locale and granularity.
*/
segment(input: string): Segments;
resolvedOptions(): ResolvedSegmenterOptions;
}
interface ResolvedSegmenterOptions {
locale: string;
granularity: "grapheme" | "word" | "sentence";
}
interface Segments {
/**
* Returns an object describing the segment in the original string that includes the code unit at a specified index.
*
* @param codeUnitIndex - A number specifying the index of the code unit in the original input string. If the value is omitted, it defaults to `0`.
*/
containing(codeUnitIndex?: number): SegmentData;
/** Returns an iterator to iterate over the segments. */
[Symbol.iterator](): IterableIterator<SegmentData>;
}
interface SegmentData {
/** A string containing the segment extracted from the original input string. */
segment: string;
/** The code unit index in the original input string at which the segment begins. */
index: number;
/** The complete input string that was segmented. */
input: string;
/**
* A boolean value only if granularity is "word"; otherwise, undefined.
* If granularity is "word", then isWordLike is true when the segment is word-like (i.e., consists of letters/numbers/ideographs/etc.); otherwise, false.
*/
isWordLike?: boolean;
}
const Segmenter: {
prototype: Segmenter;
/**
* Creates a new `Intl.Segmenter` object.
*
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
* For the general form and interpretation of the `locales` argument,
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/Segmenter#parameters)
* with some or all options of `SegmenterOptions`.
*
* @returns [Intl.Segmenter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segments) object.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter).
*/
new(locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: SegmenterOptions): Segmenter;
/**
* Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
*
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
* For the general form and interpretation of the `locales` argument,
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
*
* @param options An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf#parameters).
* with some or all possible options.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf)
*/
supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick<SegmenterOptions, "localeMatcher">): BCP47LanguageTag[];
};
}

View file

@ -18,7 +18,7 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
interface Object {
interface ObjectConstructor {
/**
* Determines whether an object has a property with the specified name.
* @param o An object.

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

@ -72,13 +72,13 @@ declare function decodeURIComponent(encodedURIComponent: string): string;
/**
* Encodes a text string as a valid Uniform Resource Identifier (URI)
* @param uri A value representing an encoded URI.
* @param uri A value representing an unencoded URI.
*/
declare function encodeURI(uri: string): string;
/**
* Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
* @param uriComponent A value representing an encoded URI component.
* @param uriComponent A value representing an unencoded URI component.
*/
declare function encodeURIComponent(uriComponent: string | number | boolean): string;
@ -226,6 +226,12 @@ interface ObjectConstructor {
*/
freeze<T extends Function>(f: T): T;
/**
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
* @param o Object on which to lock the attributes.
*/
freeze<T extends {[idx: string]: U | null | undefined | object}, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;
/**
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
* @param o Object on which to lock the attributes.
@ -320,7 +326,7 @@ declare var Function: FunctionConstructor;
/**
* Extracts the type of the 'this' parameter of a function type, or 'unknown' if the function type has no 'this' parameter.
*/
type ThisParameterType<T> = T extends (this: infer U, ...args: any[]) => any ? U : unknown;
type ThisParameterType<T> = T extends (this: infer U, ...args: never) => any ? U : unknown;
/**
* Removes the 'this' parameter from a function type.
@ -1683,6 +1689,7 @@ interface DataView {
* Gets the Float32 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getFloat32(byteOffset: number, littleEndian?: boolean): number;
@ -1690,6 +1697,7 @@ interface DataView {
* Gets the Float64 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getFloat64(byteOffset: number, littleEndian?: boolean): number;
@ -1704,12 +1712,14 @@ interface DataView {
* Gets the Int16 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getInt16(byteOffset: number, littleEndian?: boolean): number;
/**
* Gets the Int32 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getInt32(byteOffset: number, littleEndian?: boolean): number;
@ -1724,6 +1734,7 @@ interface DataView {
* Gets the Uint16 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getUint16(byteOffset: number, littleEndian?: boolean): number;
@ -1731,6 +1742,7 @@ interface DataView {
* Gets the Uint32 value at the specified byte offset from the start of the view. There is
* no alignment constraint; multi-byte values may be fetched from any offset.
* @param byteOffset The place in the buffer at which the value should be retrieved.
* @param littleEndian If false or undefined, a big-endian value should be read.
*/
getUint32(byteOffset: number, littleEndian?: boolean): number;
@ -1738,8 +1750,7 @@ interface DataView {
* Stores an Float32 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
@ -1747,8 +1758,7 @@ interface DataView {
* Stores an Float64 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
@ -1763,8 +1773,7 @@ interface DataView {
* Stores an Int16 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
@ -1772,8 +1781,7 @@ interface DataView {
* Stores an Int32 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
@ -1788,8 +1796,7 @@ interface DataView {
* Stores an Uint16 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
@ -1797,8 +1804,7 @@ interface DataView {
* Stores an Uint32 value at the specified byte offset from the start of the view.
* @param byteOffset The place in the buffer at which the value should be set.
* @param value The value to set.
* @param littleEndian If false or undefined, a big-endian value should be written,
* otherwise a little-endian value should be written.
* @param littleEndian If false or undefined, a big-endian value should be written.
*/
setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
}
@ -4405,6 +4411,7 @@ declare namespace Intl {
new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];
readonly prototype: NumberFormat;
};
interface DateTimeFormatOptions {
@ -4417,7 +4424,7 @@ declare namespace Intl {
hour?: "numeric" | "2-digit" | undefined;
minute?: "numeric" | "2-digit" | undefined;
second?: "numeric" | "2-digit" | undefined;
timeZoneName?: "long" | "short" | undefined;
timeZoneName?: "short" | "long" | "shortOffset" | "longOffset" | "shortGeneric" | "longGeneric" | undefined;
formatMatcher?: "best fit" | "basic" | undefined;
hour12?: boolean | undefined;
timeZone?: string | undefined;
@ -4448,6 +4455,7 @@ declare namespace Intl {
new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];
readonly prototype: DateTimeFormat;
};
}

View file

@ -19,5 +19,8 @@ and limitations under the License.
declare namespace Intl {
// Empty for now
interface NumberFormat {
formatRange(start: number | bigint, end: number | bigint): string;
formatRangeToParts(start: number | bigint, end: number | bigint): NumberFormatPart[];
}
}

View file

@ -379,6 +379,11 @@ interface MultiCacheQueryOptions extends CacheQueryOptions {
cacheName?: string;
}
interface NavigationPreloadState {
enabled?: boolean;
headerValue?: string;
}
interface NotificationAction {
action: string;
icon?: string;
@ -475,6 +480,22 @@ interface QueuingStrategyInit {
highWaterMark: number;
}
interface RTCEncodedAudioFrameMetadata {
contributingSources?: number[];
synchronizationSource?: number;
}
interface RTCEncodedVideoFrameMetadata {
contributingSources?: number[];
dependencies?: number[];
frameId?: number;
height?: number;
spatialIndex?: number;
synchronizationSource?: number;
temporalIndex?: number;
width?: number;
}
interface ReadableStreamDefaultReadDoneResult {
done: true;
value?: undefined;
@ -648,6 +669,13 @@ interface UnderlyingSource<R = any> {
type?: undefined;
}
interface VideoColorSpaceInit {
fullRange?: boolean;
matrix?: VideoMatrixCoefficients;
primaries?: VideoColorPrimaries;
transfer?: VideoTransferCharacteristics;
}
interface VideoConfiguration {
bitrate: number;
colorGamut?: ColorGamut;
@ -695,7 +723,7 @@ interface AbortController {
/** Returns the AbortSignal object associated with this object. */
readonly signal: AbortSignal;
/** Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. */
abort(reason?: any): void;
// abort(): AbortSignal; - To be re-added in the future
}
declare var AbortController: {
@ -712,6 +740,8 @@ interface AbortSignal extends EventTarget {
/** Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */
readonly aborted: boolean;
onabort: ((this: AbortSignal, ev: Event) => any) | null;
readonly reason: any;
throwIfAborted(): void;
addEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof AbortSignalEventMap>(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@ -721,7 +751,7 @@ interface AbortSignal extends EventTarget {
declare var AbortSignal: {
prototype: AbortSignal;
new(): AbortSignal;
// abort(): AbortSignal; - To be re-added in the future
abort(reason?: any): AbortSignal;
};
interface AbstractWorkerEventMap {
@ -747,7 +777,7 @@ interface Blob {
readonly type: string;
arrayBuffer(): Promise<ArrayBuffer>;
slice(start?: number, end?: number, contentType?: string): Blob;
stream(): ReadableStream;
stream(): ReadableStream<Uint8Array>;
text(): Promise<string>;
}
@ -807,13 +837,13 @@ declare var ByteLengthQueuingStrategy: {
* Available only in secure contexts.
*/
interface Cache {
add(request: RequestInfo): Promise<void>;
add(request: RequestInfo | URL): Promise<void>;
addAll(requests: RequestInfo[]): Promise<void>;
delete(request: RequestInfo, options?: CacheQueryOptions): Promise<boolean>;
keys(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>;
match(request: RequestInfo, options?: CacheQueryOptions): Promise<Response | undefined>;
matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>;
put(request: RequestInfo, response: Response): Promise<void>;
delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<boolean>;
keys(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise<ReadonlyArray<Request>>;
match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise<Response | undefined>;
matchAll(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise<ReadonlyArray<Response>>;
put(request: RequestInfo | URL, response: Response): Promise<void>;
}
declare var Cache: {
@ -829,7 +859,7 @@ interface CacheStorage {
delete(cacheName: string): Promise<boolean>;
has(cacheName: string): Promise<boolean>;
keys(): Promise<string[]>;
match(request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>;
match(request: RequestInfo | URL, options?: MultiCacheQueryOptions): Promise<Response | undefined>;
open(cacheName: string): Promise<Cache>;
}
@ -1462,6 +1492,7 @@ declare var ExtendableMessageEvent: {
interface FetchEvent extends ExtendableEvent {
readonly clientId: string;
readonly handled: Promise<undefined>;
readonly preloadResponse: Promise<any>;
readonly request: Request;
readonly resultingClientId: string;
respondWith(r: Response | PromiseLike<Response>): void;
@ -2115,6 +2146,7 @@ declare var ImageBitmapRenderingContext: {
/** The underlying pixel data of an area of a <canvas> element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData(). */
interface ImageData {
readonly colorSpace: PredefinedColorSpace;
/** Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255. */
readonly data: Uint8ClampedArray;
/** Returns the actual dimensions of the data in the ImageData object, in pixels. */
@ -2231,6 +2263,19 @@ declare var MessagePort: {
new(): MessagePort;
};
/** Available only in secure contexts. */
interface NavigationPreloadManager {
disable(): Promise<void>;
enable(): Promise<void>;
getState(): Promise<NavigationPreloadState>;
setHeaderValue(value: string): Promise<void>;
}
declare var NavigationPreloadManager: {
prototype: NavigationPreloadManager;
new(): NavigationPreloadManager;
};
interface NavigatorConcurrentHardware {
readonly hardwareConcurrency: number;
}
@ -2254,6 +2299,11 @@ interface NavigatorLanguage {
readonly languages: ReadonlyArray<string>;
}
/** Available only in secure contexts. */
interface NavigatorLocks {
readonly locks: LockManager;
}
interface NavigatorNetworkInformation {
readonly connection: NetworkInformation;
}
@ -2629,6 +2679,29 @@ declare var PushSubscriptionOptions: {
new(): PushSubscriptionOptions;
};
interface RTCEncodedAudioFrame {
data: ArrayBuffer;
readonly timestamp: number;
getMetadata(): RTCEncodedAudioFrameMetadata;
}
declare var RTCEncodedAudioFrame: {
prototype: RTCEncodedAudioFrame;
new(): RTCEncodedAudioFrame;
};
interface RTCEncodedVideoFrame {
data: ArrayBuffer;
readonly timestamp: number;
readonly type: RTCEncodedVideoFrameType;
getMetadata(): RTCEncodedVideoFrameMetadata;
}
declare var RTCEncodedVideoFrame: {
prototype: RTCEncodedVideoFrame;
new(): RTCEncodedVideoFrame;
};
/** 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;
@ -2704,7 +2777,7 @@ interface Request extends Body {
declare var Request: {
prototype: Request;
new(input: RequestInfo, init?: RequestInit): Request;
new(input: RequestInfo | URL, init?: RequestInit): Request;
};
/** This Fetch API interface represents the response to a request. */
@ -2849,6 +2922,7 @@ interface ServiceWorkerRegistrationEventMap {
interface ServiceWorkerRegistration extends EventTarget {
readonly active: ServiceWorker | null;
readonly installing: ServiceWorker | null;
readonly navigationPreload: NavigationPreloadManager;
onupdatefound: ((this: ServiceWorkerRegistration, ev: Event) => any) | null;
readonly pushManager: PushManager;
readonly scope: string;
@ -2914,10 +2988,10 @@ interface SubtleCrypto {
encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
@ -3095,6 +3169,19 @@ declare var URLSearchParams: {
toString(): string;
};
interface VideoColorSpace {
readonly fullRange: boolean | null;
readonly matrix: VideoMatrixCoefficients | null;
readonly primaries: VideoColorPrimaries | null;
readonly transfer: VideoTransferCharacteristics | null;
toJSON(): VideoColorSpaceInit;
}
declare var VideoColorSpace: {
prototype: VideoColorSpace;
new(init?: VideoColorSpaceInit): VideoColorSpace;
};
interface WEBGL_color_buffer_float {
readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum;
readonly RGBA32F_EXT: GLenum;
@ -3150,13 +3237,6 @@ interface WEBGL_compressed_texture_etc1 {
readonly COMPRESSED_RGB_ETC1_WEBGL: GLenum;
}
interface WEBGL_compressed_texture_pvrtc {
readonly COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: GLenum;
readonly COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: GLenum;
readonly COMPRESSED_RGB_PVRTC_2BPPV1_IMG: GLenum;
readonly COMPRESSED_RGB_PVRTC_4BPPV1_IMG: GLenum;
}
/** The WEBGL_compressed_texture_s3tc extension is part of the WebGL API and exposes four S3TC compressed texture formats. */
interface WEBGL_compressed_texture_s3tc {
readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum;
@ -4647,7 +4727,6 @@ interface WebGLRenderingContextBase {
getExtension(extensionName: "WEBGL_compressed_texture_astc"): WEBGL_compressed_texture_astc | null;
getExtension(extensionName: "WEBGL_compressed_texture_etc"): WEBGL_compressed_texture_etc | null;
getExtension(extensionName: "WEBGL_compressed_texture_etc1"): WEBGL_compressed_texture_etc1 | null;
getExtension(extensionName: "WEBGL_compressed_texture_pvrtc"): WEBGL_compressed_texture_pvrtc | null;
getExtension(extensionName: "WEBGL_compressed_texture_s3tc_srgb"): WEBGL_compressed_texture_s3tc_srgb | null;
getExtension(extensionName: "WEBGL_debug_shaders"): WEBGL_debug_shaders | null;
getExtension(extensionName: "WEBGL_draw_buffers"): WEBGL_draw_buffers | null;
@ -5203,11 +5282,12 @@ interface WindowOrWorkerGlobalScope {
clearTimeout(id?: number): 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, init?: RequestInit): Promise<Response>;
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
queueMicrotask(callback: VoidFunction): void;
reportError(e: any): void;
setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
structuredClone(value: any, options?: StructuredSerializeOptions): any;
}
interface WorkerEventMap extends AbstractWorkerEventMap {
@ -5291,7 +5371,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, NavigatorNetworkInformation, NavigatorOnLine, NavigatorStorage {
interface WorkerNavigator extends NavigatorConcurrentHardware, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorNetworkInformation, NavigatorOnLine, NavigatorStorage {
readonly mediaCapabilities: MediaCapabilities;
}
@ -5742,11 +5822,12 @@ declare function clearInterval(id?: number): void;
declare function clearTimeout(id?: number): 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, init?: RequestInit): Promise<Response>;
declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
declare function queueMicrotask(callback: VoidFunction): void;
declare function reportError(e: any): void;
declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function structuredClone(value: any, options?: StructuredSerializeOptions): any;
declare function cancelAnimationFrame(handle: number): void;
declare function requestAnimationFrame(callback: FrameRequestCallback): number;
declare function addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@ -5827,6 +5908,7 @@ type PermissionState = "denied" | "granted" | "prompt";
type PredefinedColorSpace = "display-p3" | "srgb";
type PremultiplyAlpha = "default" | "none" | "premultiply";
type PushEncryptionKeyName = "auth" | "p256dh";
type RTCEncodedVideoFrameType = "delta" | "empty" | "key";
type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url";
type RequestCache = "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload";
type RequestCredentials = "include" | "omit" | "same-origin";
@ -5839,6 +5921,9 @@ type SecurityPolicyViolationEventDisposition = "enforce" | "report";
type ServiceWorkerState = "activated" | "activating" | "installed" | "installing" | "parsed" | "redundant";
type ServiceWorkerUpdateViaCache = "all" | "imports" | "none";
type TransferFunction = "hlg" | "pq" | "srgb";
type VideoColorPrimaries = "bt470bg" | "bt709" | "smpte170m";
type VideoMatrixCoefficients = "bt470bg" | "bt709" | "rgb" | "smpte170m";
type VideoTransferCharacteristics = "bt709" | "iec61966-2-1" | "smpte170m";
type WebGLPowerPreference = "default" | "high-performance" | "low-power";
type WorkerType = "classic" | "module";
type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";

View file

@ -78,10 +78,10 @@ interface MessageEvent<T = any> {
interface SubtleCrypto {
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
}

File diff suppressed because it is too large Load diff

View file

@ -46,6 +46,8 @@ use log::warn;
use once_cell::sync::Lazy;
use regex::Captures;
use regex::Regex;
use serde_repr::Deserialize_repr;
use serde_repr::Serialize_repr;
use std::cmp;
use std::collections::HashMap;
use std::collections::HashSet;
@ -623,7 +625,7 @@ impl TextSpan {
}
}
#[derive(Debug, Deserialize, Clone)]
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct SymbolDisplayPart {
text: String,
@ -785,7 +787,7 @@ impl QuickInfo {
}
}
#[derive(Debug, Clone, Deserialize)]
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DocumentSpan {
text_span: TextSpan,
@ -1618,6 +1620,7 @@ pub struct CombinedCodeActions {
#[serde(rename_all = "camelCase")]
pub struct ReferenceEntry {
// is_write_access: bool,
#[serde(default)]
pub is_definition: bool,
// is_in_string: Option<bool>,
#[serde(flatten)]
@ -1816,14 +1819,14 @@ impl CallHierarchyOutgoingCall {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CompletionEntryDetails {
// name: String,
// kind: ScriptElementKind,
// kind_modifiers: String,
display_parts: Vec<SymbolDisplayPart>,
documentation: Option<Vec<SymbolDisplayPart>>,
tags: Option<Vec<JsDocTagInfo>>,
// name: String,
// kind: ScriptElementKind,
// kind_modifiers: String,
// code_actions: Option<Vec<CodeAction>>,
// source: Option<Vec<SymbolDisplayPart>>,
// source_display: Option<Vec<SymbolDisplayPart>>,
}
impl CompletionEntryDetails {
@ -1871,10 +1874,23 @@ impl CompletionEntryDetails {
}
}
#[derive(Debug, Deserialize_repr, Serialize_repr)]
#[repr(u32)]
pub enum CompletionInfoFlags {
None = 0,
MayIncludeAutoImports = 1,
IsImportStatementCompletion = 2,
IsContinuation = 4,
ResolvedModuleSpecifiers = 8,
ResolvedModuleSpecifiersBeyondLimit = 16,
MayIncludeMethodSnippets = 32,
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CompletionInfo {
entries: Vec<CompletionEntry>,
flags: Option<CompletionInfoFlags>,
is_global_completion: bool,
is_member_completion: bool,
is_new_identifier_location: bool,
@ -1946,16 +1962,26 @@ pub struct CompletionEntry {
#[serde(skip_serializing_if = "Option::is_none")]
insert_text: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
is_snippet: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
replacement_span: Option<TextSpan>,
#[serde(skip_serializing_if = "Option::is_none")]
has_action: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
source: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
source_display: Option<Vec<SymbolDisplayPart>>,
#[serde(skip_serializing_if = "Option::is_none")]
label_details: Option<CompletionEntryLabelDetails>,
#[serde(skip_serializing_if = "Option::is_none")]
is_recommended: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
is_from_unchecked_file: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
is_package_json_import: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
is_import_statement_completion: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
data: Option<Value>,
}
@ -2140,6 +2166,15 @@ impl CompletionEntry {
}
}
#[derive(Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
struct CompletionEntryLabelDetails {
#[serde(skip_serializing_if = "Option::is_none")]
detail: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
description: Option<String>,
}
#[derive(Debug, Deserialize)]
pub enum OutliningSpanKind {
#[serde(rename = "comment")]
@ -3560,7 +3595,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(), 66);
assert_eq!(assets.len(), 69);
// get some notification when the size of the assets grows
let mut total_size = 0;

View file

@ -2056,7 +2056,7 @@ fn lsp_hover_jsdoc_symbol_link() {
"language": "typescript",
"value": "function a(): void"
},
"JSDoc [hello](file:///a/b.ts#L1,1) and [`b`](file:///a/file.ts#L5,7)"
"JSDoc [hello](file:///a/file.ts#L1,10) and [`b`](file:///a/file.ts#L5,7)"
],
"range": {
"start": {

View file

@ -10,7 +10,7 @@
}
},
"command": {
"title": "1 reference",
"title": "2 references",
"command": "deno.showReferences",
"arguments": [
"file:///a/file.ts",
@ -19,6 +19,19 @@
"character": 6
},
[
{
"uri": "file:///a/file.ts",
"range": {
"start": {
"line": 0,
"character": 6
},
"end": {
"line": 0,
"character": 7
}
}
},
{
"uri": "file:///a/file.ts",
"range": {

43612
cli/tsc/00_typescript.js vendored

File diff suppressed because it is too large Load diff

View file

@ -30,6 +30,15 @@ delete Object.prototype.__proto__;
// See: https://github.com/denoland/deno/issues/9277#issuecomment-769653834
const normalizedToOriginalMap = new Map();
/**
* @param {unknown} value
* @returns {value is ts.CreateSourceFileOptions}
*/
function isCreateSourceFileOptions(value) {
return value != null && typeof value === "object" &&
"languageVersion" in value;
}
function setLogDebug(debug, source) {
logDebug = debug;
if (source) {
@ -290,7 +299,11 @@ delete Object.prototype.__proto__;
) {
debug(
`host.getSourceFile("${specifier}", ${
ts.ScriptTarget[languageVersion]
ts.ScriptTarget[
isCreateSourceFileOptions(languageVersion)
? languageVersion.languageVersion
: languageVersion
]
})`,
);
@ -302,7 +315,7 @@ delete Object.prototype.__proto__;
return sourceFile;
}
/** @type {{ data: string; scriptKind: ts.ScriptKind }} */
/** @type {{ data: string; scriptKind: ts.ScriptKind; version: string; }} */
const { data, scriptKind, version } = core.opSync(
"op_load",
{ specifier },

View file

@ -9,10 +9,15 @@ declare global {
var libs: string[];
var libMap: Map<string, string>;
var base64encode: (host: ts.CompilerHost, input: string) => string;
var normalizePath: (path: string) => string;
interface SourceFile {
version?: string;
}
interface CompilerHost {
base64encode?: (data: any) => string;
}
interface Performance {
enable(): void;
getDuration(value: string): number;
@ -31,6 +36,7 @@ declare global {
}
interface DenoCore {
encode(value: string): Uint8Array;
// deno-lint-ignore no-explicit-any
opSync<T>(name: string, params: T): any;
ops(): void;

View file

@ -275,7 +275,7 @@ interface AbortSignal extends EventTarget {
/** Returns true if this AbortSignal's AbortController has signaled to abort,
* and false otherwise. */
readonly aborted: boolean;
readonly reason?: unknown;
readonly reason: any;
onabort: ((this: AbortSignal, ev: Event) => any) | null;
addEventListener<K extends keyof AbortSignalEventMap>(
type: K,

@ -1 +1 @@
Subproject commit 852968f631b09f6df4a3b0ac6169ba3436d75fc5
Subproject commit 3e884daf3ae04712e7edd16333fd4fbb0f05b033