Skip to content

Update TypeScript DOM Libs #47445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 145 additions & 59 deletions src/lib/dom.generated.d.ts

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/lib/dom.iterable.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,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;
Expand Down
97 changes: 80 additions & 17 deletions src/lib/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ interface CloseEventInit extends EventInit {
}

interface CryptoKeyPair {
privateKey?: CryptoKey;
publicKey?: CryptoKey;
privateKey: CryptoKey;
publicKey: CryptoKey;
}

interface CustomEventInit<T = any> extends EventInit {
Expand Down Expand Up @@ -190,6 +190,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;
Expand Down Expand Up @@ -353,7 +365,7 @@ interface NotificationOptions {
requireInteraction?: boolean;
silent?: boolean;
tag?: string;
timestamp?: DOMTimeStamp;
timestamp?: EpochTimeStamp;
vibrate?: VibratePattern;
}

Expand Down Expand Up @@ -402,7 +414,7 @@ interface PushEventInit extends ExtendableEventInit {

interface PushSubscriptionJSON {
endpoint?: string;
expirationTime?: DOMTimeStamp | null;
expirationTime?: EpochTimeStamp | null;
keys?: Record<string, string>;
}

Expand Down Expand Up @@ -558,7 +570,7 @@ interface StreamPipeOptions {
}

interface StructuredSerializeOptions {
transfer?: any[];
transfer?: Transferable[];
}

interface TextDecodeOptions {
Expand Down Expand Up @@ -645,7 +657,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: {
Expand All @@ -671,7 +683,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 {
Expand Down Expand Up @@ -885,6 +897,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: {
Expand Down Expand Up @@ -1338,8 +1352,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;
}

Expand Down Expand Up @@ -1498,6 +1514,41 @@ declare var FileReaderSync: {
new(): FileReaderSync;
};

/** Available only in secure contexts. */
interface FileSystemDirectoryHandle extends FileSystemHandle {
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 {
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;
Expand Down Expand Up @@ -1961,6 +2012,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. */
Expand Down Expand Up @@ -2461,7 +2513,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>;
}

Expand Down Expand Up @@ -2778,6 +2830,7 @@ declare var SharedWorkerGlobalScope: {
/** Available only in secure contexts. */
interface StorageManager {
estimate(): Promise<StorageEstimate>;
getDirectory(): Promise<FileSystemDirectoryHandle>;
persisted(): Promise<boolean>;
}

Expand Down Expand Up @@ -3114,6 +3167,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 {
}

Expand Down Expand Up @@ -5055,7 +5115,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>;
}
Expand All @@ -5076,12 +5136,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;
}
Expand Down Expand Up @@ -5498,7 +5559,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;
Expand Down Expand Up @@ -5610,12 +5671,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;
Expand All @@ -5632,7 +5694,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;
Expand Down Expand Up @@ -5673,13 +5735,16 @@ 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";
Expand All @@ -5694,7 +5759,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";
Expand All @@ -5707,7 +5771,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";
7 changes: 7 additions & 0 deletions src/lib/webworker.iterable.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,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;
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/extendArray.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ tests/cases/compiler/extendArray.ts(7,32): error TS2552: Cannot find name '_elem
collect(fn:(e:_element) => _element[]) : any[];
~~~~~~~~
!!! error TS2552: Cannot find name '_element'. Did you mean 'Element'?
!!! related TS2728 /.ts/lib.dom.d.ts:4829:13: 'Element' is declared here.
!!! related TS2728 /.ts/lib.dom.d.ts:4844:13: 'Element' is declared here.
~~~~~~~~
!!! error TS2552: Cannot find name '_element'. Did you mean 'Element'?
!!! related TS2728 /.ts/lib.dom.d.ts:4829:13: 'Element' is declared here.
!!! related TS2728 /.ts/lib.dom.d.ts:4844:13: 'Element' is declared here.
}
}

Expand Down
Loading