Skip to content

Update lib dom for 4.2 #42067

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 4, 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
441 changes: 268 additions & 173 deletions src/lib/dom.generated.d.ts

Large diffs are not rendered by default.

253 changes: 114 additions & 139 deletions src/lib/webworker.generated.d.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/baselines/reference/copyrightWithNewLine1.types
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import model = require("./greeter")
var el = document.getElementById('content');
>el : HTMLElement
>document.getElementById('content') : HTMLElement
>document.getElementById : (elementId: string) => HTMLElement
>document.getElementById : <E extends Element = HTMLElement>(elementId: string) => E
>document : Document
>getElementById : (elementId: string) => HTMLElement
>getElementById : <E extends Element = HTMLElement>(elementId: string) => E
>'content' : "content"

var greeter = new model.Greeter(el);
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/copyrightWithoutNewLine1.types
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import model = require("./greeter")
var el = document.getElementById('content');
>el : HTMLElement
>document.getElementById('content') : HTMLElement
>document.getElementById : (elementId: string) => HTMLElement
>document.getElementById : <E extends Element = HTMLElement>(elementId: string) => E
>document : Document
>getElementById : (elementId: string) => HTMLElement
>getElementById : <E extends Element = HTMLElement>(elementId: string) => E
>'content' : "content"

var greeter = new model.Greeter(el);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ declare var document: Document;

interface Document {
getElementById(elementId: string): HTMLElement;
>getElementById : { (elementId: string): HTMLElement; (elementId: string): HTMLElement; }
>getElementById : { <E extends Element = HTMLElement>(elementId: string): E; (elementId: string): HTMLElement; }
>elementId : string
}

Expand All @@ -36,9 +36,9 @@ var elements = names.map(function (name) {

return document.getElementById(name);
>document.getElementById(name) : HTMLElement
>document.getElementById : { (elementId: string): HTMLElement; (elementId: string): HTMLElement; }
>document.getElementById : { <E extends Element = HTMLElement>(elementId: string): E; (elementId: string): HTMLElement; }
>document : Document
>getElementById : { (elementId: string): HTMLElement; (elementId: string): HTMLElement; }
>getElementById : { <E extends Element = HTMLElement>(elementId: string): E; (elementId: string): HTMLElement; }
>name : string

});
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS236
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
tests/cases/conformance/es2019/importMeta/example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
tests/cases/conformance/es2019/importMeta/example.ts(3,71): error TS2339: Property 'url' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(1,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
Expand All @@ -25,16 +24,14 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS


!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/conformance/es2019/importMeta/example.ts (5 errors) ====
==== tests/cases/conformance/es2019/importMeta/example.ts (4 errors) ====
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
(async () => {
~~~~~~~~~~~~~
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
~~~~~~~~~~~
!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
~~~
!!! error TS2339: Property 'url' does not exist on type 'ImportMeta'.
const blob = await response.blob();

const size = import.meta.scriptElement.dataset.size || 300;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
>fetch : Symbol(fetch, Decl(lib.dom.d.ts, --, --))
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))

const blob = await response.blob();
Expand Down Expand Up @@ -72,7 +74,7 @@ let globalC = import.import.import.malkovich;
=== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts ===
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))

import.meta = foo;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
Expand All @@ -82,7 +84,7 @@ declare global {
>global : Symbol(global, Decl(assignmentTargets.ts, 1, 18))

interface ImportMeta {
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))

wellKnownProperty: { a: number, b: string, c: boolean };
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
>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; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : any
>import.meta.url : string
>import.meta : ImportMeta
>meta : any
>url : any
>url : string
>toString : () => string

const blob = await response.blob();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS236
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(11,21): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
tests/cases/conformance/es2019/importMeta/example.ts(3,59): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
tests/cases/conformance/es2019/importMeta/example.ts(3,71): error TS2339: Property 'url' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/example.ts(6,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(1,16): error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
Expand All @@ -25,16 +24,14 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS


!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/conformance/es2019/importMeta/example.ts (5 errors) ====
==== tests/cases/conformance/es2019/importMeta/example.ts (4 errors) ====
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
(async () => {
~~~~~~~~~~~~~
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
~~~~~~~~~~~
!!! error TS1343: The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'esnext', or 'system'.
~~~
!!! error TS2339: Property 'url' does not exist on type 'ImportMeta'.
const blob = await response.blob();

const size = import.meta.scriptElement.dataset.size || 300;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
>fetch : Symbol(fetch, Decl(lib.dom.d.ts, --, --))
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))

const blob = await response.blob();
Expand Down Expand Up @@ -72,7 +74,7 @@ let globalC = import.import.import.malkovich;
=== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts ===
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))

import.meta = foo;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
Expand All @@ -82,7 +84,7 @@ declare global {
>global : Symbol(global, Decl(assignmentTargets.ts, 1, 18))

interface ImportMeta {
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))

wellKnownProperty: { a: number, b: string, c: boolean };
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
>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; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : any
>import.meta.url : string
>import.meta : ImportMeta
>meta : any
>url : any
>url : string
>toString : () => string

const blob = await response.blob();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,44): error TS23
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
tests/cases/conformance/es2019/importMeta/example.ts(3,71): error TS2339: Property 'url' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
Expand All @@ -12,14 +11,12 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS


!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/conformance/es2019/importMeta/example.ts (3 errors) ====
==== tests/cases/conformance/es2019/importMeta/example.ts (2 errors) ====
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
(async () => {
~~~~~~~~~~~~~
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
~~~
!!! error TS2339: Property 'url' does not exist on type 'ImportMeta'.
const blob = await response.blob();

const size = import.meta.scriptElement.dataset.size || 300;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
>fetch : Symbol(fetch, Decl(lib.dom.d.ts, --, --))
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))

const blob = await response.blob();
Expand Down Expand Up @@ -72,7 +74,7 @@ let globalC = import.import.import.malkovich;
=== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts ===
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))

import.meta = foo;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
Expand All @@ -82,7 +84,7 @@ declare global {
>global : Symbol(global, Decl(assignmentTargets.ts, 1, 18))

interface ImportMeta {
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))

wellKnownProperty: { a: number, b: string, c: boolean };
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
>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; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : any
>import.meta.url : string
>import.meta : ImportMeta
>meta : any
>url : any
>url : string
>toString : () => string

const blob = await response.blob();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,44): error TS23
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(1,63): error TS2339: Property 'blue' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/assignmentTargets.ts(2,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access.
tests/cases/conformance/es2019/importMeta/example.ts(2,2): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
tests/cases/conformance/es2019/importMeta/example.ts(3,71): error TS2339: Property 'url' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/example.ts(6,28): error TS2339: Property 'scriptElement' does not exist on type 'ImportMeta'.
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(2,23): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
tests/cases/conformance/es2019/importMeta/moduleLookingFile01.ts(3,23): error TS17012: 'import' is not a valid meta-property for keyword 'import'. Did you mean 'meta'?
Expand All @@ -12,14 +11,12 @@ tests/cases/conformance/es2019/importMeta/scriptLookingFile01.ts(3,22): error TS


!!! error TS2468: Cannot find global value 'Promise'.
==== tests/cases/conformance/es2019/importMeta/example.ts (3 errors) ====
==== tests/cases/conformance/es2019/importMeta/example.ts (2 errors) ====
// Adapted from https://github.com/tc39/proposal-import-meta/tree/c3902a9ffe2e69a7ac42c19d7ea74cbdcea9b7fb#example
(async () => {
~~~~~~~~~~~~~
!!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
const response = await fetch(new URL("../hamsters.jpg", import.meta.url).toString());
~~~
!!! error TS2339: Property 'url' does not exist on type 'ImportMeta'.
const blob = await response.blob();

const size = import.meta.scriptElement.dataset.size || 300;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
>fetch : Symbol(fetch, Decl(lib.dom.d.ts, --, --))
>new URL("../hamsters.jpg", import.meta.url).toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))
>URL : Symbol(URL, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
>import.meta.url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>url : Symbol(ImportMeta.url, Decl(lib.dom.d.ts, --, --))
>toString : Symbol(URL.toString, Decl(lib.dom.d.ts, --, --))

const blob = await response.blob();
Expand Down Expand Up @@ -72,7 +74,7 @@ let globalC = import.import.import.malkovich;
=== tests/cases/conformance/es2019/importMeta/assignmentTargets.ts ===
export const foo: ImportMeta = import.meta.blah = import.meta.blue = import.meta;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))

import.meta = foo;
>foo : Symbol(foo, Decl(assignmentTargets.ts, 0, 12))
Expand All @@ -82,7 +84,7 @@ declare global {
>global : Symbol(global, Decl(assignmentTargets.ts, 1, 18))

interface ImportMeta {
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))
>ImportMeta : Symbol(ImportMeta, Decl(lib.es5.d.ts, --, --), Decl(lib.dom.d.ts, --, --), Decl(assignmentTargets.ts, 4, 16))

wellKnownProperty: { a: number, b: string, c: boolean };
>wellKnownProperty : Symbol(ImportMeta.wellKnownProperty, Decl(assignmentTargets.ts, 5, 24))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
>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; }
>"../hamsters.jpg" : "../hamsters.jpg"
>import.meta.url : any
>import.meta.url : string
>import.meta : ImportMeta
>meta : any
>url : any
>url : string
>toString : () => string

const blob = await response.blob();
Expand Down
Loading