Skip to content
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

Migrate latest dom types into libdom.d.ts #44684

Merged
merged 4 commits into from
Jun 25, 2021
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
5,108 changes: 2,070 additions & 3,038 deletions src/lib/dom.generated.d.ts

Large diffs are not rendered by default.

52 changes: 33 additions & 19 deletions src/lib/dom.iterable.generated.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/////////////////////////////
/// DOM Iterable APIs
/// Window Iterable APIs
/////////////////////////////

interface AudioParam {
Expand Down Expand Up @@ -30,10 +30,6 @@ interface CanvasPathDrawingStyles {
setLineDash(segments: Iterable<number>): void;
}

interface ClientRectList {
[Symbol.iterator](): IterableIterator<ClientRect>;
}

interface DOMRectList {
[Symbol.iterator](): IterableIterator<DOMRect>;
}
Expand All @@ -57,6 +53,9 @@ interface FileList {
[Symbol.iterator](): IterableIterator<File>;
}

interface FontFaceSet extends Set<FontFace> {
}

interface FormData {
[Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
/**
Expand Down Expand Up @@ -136,8 +135,13 @@ interface MediaList {
[Symbol.iterator](): IterableIterator<string>;
}

interface MessageEvent<T = any> {
/** @deprecated */
initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
}

interface MimeTypeArray {
[Symbol.iterator](): IterableIterator<MimeType>;
[Symbol.iterator](): IterableIterator<any>;
}

interface NamedNodeMap {
Expand All @@ -146,6 +150,7 @@ interface NamedNodeMap {

interface Navigator {
requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: Iterable<MediaKeySystemConfiguration>): Promise<MediaKeySystemAccess>;
vibrate(pattern: Iterable<number>): boolean;
}

interface NodeList {
Expand Down Expand Up @@ -181,18 +186,21 @@ interface NodeListOf<TNode extends Node> {
}

interface Plugin {
[Symbol.iterator](): IterableIterator<MimeType>;
[Symbol.iterator](): IterableIterator<undefined>;
}

interface PluginArray {
[Symbol.iterator](): IterableIterator<Plugin>;
[Symbol.iterator](): IterableIterator<any>;
}

interface RTCRtpTransceiver {
setCodecPreferences(codecs: Iterable<RTCRtpCodecCapability>): void;
interface RTCStatsReport extends ReadonlyMap<string, any> {
}

interface RTCStatsReport extends ReadonlyMap<string, any> {
interface ReadableStream<R = any> {
[Symbol.iterator](): IterableIterator<any>;
entries(): IterableIterator<[number, any]>;
keys(): IterableIterator<number>;
values(): IterableIterator<any>;
}

interface SVGLengthList {
Expand All @@ -211,12 +219,12 @@ interface SVGStringList {
[Symbol.iterator](): IterableIterator<string>;
}

interface SourceBufferList {
[Symbol.iterator](): IterableIterator<SourceBuffer>;
interface SVGTransformList {
[Symbol.iterator](): IterableIterator<SVGTransform>;
}

interface SpeechGrammarList {
[Symbol.iterator](): IterableIterator<SpeechGrammar>;
interface SourceBufferList {
[Symbol.iterator](): IterableIterator<SourceBuffer>;
}

interface SpeechRecognitionResult {
Expand All @@ -231,6 +239,16 @@ interface StyleSheetList {
[Symbol.iterator](): IterableIterator<CSSStyleSheet>;
}

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

interface TextTrackCueList {
[Symbol.iterator](): IterableIterator<TextTrackCue>;
}
Expand Down Expand Up @@ -259,10 +277,6 @@ interface URLSearchParams {
values(): IterableIterator<string>;
}

interface VRDisplay {
requestPresent(layers: Iterable<VRLayer>): Promise<void>;
}

interface WEBGL_draw_buffers {
drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/customEventDetail.types
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ var x: CustomEvent;
// valid since detail is any
x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' });
>x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' }) : void
>x.initCustomEvent : (typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any) => void
>x.initCustomEvent : (type: string, bubbles?: boolean, cancelable?: boolean, detail?: any) => void
>x : CustomEvent<any>
>initCustomEvent : (typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any) => void
>initCustomEvent : (type: string, bubbles?: boolean, cancelable?: boolean, detail?: any) => void
>'hello' : "hello"
>true : true
>true : true
Expand Down
8 changes: 4 additions & 4 deletions tests/baselines/reference/elaboratedErrors.symbols
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=== tests/cases/compiler/elaboratedErrors.ts ===
interface FileSystem {
>FileSystem : Symbol(FileSystem, Decl(elaboratedErrors.ts, 0, 0))
>FileSystem : Symbol(FileSystem, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(elaboratedErrors.ts, 0, 0))

read: number;
>read : Symbol(FileSystem.read, Decl(elaboratedErrors.ts, 0, 22))
Expand All @@ -14,18 +14,18 @@ function fn(s: WorkerFS): void;
function fn(s: FileSystem): void;
>fn : Symbol(fn, Decl(elaboratedErrors.ts, 2, 1), Decl(elaboratedErrors.ts, 4, 31), Decl(elaboratedErrors.ts, 5, 33))
>s : Symbol(s, Decl(elaboratedErrors.ts, 5, 12))
>FileSystem : Symbol(FileSystem, Decl(elaboratedErrors.ts, 0, 0))
>FileSystem : Symbol(FileSystem, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(elaboratedErrors.ts, 0, 0))

function fn(s: FileSystem|WorkerFS) { }
>fn : Symbol(fn, Decl(elaboratedErrors.ts, 2, 1), Decl(elaboratedErrors.ts, 4, 31), Decl(elaboratedErrors.ts, 5, 33))
>s : Symbol(s, Decl(elaboratedErrors.ts, 6, 12))
>FileSystem : Symbol(FileSystem, Decl(elaboratedErrors.ts, 0, 0))
>FileSystem : Symbol(FileSystem, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(elaboratedErrors.ts, 0, 0))
>WorkerFS : Symbol(WorkerFS, Decl(elaboratedErrors.ts, 6, 39))

// This should issue a large error, not a small one
class WorkerFS implements FileSystem {
>WorkerFS : Symbol(WorkerFS, Decl(elaboratedErrors.ts, 6, 39))
>FileSystem : Symbol(FileSystem, Decl(elaboratedErrors.ts, 0, 0))
>FileSystem : Symbol(FileSystem, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(elaboratedErrors.ts, 0, 0))

read: string;
>read : Symbol(WorkerFS.read, Decl(elaboratedErrors.ts, 9, 38))
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>new URL("../hamsters.jpg", import.meta.url).toString() : string
>new URL("../hamsters.jpg", import.meta.url).toString : () => string
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : string
>import.meta : ImportMeta
Expand Down Expand Up @@ -54,7 +54,7 @@
>src : string
>URL.createObjectURL(blob) : string
>URL.createObjectURL : (object: any) => string
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>createObjectURL : (object: any) => string
>blob : Blob

Expand All @@ -71,11 +71,11 @@

document.body.appendChild(image);
>document.body.appendChild(image) : HTMLImageElement
>document.body.appendChild : <T extends Node>(newChild: T) => T
>document.body.appendChild : <T extends Node>(node: T) => T
>document.body : HTMLElement
>document : Document
>body : HTMLElement
>appendChild : <T extends Node>(newChild: T) => T
>appendChild : <T extends Node>(node: T) => T
>image : HTMLImageElement

})();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>new URL("../hamsters.jpg", import.meta.url).toString() : string
>new URL("../hamsters.jpg", import.meta.url).toString : () => string
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : string
>import.meta : ImportMeta
Expand Down Expand Up @@ -54,7 +54,7 @@
>src : string
>URL.createObjectURL(blob) : string
>URL.createObjectURL : (object: any) => string
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>createObjectURL : (object: any) => string
>blob : Blob

Expand All @@ -71,11 +71,11 @@

document.body.appendChild(image);
>document.body.appendChild(image) : HTMLImageElement
>document.body.appendChild : <T extends Node>(newChild: T) => T
>document.body.appendChild : <T extends Node>(node: T) => T
>document.body : HTMLElement
>document : Document
>body : HTMLElement
>appendChild : <T extends Node>(newChild: T) => T
>appendChild : <T extends Node>(node: T) => T
>image : HTMLImageElement

})();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>new URL("../hamsters.jpg", import.meta.url).toString() : string
>new URL("../hamsters.jpg", import.meta.url).toString : () => string
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : string
>import.meta : ImportMeta
Expand Down Expand Up @@ -54,7 +54,7 @@
>src : string
>URL.createObjectURL(blob) : string
>URL.createObjectURL : (object: any) => string
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>createObjectURL : (object: any) => string
>blob : Blob

Expand All @@ -71,11 +71,11 @@

document.body.appendChild(image);
>document.body.appendChild(image) : HTMLImageElement
>document.body.appendChild : <T extends Node>(newChild: T) => T
>document.body.appendChild : <T extends Node>(node: T) => T
>document.body : HTMLElement
>document : Document
>body : HTMLElement
>appendChild : <T extends Node>(newChild: T) => T
>appendChild : <T extends Node>(node: T) => T
>image : HTMLImageElement

})();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>new URL("../hamsters.jpg", import.meta.url).toString() : string
>new URL("../hamsters.jpg", import.meta.url).toString : () => string
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : string
>import.meta : ImportMeta
Expand Down Expand Up @@ -54,7 +54,7 @@
>src : string
>URL.createObjectURL(blob) : string
>URL.createObjectURL : (object: any) => string
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>createObjectURL : (object: any) => string
>blob : Blob

Expand All @@ -71,11 +71,11 @@

document.body.appendChild(image);
>document.body.appendChild(image) : HTMLImageElement
>document.body.appendChild : <T extends Node>(newChild: T) => T
>document.body.appendChild : <T extends Node>(node: T) => T
>document.body : HTMLElement
>document : Document
>body : HTMLElement
>appendChild : <T extends Node>(newChild: T) => T
>appendChild : <T extends Node>(node: T) => T
>image : HTMLImageElement

})();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>new URL("../hamsters.jpg", import.meta.url).toString() : string
>new URL("../hamsters.jpg", import.meta.url).toString : () => string
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : string
>import.meta : ImportMeta
Expand Down Expand Up @@ -54,7 +54,7 @@
>src : string
>URL.createObjectURL(blob) : string
>URL.createObjectURL : (object: any) => string
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>createObjectURL : (object: any) => string
>blob : Blob

Expand All @@ -71,11 +71,11 @@

document.body.appendChild(image);
>document.body.appendChild(image) : HTMLImageElement
>document.body.appendChild : <T extends Node>(newChild: T) => T
>document.body.appendChild : <T extends Node>(node: T) => T
>document.body : HTMLElement
>document : Document
>body : HTMLElement
>appendChild : <T extends Node>(newChild: T) => T
>appendChild : <T extends Node>(node: T) => T
>image : HTMLImageElement

})();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>new URL("../hamsters.jpg", import.meta.url).toString() : string
>new URL("../hamsters.jpg", import.meta.url).toString : () => string
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : string
>import.meta : ImportMeta
Expand Down Expand Up @@ -54,7 +54,7 @@
>src : string
>URL.createObjectURL(blob) : string
>URL.createObjectURL : (object: any) => string
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>createObjectURL : (object: any) => string
>blob : Blob

Expand All @@ -71,11 +71,11 @@

document.body.appendChild(image);
>document.body.appendChild(image) : HTMLImageElement
>document.body.appendChild : <T extends Node>(newChild: T) => T
>document.body.appendChild : <T extends Node>(node: T) => T
>document.body : HTMLElement
>document : Document
>body : HTMLElement
>appendChild : <T extends Node>(newChild: T) => T
>appendChild : <T extends Node>(node: T) => T
>image : HTMLImageElement

})();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>new URL("../hamsters.jpg", import.meta.url).toString() : string
>new URL("../hamsters.jpg", import.meta.url).toString : () => string
>new URL("../hamsters.jpg", import.meta.url) : URL
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : string
>import.meta : ImportMeta
Expand Down Expand Up @@ -54,7 +54,7 @@
>src : string
>URL.createObjectURL(blob) : string
>URL.createObjectURL : (object: any) => string
>URL : { new (url: string, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>URL : { new (url: string | URL, base?: string | URL): URL; prototype: URL; createObjectURL(object: any): string; revokeObjectURL(url: string): void; }
>createObjectURL : (object: any) => string
>blob : Blob

Expand All @@ -71,11 +71,11 @@

document.body.appendChild(image);
>document.body.appendChild(image) : HTMLImageElement
>document.body.appendChild : <T extends Node>(newChild: T) => T
>document.body.appendChild : <T extends Node>(node: T) => T
>document.body : HTMLElement
>document : Document
>body : HTMLElement
>appendChild : <T extends Node>(newChild: T) => T
>appendChild : <T extends Node>(node: T) => T
>image : HTMLImageElement

})();
Expand Down
Loading