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

feat(cli): update to TypeScript 4.6.2 (#13474)

This commit is contained in:
Kitson Kelly 2022-03-02 07:44:43 +11:00 committed by GitHub
parent 4be0365fb8
commit 7fc5bfe51b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 5931 additions and 3635 deletions

View file

@ -148,11 +148,14 @@ fn create_compiler_snapshot(
"es2021.promise",
"es2021.string",
"es2021.weakref",
"es2022",
"es2022.array",
"es2022.error",
"es2022.object",
"es2022.string",
"esnext",
"esnext.error",
"esnext.array",
"esnext.intl",
"esnext.object",
"esnext.string",
];
let path_dts = cwd.join("dts");

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

@ -227,7 +227,7 @@ interface ComputedEffectTiming extends EffectTiming {
currentIteration?: number | null;
endTime?: CSSNumberish;
localTime?: CSSNumberish | null;
progress?: CSSNumberish | null;
progress?: number | null;
startTime?: CSSNumberish;
}
@ -284,8 +284,8 @@ interface CredentialRequestOptions {
}
interface CryptoKeyPair {
privateKey?: CryptoKey;
publicKey?: CryptoKey;
privateKey: CryptoKey;
publicKey: CryptoKey;
}
interface CustomEventInit<T = any> extends EventInit {
@ -487,6 +487,18 @@ interface FileSystemFlags {
exclusive?: boolean;
}
interface FileSystemGetDirectoryOptions {
create?: boolean;
}
interface FileSystemGetFileOptions {
create?: boolean;
}
interface FileSystemRemoveOptions {
recursive?: boolean;
}
interface FocusEventInit extends UIEventInit {
relatedTarget?: EventTarget | null;
}
@ -691,6 +703,24 @@ interface KeyframeEffectOptions extends EffectTiming {
pseudoElement?: string | null;
}
interface LockInfo {
clientId?: string;
mode?: LockMode;
name?: string;
}
interface LockManagerSnapshot {
held?: LockInfo[];
pending?: LockInfo[];
}
interface LockOptions {
ifAvailable?: boolean;
mode?: LockMode;
signal?: AbortSignal;
steal?: boolean;
}
interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo {
configuration?: MediaDecodingConfiguration;
}
@ -940,7 +970,7 @@ interface NotificationOptions {
requireInteraction?: boolean;
silent?: boolean;
tag?: string;
timestamp?: DOMTimeStamp;
timestamp?: EpochTimeStamp;
vibrate?: VibratePattern;
}
@ -1172,7 +1202,7 @@ interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity {
interface PushSubscriptionJSON {
endpoint?: string;
expirationTime?: DOMTimeStamp | null;
expirationTime?: EpochTimeStamp | null;
keys?: Record<string, string>;
}
@ -1199,7 +1229,7 @@ interface RTCAnswerOptions extends RTCOfferAnswerOptions {
}
interface RTCCertificateExpiration {
expires?: DOMTimeStamp;
expires?: number;
}
interface RTCConfiguration {
@ -1648,7 +1678,7 @@ interface StreamPipeOptions {
}
interface StructuredSerializeOptions {
transfer?: any[];
transfer?: Transferable[];
}
interface SubmitEventInit extends EventInit {
@ -1824,42 +1854,42 @@ interface ANGLE_instanced_arrays {
}
interface ARIAMixin {
ariaAtomic: string;
ariaAutoComplete: string;
ariaBusy: string;
ariaChecked: string;
ariaColCount: string;
ariaColIndex: string;
ariaColSpan: string;
ariaCurrent: string;
ariaDisabled: string;
ariaExpanded: string;
ariaHasPopup: string;
ariaHidden: string;
ariaKeyShortcuts: string;
ariaLabel: string;
ariaLevel: string;
ariaLive: string;
ariaModal: string;
ariaMultiLine: string;
ariaMultiSelectable: string;
ariaOrientation: string;
ariaPlaceholder: string;
ariaPosInSet: string;
ariaPressed: string;
ariaReadOnly: string;
ariaRequired: string;
ariaRoleDescription: string;
ariaRowCount: string;
ariaRowIndex: string;
ariaRowSpan: string;
ariaSelected: string;
ariaSetSize: string;
ariaSort: string;
ariaValueMax: string;
ariaValueMin: string;
ariaValueNow: string;
ariaValueText: string;
ariaAtomic: string | null;
ariaAutoComplete: string | null;
ariaBusy: string | null;
ariaChecked: string | null;
ariaColCount: string | null;
ariaColIndex: string | null;
ariaColSpan: string | null;
ariaCurrent: string | null;
ariaDisabled: string | null;
ariaExpanded: string | null;
ariaHasPopup: string | null;
ariaHidden: string | null;
ariaKeyShortcuts: string | null;
ariaLabel: string | null;
ariaLevel: string | null;
ariaLive: string | null;
ariaModal: string | null;
ariaMultiLine: string | null;
ariaMultiSelectable: string | null;
ariaOrientation: string | null;
ariaPlaceholder: string | null;
ariaPosInSet: string | null;
ariaPressed: string | null;
ariaReadOnly: string | null;
ariaRequired: string | null;
ariaRoleDescription: string | null;
ariaRowCount: string | null;
ariaRowIndex: string | null;
ariaRowSpan: string | null;
ariaSelected: string | null;
ariaSetSize: string | null;
ariaSort: string | null;
ariaValueMax: string | null;
ariaValueMin: string | null;
ariaValueNow: string | null;
ariaValueText: string | null;
}
/** A controller object that allows you to abort one or more DOM requests as and when desired. */
@ -1867,7 +1897,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(): void;
abort(reason?: any): void;
}
declare var AbortController: {
@ -2954,6 +2984,7 @@ interface CSSStyleDeclaration {
scrollSnapAlign: string;
scrollSnapStop: string;
scrollSnapType: string;
scrollbarGutter: string;
shapeImageThreshold: string;
shapeMargin: string;
shapeOutside: string;
@ -3251,9 +3282,23 @@ declare var CacheStorage: {
new(): CacheStorage;
};
interface CanvasCaptureMediaStreamTrack extends MediaStreamTrack {
readonly canvas: HTMLCanvasElement;
requestFrame(): void;
addEventListener<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: CanvasCaptureMediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: CanvasCaptureMediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var CanvasCaptureMediaStreamTrack: {
prototype: CanvasCaptureMediaStreamTrack;
new(): CanvasCaptureMediaStreamTrack;
};
interface CanvasCompositing {
globalAlpha: number;
globalCompositeOperation: string;
globalCompositeOperation: GlobalCompositeOperation;
}
interface CanvasDrawImage {
@ -3279,6 +3324,7 @@ interface CanvasDrawPath {
interface CanvasFillStrokeStyles {
fillStyle: string | CanvasGradient | CanvasPattern;
strokeStyle: string | CanvasGradient | CanvasPattern;
createConicGradient(startAngle: number, x: number, y: number): CanvasGradient;
createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;
createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null;
createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;
@ -3602,6 +3648,8 @@ interface Crypto {
/** Available only in secure contexts. */
readonly subtle: SubtleCrypto;
getRandomValues<T extends ArrayBufferView | null>(array: T): T;
/** Available only in secure contexts. */
randomUUID(): string;
}
declare var Crypto: {
@ -4308,7 +4356,7 @@ interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShad
readonly timeline: DocumentTimeline;
/** Contains the title of the document. */
title: string;
readonly visibilityState: VisibilityState;
readonly visibilityState: DocumentVisibilityState;
/**
* Sets or gets the color of the links that the user has visited.
* @deprecated
@ -4948,8 +4996,10 @@ interface EventSource extends EventTarget {
readonly CONNECTING: number;
readonly OPEN: number;
addEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
@ -5091,6 +5141,20 @@ declare var FileSystemDirectoryEntry: {
new(): FileSystemDirectoryEntry;
};
/** Available only in secure contexts. */
interface FileSystemDirectoryHandle extends FileSystemHandle {
readonly kind: "directory";
getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise<FileSystemDirectoryHandle>;
getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise<FileSystemFileHandle>;
removeEntry(name: string, options?: FileSystemRemoveOptions): Promise<void>;
resolve(possibleDescendant: FileSystemHandle): Promise<string[] | null>;
}
declare var FileSystemDirectoryHandle: {
prototype: FileSystemDirectoryHandle;
new(): FileSystemDirectoryHandle;
};
interface FileSystemDirectoryReader {
readEntries(successCallback: FileSystemEntriesCallback, errorCallback?: ErrorCallback): void;
}
@ -5123,6 +5187,29 @@ declare var FileSystemFileEntry: {
new(): FileSystemFileEntry;
};
/** Available only in secure contexts. */
interface FileSystemFileHandle extends FileSystemHandle {
readonly kind: "file";
getFile(): Promise<File>;
}
declare var FileSystemFileHandle: {
prototype: FileSystemFileHandle;
new(): FileSystemFileHandle;
};
/** Available only in secure contexts. */
interface FileSystemHandle {
readonly kind: FileSystemHandleKind;
readonly name: string;
isSameEntry(other: FileSystemHandle): Promise<boolean>;
}
declare var FileSystemHandle: {
prototype: FileSystemHandle;
new(): FileSystemHandle;
};
/** Focus-related events like focus, blur, focusin, or focusout. */
interface FocusEvent extends UIEvent {
readonly relatedTarget: EventTarget | null;
@ -5325,7 +5412,7 @@ declare var GeolocationCoordinates: {
/** Available only in secure contexts. */
interface GeolocationPosition {
readonly coords: GeolocationCoordinates;
readonly timestamp: DOMTimeStamp;
readonly timestamp: EpochTimeStamp;
}
declare var GeolocationPosition: {
@ -5424,6 +5511,7 @@ interface GlobalEventHandlersEventMap {
"select": Event;
"selectionchange": Event;
"selectstart": Event;
"slotchange": Event;
"stalled": Event;
"submit": SubmitEvent;
"suspend": Event;
@ -5658,6 +5746,7 @@ interface GlobalEventHandlers {
* @param ev The event.
*/
onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
/**
* Occurs when the seek operation ends.
* @param ev The event.
@ -5675,6 +5764,7 @@ interface GlobalEventHandlers {
onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
/**
* Occurs when the download has stopped.
* @param ev The event.
@ -6640,7 +6730,8 @@ interface HTMLImageElement extends HTMLElement {
hspace: number;
/** Sets or retrieves whether the image is a server-side image map. */
isMap: boolean;
loading: string;
/** Sets or retrieves the policy for loading image elements that are outside the viewport. */
loading: "eager" | "lazy";
/**
* Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object.
* @deprecated
@ -7098,6 +7189,7 @@ interface HTMLMetaElement extends HTMLElement {
content: string;
/** Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. */
httpEquiv: string;
media: string;
/** Sets or retrieves the value specified in the content attribute of the meta object. */
name: string;
/**
@ -7617,6 +7709,7 @@ declare var HTMLSlotElement: {
/** Provides special properties (beyond the regular HTMLElement object interface it also has available to it by inheritance) for manipulating <source> elements. */
interface HTMLSourceElement extends HTMLElement {
height: number;
/** Gets or sets the intended media type of the media source. */
media: string;
sizes: string;
@ -7625,6 +7718,7 @@ interface HTMLSourceElement extends HTMLElement {
srcset: string;
/** Gets or sets the MIME type of a media resource. */
type: string;
width: number;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLSourceElement, 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: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
@ -8580,6 +8674,7 @@ interface IDBTransactionEventMap {
interface IDBTransaction extends EventTarget {
/** Returns the transaction's connection. */
readonly db: IDBDatabase;
readonly durability: IDBTransactionDurability;
/** If the transaction was aborted, returns the error (a DOMException) providing the reason. */
readonly error: DOMException | null;
/** Returns the mode the transaction was created with ("readonly" or "readwrite"), or "versionchange" for an upgrade transaction. */
@ -8682,6 +8777,14 @@ interface InnerHTML {
innerHTML: string;
}
interface InputDeviceInfo extends MediaDeviceInfo {
}
declare var InputDeviceInfo: {
prototype: InputDeviceInfo;
new(): InputDeviceInfo;
};
interface InputEvent extends UIEvent {
readonly data: string | null;
readonly dataTransfer: DataTransfer | null;
@ -8851,6 +8954,29 @@ declare var Location: {
new(): Location;
};
/** Available only in secure contexts. */
interface Lock {
readonly mode: LockMode;
readonly name: string;
}
declare var Lock: {
prototype: Lock;
new(): Lock;
};
/** Available only in secure contexts. */
interface LockManager {
query(): Promise<LockManagerSnapshot>;
request(name: string, callback: LockGrantedCallback): Promise<any>;
request(name: string, options: LockOptions, callback: LockGrantedCallback): Promise<any>;
}
declare var LockManager: {
prototype: LockManager;
new(): LockManager;
};
interface MathMLElementEventMap extends ElementEventMap, DocumentAndElementEventHandlersEventMap, GlobalEventHandlersEventMap {
}
@ -10177,6 +10303,7 @@ interface PerformanceEventTiming extends PerformanceEntry {
readonly processingEnd: DOMHighResTimeStamp;
readonly processingStart: DOMHighResTimeStamp;
readonly target: Node | null;
toJSON(): any;
}
declare var PerformanceEventTiming: {
@ -10583,7 +10710,7 @@ declare var PublicKeyCredential: {
*/
interface PushManager {
getSubscription(): Promise<PushSubscription | null>;
permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>;
permissionState(options?: PushSubscriptionOptionsInit): Promise<PermissionState>;
subscribe(options?: PushSubscriptionOptionsInit): Promise<PushSubscription>;
}
@ -10621,7 +10748,7 @@ declare var PushSubscriptionOptions: {
};
interface RTCCertificate {
readonly expires: DOMTimeStamp;
readonly expires: EpochTimeStamp;
getFingerprints(): RTCDtlsFingerprint[];
}
@ -10899,6 +11026,7 @@ interface RTCRtpTransceiver {
readonly mid: string | null;
readonly receiver: RTCRtpReceiver;
readonly sender: RTCRtpSender;
setCodecPreferences(codecs: RTCRtpCodecCapability[]): void;
stop(): void;
}
@ -11113,6 +11241,7 @@ interface ResizeObserverEntry {
readonly borderBoxSize: ReadonlyArray<ResizeObserverSize>;
readonly contentBoxSize: ReadonlyArray<ResizeObserverSize>;
readonly contentRect: DOMRectReadOnly;
readonly devicePixelContentBoxSize: ReadonlyArray<ResizeObserverSize>;
readonly target: Element;
}
@ -13073,11 +13202,21 @@ declare var ServiceWorkerRegistration: {
new(): ServiceWorkerRegistration;
};
interface ShadowRootEventMap {
"slotchange": Event;
}
interface ShadowRoot extends DocumentFragment, DocumentOrShadowRoot, InnerHTML {
readonly delegatesFocus: boolean;
readonly host: Element;
readonly mode: ShadowRootMode;
onslotchange: ((this: ShadowRoot, ev: Event) => any) | null;
readonly slotAssignment: SlotAssignmentMode;
/** Throws a "NotSupportedError" DOMException if context object is a shadow root. */
addEventListener<K extends keyof ShadowRootEventMap>(type: K, listener: (this: ShadowRoot, ev: ShadowRootEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof ShadowRootEventMap>(type: K, listener: (this: ShadowRoot, ev: ShadowRootEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var ShadowRoot: {
@ -13370,6 +13509,7 @@ declare var StorageEvent: {
/** Available only in secure contexts. */
interface StorageManager {
estimate(): Promise<StorageEstimate>;
getDirectory(): Promise<FileSystemDirectoryHandle>;
persist(): Promise<boolean>;
persisted(): Promise<boolean>;
}
@ -14131,6 +14271,13 @@ interface WEBGL_lose_context {
restoreContext(): void;
}
interface WEBGL_multi_draw {
multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | GLint[], firstsOffset: GLuint, countsList: Int32Array | GLsizei[], countsOffset: GLuint, instanceCountsList: Int32Array | GLsizei[], instanceCountsOffset: GLuint, drawcount: GLsizei): void;
multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | GLint[], firstsOffset: GLuint, countsList: Int32Array | GLsizei[], countsOffset: GLuint, drawcount: GLsizei): void;
multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | GLint[], countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | GLsizei[], offsetsOffset: GLuint, instanceCountsList: Int32Array | GLsizei[], instanceCountsOffset: GLuint, drawcount: GLsizei): void;
multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | GLint[], countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | GLsizei[], offsetsOffset: GLuint, drawcount: GLsizei): void;
}
/** A WaveShaperNode always has exactly one input and one output. */
interface WaveShaperNode extends AudioNode {
curve: Float32Array | null;
@ -16296,12 +16443,13 @@ interface WindowOrWorkerGlobalScope {
readonly performance: Performance;
atob(data: string): string;
btoa(data: string): string;
clearInterval(handle?: number): void;
clearTimeout(handle?: number): void;
clearInterval(id?: number): void;
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>;
queueMicrotask(callback: VoidFunction): void;
reportError(e: any): void;
setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
}
@ -16790,7 +16938,7 @@ declare namespace WebAssembly {
type ImportExportKind = "function" | "global" | "memory" | "table";
type TableKind = "anyfunc" | "externref";
type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64";
type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";
type ExportValue = Function | Global | Memory | Table;
type Exports = Record<string, ExportValue>;
type ImportValue = ExportValue | number;
@ -16852,6 +17000,10 @@ interface IntersectionObserverCallback {
(entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;
}
interface LockGrantedCallback {
(lock: Lock | null): any;
}
interface MediaSessionActionHandler {
(details: MediaSessionActionDetails): void;
}
@ -17480,6 +17632,7 @@ declare var onresize: ((this: Window, ev: UIEvent) => any) | null;
* @param ev The event.
*/
declare var onscroll: ((this: Window, ev: Event) => any) | null;
declare var onsecuritypolicyviolation: ((this: Window, ev: SecurityPolicyViolationEvent) => any) | null;
/**
* Occurs when the seek operation ends.
* @param ev The event.
@ -17497,6 +17650,7 @@ declare var onseeking: ((this: Window, ev: Event) => any) | null;
declare var onselect: ((this: Window, ev: Event) => any) | null;
declare var onselectionchange: ((this: Window, ev: Event) => any) | null;
declare var onselectstart: ((this: Window, ev: Event) => any) | null;
declare var onslotchange: ((this: Window, ev: Event) => any) | null;
/**
* Occurs when the download has stopped.
* @param ev The event.
@ -17570,12 +17724,13 @@ declare var origin: string;
declare var performance: Performance;
declare function atob(data: string): string;
declare function btoa(data: string): string;
declare function clearInterval(handle?: number): void;
declare function clearTimeout(handle?: number): void;
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 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 var sessionStorage: Storage;
@ -17600,7 +17755,7 @@ type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters;
type ConstrainDouble = number | ConstrainDoubleRange;
type ConstrainULong = number | ConstrainULongRange;
type DOMHighResTimeStamp = number;
type DOMTimeStamp = number;
type EpochTimeStamp = number;
type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
type Float32List = Float32Array | GLfloat[];
type FormDataEntryValue = File | string;
@ -17684,17 +17839,21 @@ type DirectionSetting = "" | "lr" | "rl";
type DisplayCaptureSurfaceType = "application" | "browser" | "monitor" | "window";
type DistanceModelType = "exponential" | "inverse" | "linear";
type DocumentReadyState = "complete" | "interactive" | "loading";
type DocumentVisibilityState = "hidden" | "visible";
type EndOfStreamError = "decode" | "network";
type EndingType = "native" | "transparent";
type FileSystemHandleKind = "directory" | "file";
type FillMode = "auto" | "backwards" | "both" | "forwards" | "none";
type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded";
type FontFaceSetLoadStatus = "loaded" | "loading";
type FullscreenNavigationUI = "auto" | "hide" | "show";
type GamepadHapticActuatorType = "vibration";
type GamepadMappingType = "" | "standard" | "xr-standard";
type GlobalCompositeOperation = "color" | "color-burn" | "color-dodge" | "copy" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "lighter" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "source-over" | "xor";
type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
type IDBRequestReadyState = "done" | "pending";
type IDBTransactionDurability = "default" | "relaxed" | "strict";
type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
type ImageOrientation = "flipY" | "none";
type ImageSmoothingQuality = "high" | "low" | "medium";
@ -17703,6 +17862,7 @@ type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
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 MediaDecodingType = "file" | "media-source" | "webrtc";
type MediaDeviceKind = "audioinput" | "audiooutput" | "videoinput";
type MediaEncodingType = "record" | "webrtc";
@ -17732,7 +17892,6 @@ type PremultiplyAlpha = "default" | "none" | "premultiply";
type PresentationStyle = "attachment" | "inline" | "unspecified";
type PublicKeyCredentialType = "public-key";
type PushEncryptionKeyName = "auth" | "p256dh";
type PushPermissionState = "denied" | "granted" | "prompt";
type RTCBundlePolicy = "balanced" | "max-bundle" | "max-compat";
type RTCDataChannelState = "closed" | "closing" | "connecting" | "open";
type RTCDegradationPreference = "balanced" | "maintain-framerate" | "maintain-resolution";
@ -17785,7 +17944,6 @@ type TouchType = "direct" | "stylus";
type TransferFunction = "hlg" | "pq" | "srgb";
type UserVerificationRequirement = "discouraged" | "preferred" | "required";
type VideoFacingModeEnum = "environment" | "left" | "right" | "user";
type VisibilityState = "hidden" | "visible";
type WebGLPowerPreference = "default" | "high-performance" | "low-power";
type WorkerType = "classic" | "module";
type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";

View file

@ -188,6 +188,10 @@ interface PluginArray {
[Symbol.iterator](): IterableIterator<Plugin>;
}
interface RTCRtpTransceiver {
setCodecPreferences(codecs: Iterable<RTCRtpCodecCapability>): void;
}
interface RTCStatsReport extends ReadonlyMap<string, any> {
}
@ -263,6 +267,13 @@ interface WEBGL_draw_buffers {
drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
}
interface WEBGL_multi_draw {
multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, drawcount: GLsizei): void;
multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLint>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLint>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
}
interface WebGL2RenderingContextBase {
clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;

View file

@ -157,7 +157,8 @@ interface ReadonlyMap<K, V> {
}
interface MapConstructor {
new <K, V>(iterable: Iterable<readonly [K, V]>): Map<K, V>;
new(): Map<any, any>;
new <K, V>(iterable?: Iterable<readonly [K, V]> | null): Map<K, V>;
}
interface WeakMap<K extends object, V> { }

View file

@ -220,17 +220,21 @@ declare namespace Intl {
interface NumberFormatOptions {
compactDisplay?: "short" | "long" | undefined;
notation?: "standard" | "scientific" | "engineering" | "compact" | undefined;
signDisplay?: "auto" | "never" | "always" | undefined;
signDisplay?: "auto" | "never" | "always" | "exceptZero" | undefined;
unit?: string | undefined;
unitDisplay?: "short" | "long" | "narrow" | undefined;
currencyDisplay?: string | undefined;
currencySign?: string | undefined;
}
interface ResolvedNumberFormatOptions {
compactDisplay?: "short" | "long";
notation?: "standard" | "scientific" | "engineering" | "compact";
signDisplay?: "auto" | "never" | "always";
signDisplay?: "auto" | "never" | "always" | "exceptZero";
unit?: string;
unitDisplay?: "short" | "long" | "narrow";
currencyDisplay?: string;
currencySign?: string;
}
interface DateTimeFormatOptions {
@ -297,6 +301,7 @@ declare namespace Intl {
};
interface DisplayNamesOptions {
locale: UnicodeBCP47LocaleIdentifier;
localeMatcher: RelativeTimeFormatLocaleMatcher;
style: RelativeTimeFormatStyle;
type: "language" | "region" | "script" | "currency";
@ -319,7 +324,7 @@ declare namespace Intl {
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/of).
*/
of(code: string): string;
of(code: string): string | undefined;
/**
* Returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current
* [`Intl/DisplayNames`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames) object.

View file

@ -49,25 +49,25 @@ declare namespace Intl {
*/
type ListFormatLocaleMatcher = "lookup" | "best fit";
/**
* The format of output message.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
/**
* The format of output message.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
type ListFormatType = "conjunction" | "disjunction" | "unit";
/**
* The length of the formatted message.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
/**
* The length of the formatted message.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
type ListFormatStyle = "long" | "short" | "narrow";
/**
* An object with some or all properties of the `Intl.ListFormat` constructor `options` parameter.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
/**
* An object with some or all properties of the `Intl.ListFormat` constructor `options` parameter.
*
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#parameters).
*/
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;
@ -76,7 +76,7 @@ declare namespace Intl {
/** The length of the internationalized message. */
style?: ListFormatStyle;
}
interface ListFormat {
/**
* Returns a string with a language-specific representation of the list.

123
cli/dts/lib.es2022.array.d.ts vendored Normal file
View file

@ -0,0 +1,123 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
interface Array<T> {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): T | undefined;
}
interface ReadonlyArray<T> {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): T | undefined;
}
interface Int8Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): number | undefined;
}
interface Uint8Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): number | undefined;
}
interface Uint8ClampedArray {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): number | undefined;
}
interface Int16Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): number | undefined;
}
interface Uint16Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): number | undefined;
}
interface Int32Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): number | undefined;
}
interface Uint32Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): number | undefined;
}
interface Float32Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): number | undefined;
}
interface Float64Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): number | undefined;
}
interface BigInt64Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): bigint | undefined;
}
interface BigUint64Array {
/**
* Returns the item located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): bigint | undefined;
}

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

@ -0,0 +1,25 @@
/*! *****************************************************************************
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="es2021" />
/// <reference lib="es2022.array" />
/// <reference lib="es2022.error" />
/// <reference lib="es2022.object" />
/// <reference lib="es2022.string" />

75
cli/dts/lib.es2022.error.d.ts vendored Normal file
View file

@ -0,0 +1,75 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
interface ErrorOptions {
cause?: Error;
}
interface Error {
cause?: Error;
}
interface ErrorConstructor {
new (message?: string, options?: ErrorOptions): Error;
(message?: string, options?: ErrorOptions): Error;
}
interface EvalErrorConstructor {
new (message?: string, options?: ErrorOptions): EvalError;
(message?: string, options?: ErrorOptions): EvalError;
}
interface RangeErrorConstructor {
new (message?: string, options?: ErrorOptions): RangeError;
(message?: string, options?: ErrorOptions): RangeError;
}
interface ReferenceErrorConstructor {
new (message?: string, options?: ErrorOptions): ReferenceError;
(message?: string, options?: ErrorOptions): ReferenceError;
}
interface SyntaxErrorConstructor {
new (message?: string, options?: ErrorOptions): SyntaxError;
(message?: string, options?: ErrorOptions): SyntaxError;
}
interface TypeErrorConstructor {
new (message?: string, options?: ErrorOptions): TypeError;
(message?: string, options?: ErrorOptions): TypeError;
}
interface URIErrorConstructor {
new (message?: string, options?: ErrorOptions): URIError;
(message?: string, options?: ErrorOptions): URIError;
}
interface AggregateErrorConstructor {
new (
errors: Iterable<any>,
message?: string,
options?: ErrorOptions
): AggregateError;
(
errors: Iterable<any>,
message?: string,
options?: ErrorOptions
): AggregateError;
}

View file

@ -18,10 +18,8 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
interface String {
/**
* Access string by relative indexing.
* @param index index to access.
*/
at(index: number): string | undefined;
}
/// <reference lib="es2022" />
/// <reference lib="dom" />
/// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" />
/// <reference lib="dom.iterable" />

28
cli/dts/lib.es2022.object.d.ts vendored Normal file
View file

@ -0,0 +1,28 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
interface Object {
/**
* Determines whether an object has a property with the specified name.
* @param o An object.
* @param v A property name.
*/
hasOwn(o: object, v: PropertyKey): boolean;
}

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

@ -0,0 +1,27 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
interface String {
/**
* Returns a new String consisting of the single UTF-16 code unit located at the specified index.
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
*/
at(index: number): string | undefined;
}

View file

@ -116,7 +116,7 @@ interface PropertyDescriptor {
}
interface PropertyDescriptorMap {
[s: string]: PropertyDescriptor;
[key: PropertyKey]: PropertyDescriptor;
}
interface Object {
@ -1515,7 +1515,7 @@ interface Promise<T> {
type Awaited<T> =
T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
T extends object & { then(onfulfilled: infer F): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
F extends ((value: infer V) => any) ? // if the argument to `then` is callable, extracts the argument
F extends ((value: infer V, ...args: any) => any) ? // if the argument to `then` is callable, extracts the first argument
Awaited<V> : // recursively unwrap the value
never : // the argument to `then` was not callable
T; // non-object or non-thenable
@ -4375,7 +4375,6 @@ declare namespace Intl {
localeMatcher?: string | undefined;
style?: string | undefined;
currency?: string | undefined;
currencyDisplay?: string | undefined;
currencySign?: string | undefined;
useGrouping?: boolean | undefined;
minimumIntegerDigits?: number | undefined;
@ -4390,7 +4389,6 @@ declare namespace Intl {
numberingSystem: string;
style: string;
currency?: string;
currencyDisplay?: string;
minimumIntegerDigits: number;
minimumFractionDigits: number;
maximumFractionDigits: number;

View file

@ -16,12 +16,6 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
interface Array<T> {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): T | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
@ -47,12 +41,6 @@ interface Array<T> {
}
interface ReadonlyArray<T> {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): T | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
@ -78,12 +66,6 @@ interface ReadonlyArray<T> {
}
interface Int8Array {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): number | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
@ -108,12 +90,6 @@ interface Int8Array {
}
interface Uint8Array {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): number | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
@ -138,12 +114,6 @@ interface Uint8Array {
}
interface Uint8ClampedArray {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): number | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
@ -169,12 +139,6 @@ interface Uint8ClampedArray {
interface Int16Array {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): number | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
@ -199,12 +163,6 @@ interface Int16Array {
}
interface Uint16Array {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): number | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
@ -229,12 +187,6 @@ interface Uint16Array {
}
interface Int32Array {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): number | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
@ -259,12 +211,6 @@ interface Int32Array {
}
interface Uint32Array {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): number | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
@ -289,12 +235,6 @@ interface Uint32Array {
}
interface Float32Array {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): number | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
@ -319,12 +259,6 @@ interface Float32Array {
}
interface Float64Array {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): number | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
@ -349,12 +283,6 @@ interface Float64Array {
}
interface BigInt64Array {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): bigint | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
@ -379,12 +307,6 @@ interface BigInt64Array {
}
interface BigUint64Array {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): bigint | undefined;
/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.

View file

@ -18,9 +18,6 @@ and limitations under the License.
/// <reference no-default-lib="true"/>
/// <reference lib="es2021" />
/// <reference lib="es2022" />
/// <reference lib="esnext.array" />
/// <reference lib="esnext.error" />
/// <reference lib="esnext.intl" />
/// <reference lib="esnext.object" />
/// <reference lib="esnext.string" />

View file

@ -1,16 +0,0 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
/// <reference no-default-lib="true"/>
interface Error {
cause?: any;
}
interface ErrorInit {
cause?: any;
}
interface ErrorConstructor {
new (message?: string, init?: ErrorInit): Error;
(message?: string, init?: ErrorInit): Error;
}

View file

@ -1,12 +0,0 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
/// <reference no-default-lib="true"/>
interface ObjectConstructor {
/**
* Determines whether an object has a property with the specified name.
* @param o The target object.
* @param v A property name.
*/
hasOwn(o: object, v: PropertyKey): boolean;
}

View file

@ -90,8 +90,8 @@ interface CloseEventInit extends EventInit {
}
interface CryptoKeyPair {
privateKey?: CryptoKey;
publicKey?: CryptoKey;
privateKey: CryptoKey;
publicKey: CryptoKey;
}
interface CustomEventInit<T = any> extends EventInit {
@ -210,6 +210,18 @@ interface FilePropertyBag extends BlobPropertyBag {
lastModified?: number;
}
interface FileSystemGetDirectoryOptions {
create?: boolean;
}
interface FileSystemGetFileOptions {
create?: boolean;
}
interface FileSystemRemoveOptions {
recursive?: boolean;
}
interface FontFaceDescriptors {
display?: string;
featureSettings?: string;
@ -310,6 +322,24 @@ interface KeyAlgorithm {
name: string;
}
interface LockInfo {
clientId?: string;
mode?: LockMode;
name?: string;
}
interface LockManagerSnapshot {
held?: LockInfo[];
pending?: LockInfo[];
}
interface LockOptions {
ifAvailable?: boolean;
mode?: LockMode;
signal?: AbortSignal;
steal?: boolean;
}
interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo {
configuration?: MediaDecodingConfiguration;
}
@ -373,7 +403,7 @@ interface NotificationOptions {
requireInteraction?: boolean;
silent?: boolean;
tag?: string;
timestamp?: DOMTimeStamp;
timestamp?: EpochTimeStamp;
vibrate?: VibratePattern;
}
@ -422,7 +452,7 @@ interface PushEventInit extends ExtendableEventInit {
interface PushSubscriptionJSON {
endpoint?: string;
expirationTime?: DOMTimeStamp | null;
expirationTime?: EpochTimeStamp | null;
keys?: Record<string, string>;
}
@ -578,7 +608,7 @@ interface StreamPipeOptions {
}
interface StructuredSerializeOptions {
transfer?: any[];
transfer?: Transferable[];
}
interface TextDecodeOptions {
@ -665,7 +695,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(): void;
abort(reason?: any): void;
}
declare var AbortController: {
@ -905,6 +935,8 @@ interface Crypto {
/** Available only in secure contexts. */
readonly subtle: SubtleCrypto;
getRandomValues<T extends ArrayBufferView | null>(array: T): T;
/** Available only in secure contexts. */
randomUUID(): string;
}
declare var Crypto: {
@ -1358,8 +1390,10 @@ interface EventSource extends EventTarget {
readonly CONNECTING: number;
readonly OPEN: number;
addEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof EventSourceEventMap>(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
@ -1518,6 +1552,43 @@ declare var FileReaderSync: {
new(): FileReaderSync;
};
/** Available only in secure contexts. */
interface FileSystemDirectoryHandle extends FileSystemHandle {
readonly kind: "directory";
getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise<FileSystemDirectoryHandle>;
getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise<FileSystemFileHandle>;
removeEntry(name: string, options?: FileSystemRemoveOptions): Promise<void>;
resolve(possibleDescendant: FileSystemHandle): Promise<string[] | null>;
}
declare var FileSystemDirectoryHandle: {
prototype: FileSystemDirectoryHandle;
new(): FileSystemDirectoryHandle;
};
/** Available only in secure contexts. */
interface FileSystemFileHandle extends FileSystemHandle {
readonly kind: "file";
getFile(): Promise<File>;
}
declare var FileSystemFileHandle: {
prototype: FileSystemFileHandle;
new(): FileSystemFileHandle;
};
/** Available only in secure contexts. */
interface FileSystemHandle {
readonly kind: FileSystemHandleKind;
readonly name: string;
isSameEntry(other: FileSystemHandle): Promise<boolean>;
}
declare var FileSystemHandle: {
prototype: FileSystemHandle;
new(): FileSystemHandle;
};
interface FontFace {
ascentOverride: string;
descentOverride: string;
@ -1981,6 +2052,7 @@ interface IDBTransactionEventMap {
interface IDBTransaction extends EventTarget {
/** Returns the transaction's connection. */
readonly db: IDBDatabase;
readonly durability: IDBTransactionDurability;
/** If the transaction was aborted, returns the error (a DOMException) providing the reason. */
readonly error: DOMException | null;
/** Returns the mode the transaction was created with ("readonly" or "readwrite"), or "versionchange" for an upgrade transaction. */
@ -2061,6 +2133,29 @@ interface KHR_parallel_shader_compile {
readonly COMPLETION_STATUS_KHR: GLenum;
}
/** Available only in secure contexts. */
interface Lock {
readonly mode: LockMode;
readonly name: string;
}
declare var Lock: {
prototype: Lock;
new(): Lock;
};
/** Available only in secure contexts. */
interface LockManager {
query(): Promise<LockManagerSnapshot>;
request(name: string, callback: LockGrantedCallback): Promise<any>;
request(name: string, options: LockOptions, callback: LockGrantedCallback): Promise<any>;
}
declare var LockManager: {
prototype: LockManager;
new(): LockManager;
};
interface MediaCapabilities {
decodingInfo(configuration: MediaDecodingConfiguration): Promise<MediaCapabilitiesDecodingInfo>;
encodingInfo(configuration: MediaEncodingConfiguration): Promise<MediaCapabilitiesEncodingInfo>;
@ -2481,7 +2576,7 @@ declare var PushEvent: {
*/
interface PushManager {
getSubscription(): Promise<PushSubscription | null>;
permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>;
permissionState(options?: PushSubscriptionOptionsInit): Promise<PermissionState>;
subscribe(options?: PushSubscriptionOptionsInit): Promise<PushSubscription>;
}
@ -2798,6 +2893,7 @@ declare var SharedWorkerGlobalScope: {
/** Available only in secure contexts. */
interface StorageManager {
estimate(): Promise<StorageEstimate>;
getDirectory(): Promise<FileSystemDirectoryHandle>;
persisted(): Promise<boolean>;
}
@ -3134,6 +3230,13 @@ interface WEBGL_lose_context {
restoreContext(): void;
}
interface WEBGL_multi_draw {
multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | GLint[], firstsOffset: GLuint, countsList: Int32Array | GLsizei[], countsOffset: GLuint, instanceCountsList: Int32Array | GLsizei[], instanceCountsOffset: GLuint, drawcount: GLsizei): void;
multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | GLint[], firstsOffset: GLuint, countsList: Int32Array | GLsizei[], countsOffset: GLuint, drawcount: GLsizei): void;
multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | GLint[], countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | GLsizei[], offsetsOffset: GLuint, instanceCountsList: Int32Array | GLsizei[], instanceCountsOffset: GLuint, drawcount: GLsizei): void;
multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | GLint[], countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | GLsizei[], offsetsOffset: GLuint, drawcount: GLsizei): void;
}
interface WebGL2RenderingContext extends WebGL2RenderingContextBase, WebGL2RenderingContextOverloads, WebGLRenderingContextBase {
}
@ -5075,7 +5178,7 @@ declare var WebSocket: {
/** This ServiceWorker API interface represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. The service worker client independently selects and uses a service worker for its own loading and sub-resources. */
interface WindowClient extends Client {
readonly focused: boolean;
readonly visibilityState: VisibilityState;
readonly visibilityState: DocumentVisibilityState;
focus(): Promise<WindowClient>;
navigate(url: string | URL): Promise<WindowClient | null>;
}
@ -5096,12 +5199,13 @@ interface WindowOrWorkerGlobalScope {
readonly performance: Performance;
atob(data: string): string;
btoa(data: string): string;
clearInterval(handle?: number): void;
clearTimeout(handle?: number): void;
clearInterval(id?: number): void;
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>;
queueMicrotask(callback: VoidFunction): void;
reportError(e: any): void;
setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
}
@ -5518,7 +5622,7 @@ declare namespace WebAssembly {
type ImportExportKind = "function" | "global" | "memory" | "table";
type TableKind = "anyfunc" | "externref";
type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64";
type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";
type ExportValue = Function | Global | Memory | Table;
type Exports = Record<string, ExportValue>;
type ImportValue = ExportValue | number;
@ -5536,6 +5640,10 @@ interface FrameRequestCallback {
(time: DOMHighResTimeStamp): void;
}
interface LockGrantedCallback {
(lock: Lock | null): any;
}
interface OnErrorEventHandlerNonNull {
(event: Event | string, source?: string, lineno?: number, colno?: number, error?: Error): any;
}
@ -5630,12 +5738,13 @@ declare var origin: string;
declare var performance: Performance;
declare function atob(data: string): string;
declare function btoa(data: string): string;
declare function clearInterval(handle?: number): void;
declare function clearTimeout(handle?: number): void;
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 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 cancelAnimationFrame(handle: number): void;
@ -5652,7 +5761,7 @@ type BodyInit = ReadableStream | XMLHttpRequestBodyInit;
type BufferSource = ArrayBufferView | ArrayBuffer;
type CanvasImageSource = ImageBitmap | OffscreenCanvas;
type DOMHighResTimeStamp = number;
type DOMTimeStamp = number;
type EpochTimeStamp = number;
type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
type Float32List = Float32Array | GLfloat[];
type FormDataEntryValue = File | string;
@ -5693,18 +5802,22 @@ type ClientTypes = "all" | "sharedworker" | "window" | "worker";
type ColorGamut = "p3" | "rec2020" | "srgb";
type ColorSpaceConversion = "default" | "none";
type ConnectionType = "bluetooth" | "cellular" | "ethernet" | "mixed" | "none" | "other" | "unknown" | "wifi";
type DocumentVisibilityState = "hidden" | "visible";
type EndingType = "native" | "transparent";
type FileSystemHandleKind = "directory" | "file";
type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded";
type FontFaceSetLoadStatus = "loaded" | "loading";
type FrameType = "auxiliary" | "nested" | "none" | "top-level";
type HdrMetadataType = "smpteSt2086" | "smpteSt2094-10" | "smpteSt2094-40";
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
type IDBRequestReadyState = "done" | "pending";
type IDBTransactionDurability = "default" | "relaxed" | "strict";
type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
type ImageOrientation = "flipY" | "none";
type KeyFormat = "jwk" | "pkcs8" | "raw" | "spki";
type KeyType = "private" | "public" | "secret";
type KeyUsage = "decrypt" | "deriveBits" | "deriveKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
type LockMode = "exclusive" | "shared";
type MediaDecodingType = "file" | "media-source" | "webrtc";
type MediaEncodingType = "record" | "webrtc";
type NotificationDirection = "auto" | "ltr" | "rtl";
@ -5714,7 +5827,6 @@ type PermissionState = "denied" | "granted" | "prompt";
type PredefinedColorSpace = "display-p3" | "srgb";
type PremultiplyAlpha = "default" | "none" | "premultiply";
type PushEncryptionKeyName = "auth" | "p256dh";
type PushPermissionState = "denied" | "granted" | "prompt";
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";
@ -5727,7 +5839,6 @@ type SecurityPolicyViolationEventDisposition = "enforce" | "report";
type ServiceWorkerState = "activated" | "activating" | "installed" | "installing" | "parsed" | "redundant";
type ServiceWorkerUpdateViaCache = "all" | "imports" | "none";
type TransferFunction = "hlg" | "pq" | "srgb";
type VisibilityState = "hidden" | "visible";
type WebGLPowerPreference = "default" | "high-performance" | "low-power";
type WorkerType = "classic" | "module";
type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";

View file

@ -100,6 +100,13 @@ interface WEBGL_draw_buffers {
drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
}
interface WEBGL_multi_draw {
multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, drawcount: GLsizei): void;
multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLint>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLint>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
}
interface WebGL2RenderingContextBase {
clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;

View file

@ -14,7 +14,7 @@ and limitations under the License.
***************************************************************************** */
declare namespace ts {
const versionMajorMinor = "4.5";
const versionMajorMinor = "4.6";
/** The version of the TypeScript compiler release */
const version: string;
/**
@ -572,7 +572,7 @@ declare namespace ts {
}
export interface JSDocContainer {
}
export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | EndOfFileToken;
export type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ClassStaticBlockDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | EmptyStatement | DebuggerStatement | Block | VariableStatement | ExpressionStatement | IfStatement | DoStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | BreakStatement | ContinueStatement | ReturnStatement | WithStatement | SwitchStatement | LabeledStatement | ThrowStatement | TryStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | VariableDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | ImportDeclaration | NamespaceExportDeclaration | ExportAssignment | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | NamedTupleMember | ExportSpecifier | EndOfFileToken;
export type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType;
export type HasTypeArguments = CallExpression | NewExpression | TaggedTemplateExpression | JsxOpeningElement | JsxSelfClosingElement;
export type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute;
@ -897,7 +897,7 @@ declare namespace ts {
export interface TypePredicateNode extends TypeNode {
readonly kind: SyntaxKind.TypePredicate;
readonly parent: SignatureDeclaration | JSDocTypeExpression;
readonly assertsModifier?: AssertsToken;
readonly assertsModifier?: AssertsKeyword;
readonly parameterName: Identifier | ThisTypeNode;
readonly type?: TypeNode;
}
@ -968,7 +968,7 @@ declare namespace ts {
}
export interface MappedTypeNode extends TypeNode, Declaration {
readonly kind: SyntaxKind.MappedType;
readonly readonlyToken?: ReadonlyToken | PlusToken | MinusToken;
readonly readonlyToken?: ReadonlyKeyword | PlusToken | MinusToken;
readonly typeParameter: TypeParameterDeclaration;
readonly nameType?: TypeNode;
readonly questionToken?: QuestionToken | PlusToken | MinusToken;
@ -1465,7 +1465,7 @@ declare namespace ts {
}
export interface ForOfStatement extends IterationStatement {
readonly kind: SyntaxKind.ForOfStatement;
readonly awaitModifier?: AwaitKeywordToken;
readonly awaitModifier?: AwaitKeyword;
readonly initializer: ForInitializer;
readonly expression: Expression;
}
@ -1652,7 +1652,7 @@ declare namespace ts {
readonly kind: SyntaxKind.AssertEntry;
readonly parent: AssertClause;
readonly name: AssertionKey;
readonly value: StringLiteral;
readonly value: Expression;
}
export interface AssertClause extends Node {
readonly kind: SyntaxKind.AssertClause;
@ -1702,7 +1702,7 @@ declare namespace ts {
readonly name: Identifier;
readonly isTypeOnly: boolean;
}
export interface ExportSpecifier extends NamedDeclaration {
export interface ExportSpecifier extends NamedDeclaration, JSDocContainer {
readonly kind: SyntaxKind.ExportSpecifier;
readonly parent: NamedExports;
readonly isTypeOnly: boolean;
@ -1720,19 +1720,23 @@ declare namespace ts {
readonly parent: ImportClause & {
readonly isTypeOnly: true;
};
} | ImportSpecifier & {
} | ImportSpecifier & ({
readonly isTypeOnly: true;
} | {
readonly parent: NamedImports & {
readonly parent: ImportClause & {
readonly isTypeOnly: true;
};
};
} | ExportSpecifier & {
}) | ExportSpecifier & ({
readonly isTypeOnly: true;
} | {
readonly parent: NamedExports & {
readonly parent: ExportDeclaration & {
readonly isTypeOnly: true;
};
};
};
});
/**
* This is either an `export =` or an `export default` declaration.
* Unless `isExportEquals` is set, this node was parsed as an `export default`.
@ -3078,6 +3082,7 @@ declare namespace ts {
ES2019 = 6,
ES2020 = 7,
ES2021 = 8,
ES2022 = 9,
ESNext = 99,
JSON = 100,
Latest = 99
@ -3343,7 +3348,7 @@ declare namespace ts {
createTrue(): TrueLiteral;
createFalse(): FalseLiteral;
createModifier<T extends ModifierSyntaxKind>(kind: T): ModifierToken<T>;
createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[];
createModifiersFromModifierFlags(flags: ModifierFlags): Modifier[] | undefined;
createQualifiedName(left: EntityName, right: string | Identifier): QualifiedName;
updateQualifiedName(node: QualifiedName, left: EntityName, right: Identifier): QualifiedName;
createComputedPropertyName(expression: Expression): ComputedPropertyName;
@ -3575,8 +3580,8 @@ declare namespace ts {
updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause;
createAssertClause(elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause;
updateAssertClause(node: AssertClause, elements: NodeArray<AssertEntry>, multiLine?: boolean): AssertClause;
createAssertEntry(name: AssertionKey, value: StringLiteral): AssertEntry;
updateAssertEntry(node: AssertEntry, name: AssertionKey, value: StringLiteral): AssertEntry;
createAssertEntry(name: AssertionKey, value: Expression): AssertEntry;
updateAssertEntry(node: AssertEntry, name: AssertionKey, value: Expression): AssertEntry;
createNamespaceImport(name: Identifier): NamespaceImport;
updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport;
createNamespaceExport(name: Identifier): NamespaceExport;
@ -5351,7 +5356,11 @@ declare namespace ts {
traceResolution?: boolean;
[option: string]: CompilerOptionsValue | undefined;
}
type ReportEmitErrorSummary = (errorCount: number) => void;
type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void;
interface ReportFileInError {
fileName: string;
line: number;
}
interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
createDirectory?(path: string): void;
/**
@ -5559,6 +5568,7 @@ declare namespace ts {
isTypeParameter(): this is TypeParameter;
isClassOrInterface(): this is InterfaceType;
isClass(): this is InterfaceType;
isIndexType(): this is IndexType;
}
interface TypeReference {
typeArguments?: readonly Type[];
@ -5567,6 +5577,7 @@ declare namespace ts {
getDeclaration(): SignatureDeclaration;
getTypeParameters(): TypeParameter[] | undefined;
getParameters(): Symbol[];
getTypeParameterAtPosition(pos: number): Type;
getReturnType(): Type;
getDocumentationComment(typeChecker: TypeChecker | undefined): SymbolDisplayPart[];
getJsDocTags(): JSDocTagInfo[];
@ -5753,8 +5764,9 @@ declare namespace ts {
* @param position A zero-based index of the character where you want the entries
* @param options An object describing how the request was triggered and what kinds
* of code actions can be returned with the completions.
* @param formattingSettings settings needed for calling formatting functions.
*/
getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): WithMetadata<CompletionInfo> | undefined;
getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined, formattingSettings?: FormatCodeSettings): WithMetadata<CompletionInfo> | undefined;
/**
* Gets the extended details for a completion entry retrieved from `getCompletionsAtPosition`.
*
@ -6586,6 +6598,7 @@ declare namespace ts {
externalModuleName = "external module name",
/**
* <JsxTagName attribute1 attribute2={0} />
* @deprecated
*/
jsxAttribute = "JSX attribute",
/** String literal */
@ -6855,7 +6868,7 @@ declare namespace ts {
/** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */
const createModifier: <T extends ModifierSyntaxKind>(kind: T) => ModifierToken<T>;
/** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */
const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[];
const createModifiersFromModifierFlags: (flags: ModifierFlags) => Modifier[] | undefined;
/** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */
const createQualifiedName: (left: EntityName, right: string | Identifier) => QualifiedName;
/** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */

View file

@ -1,5 +1,6 @@
function a() {
throw new Error("foo", { cause: new Error("bar", { cause: "deno" }) });
// deno-lint-ignore no-explicit-any
throw new Error("foo", { cause: new Error("bar", { cause: "deno" as any }) });
}
function b() {

View file

@ -1,17 +1,17 @@
[WILDCARD]
error: Uncaught Error: foo
throw new Error("foo", { cause: new Error("bar", { cause: "deno" }) });
throw new Error("foo", { cause: new Error("bar", { cause: "deno" as any }) });
^
at a (file:///[WILDCARD]/error_cause.ts:2:9)
at b (file:///[WILDCARD]/error_cause.ts:6:3)
at c (file:///[WILDCARD]/error_cause.ts:10:3)
at file:///[WILDCARD]/error_cause.ts:13:1
at a (file:///[WILDCARD]/error_cause.ts:3:9)
at b (file:///[WILDCARD]/error_cause.ts:7:3)
at c (file:///[WILDCARD]/error_cause.ts:11:3)
at file:///[WILDCARD]/error_cause.ts:14:1
Caused by: Uncaught Error: bar
throw new Error("foo", { cause: new Error("bar", { cause: "deno" }) });
throw new Error("foo", { cause: new Error("bar", { cause: "deno" as any }) });
^
at a (file:///[WILDCARD]/error_cause.ts:2:35)
at b (file:///[WILDCARD]/error_cause.ts:6:3)
at c (file:///[WILDCARD]/error_cause.ts:10:3)
at file:///[WILDCARD]/error_cause.ts:13:1
at a (file:///[WILDCARD]/error_cause.ts:3:35)
at b (file:///[WILDCARD]/error_cause.ts:7:3)
at c (file:///[WILDCARD]/error_cause.ts:11:3)
at file:///[WILDCARD]/error_cause.ts:14:1
Caused by: Uncaught deno
[WILDCARD]

View file

@ -1,6 +1,6 @@
[
{
"title": "Import 'abc' from module \"./file00.ts\"",
"title": "Add import from \"./file00.ts\"",
"kind": "quickfix",
"diagnostics": [
{
@ -120,7 +120,7 @@
}
},
{
"title": "Import 'def' from module \"./file00.ts\"",
"title": "Add import from \"./file00.ts\"",
"kind": "quickfix",
"diagnostics": [
{

View file

@ -128,6 +128,29 @@
"actionName": "Convert namespace import to named imports"
}
},
{
"title": "Convert named imports to default import",
"kind": "refactor.rewrite.import.default",
"isPreferred": false,
"disabled": {
"reason": "Selection is not an import declaration."
},
"data": {
"specifier": "file:///a/file.ts",
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 1,
"character": 0
}
},
"refactorName": "Convert import",
"actionName": "Convert named imports to default import"
}
},
{
"title": "Convert named imports to namespace import",
"kind": "refactor.rewrite.import.namespace",
@ -150,28 +173,5 @@
"refactorName": "Convert import",
"actionName": "Convert named imports to namespace import"
}
},
{
"title": "Convert to optional chain expression",
"kind": "refactor.rewrite.expression.optionalChain",
"isPreferred": false,
"disabled": {
"reason": "Could not find convertible access expression"
},
"data": {
"specifier": "file:///a/file.ts",
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 1,
"character": 0
}
},
"refactorName": "Convert to optional chain expression",
"actionName": "Convert to optional chain expression"
}
}
]

View file

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

View file

@ -1,29 +1,15 @@
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
import { assert, assertEquals } from "./test_util.ts";
import { assertEquals } from "./test_util.ts";
// TODO(@kitsonk) remove when we are no longer patching TypeScript to have
// these types available.
Deno.test(function typeCheckingEsNextArrayString() {
const a = "abcdef";
assertEquals(a.at(-1), "f");
const b = ["a", "b", "c", "d", "e", "f"];
assertEquals(b.at(-1), "f");
assertEquals(b.findLast((val) => typeof val === "string"), "f");
assertEquals(b.findLastIndex((val) => typeof val === "string"), 5);
});
Deno.test(function objectHasOwn() {
const a = { a: 1 };
assert(Object.hasOwn(a, "a"));
assert(!Object.hasOwn(a, "b"));
});
Deno.test(function errorCause() {
const e = new Error("test", { cause: "something" });
assertEquals(e.cause, "something");
});
Deno.test(function intlListFormat() {
const formatter = new Intl.ListFormat("en", {
style: "long",

View file

@ -96,6 +96,7 @@ pub(crate) static STATIC_ASSETS: Lazy<HashMap<&'static str, &'static str>> =
("lib.es2019.full.d.ts", inc!("lib.es2019.full.d.ts")),
("lib.es2020.full.d.ts", inc!("lib.es2020.full.d.ts")),
("lib.es2021.full.d.ts", inc!("lib.es2021.full.d.ts")),
("lib.es2022.full.d.ts", inc!("lib.es2022.full.d.ts")),
("lib.esnext.full.d.ts", inc!("lib.esnext.full.d.ts")),
("lib.scripthost.d.ts", inc!("lib.scripthost.d.ts")),
("lib.webworker.d.ts", inc!("lib.webworker.d.ts")),

8529
cli/tsc/00_typescript.js vendored

File diff suppressed because it is too large Load diff