Skip to content

Commit d6f2e35

Browse files
Update to TypeScript 3.5.1.
1 parent 56d9be0 commit d6f2e35

24 files changed

+62100
-62288
lines changed

tsserver/enu/diagnosticMessages.generated.json.lcg

-7,382
This file was deleted.

tsserver/lib.dom.d.ts

+851-541
Large diffs are not rendered by default.

tsserver/lib.dom.iterable.d.ts

+4
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ interface SVGNumberList {
186186
[Symbol.iterator](): IterableIterator<SVGNumber>;
187187
}
188188

189+
interface SVGPointList {
190+
[Symbol.iterator](): IterableIterator<DOMPoint>;
191+
}
192+
189193
interface SVGStringList {
190194
[Symbol.iterator](): IterableIterator<string>;
191195
}

tsserver/lib.es2015.core.d.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface Array<T> {
2929
* predicate. If it is not provided, undefined is used instead.
3030
*/
3131
find<S extends T>(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;
32-
find(predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): T | undefined;
32+
find(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined;
3333

3434
/**
3535
* Returns the index of the first element in the array where predicate is true, and -1
@@ -40,7 +40,7 @@ interface Array<T> {
4040
* @param thisArg If provided, it will be used as the this value for each invocation of
4141
* predicate. If it is not provided, undefined is used instead.
4242
*/
43-
findIndex(predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): number;
43+
findIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;
4444

4545
/**
4646
* Returns the this object after filling the section identified by start and end with value
@@ -318,6 +318,12 @@ interface ObjectConstructor {
318318
*/
319319
getOwnPropertySymbols(o: any): symbol[];
320320

321+
/**
322+
* Returns the names of the enumerable string properties and methods of an object.
323+
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
324+
*/
325+
keys(o: {}): string[];
326+
321327
/**
322328
* Returns true if the values are the same value, false otherwise.
323329
* @param value1 The first value.
@@ -344,7 +350,7 @@ interface ReadonlyArray<T> {
344350
* predicate. If it is not provided, undefined is used instead.
345351
*/
346352
find<S extends T>(predicate: (this: void, value: T, index: number, obj: ReadonlyArray<T>) => value is S, thisArg?: any): S | undefined;
347-
find(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg?: any): T | undefined;
353+
find(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => unknown, thisArg?: any): T | undefined;
348354

349355
/**
350356
* Returns the index of the first element in the array where predicate is true, and -1
@@ -355,7 +361,7 @@ interface ReadonlyArray<T> {
355361
* @param thisArg If provided, it will be used as the this value for each invocation of
356362
* predicate. If it is not provided, undefined is used instead.
357363
*/
358-
findIndex(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg?: any): number;
364+
findIndex(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => unknown, thisArg?: any): number;
359365
}
360366

361367
interface RegExp {

tsserver/lib.es2015.iterable.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ interface ReadonlySet<T> {
197197
}
198198

199199
interface SetConstructor {
200-
new <T>(iterable: Iterable<T>): Set<T>;
200+
new <T>(iterable?: Iterable<T> | null): Set<T>;
201201
}
202202

203203
interface WeakSet<T extends object> { }

tsserver/lib.es2015.promise.d.ts

+3-67
Original file line numberDiff line numberDiff line change
@@ -118,79 +118,15 @@ interface PromiseConstructor {
118118
* @param values An array of Promises.
119119
* @returns A new Promise.
120120
*/
121-
race<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>, T10 | PromiseLike<T10>]): Promise<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9 | T10>;
121+
race<T>(values: T[]): Promise<T extends PromiseLike<infer U> ? U : T>;
122122

123123
/**
124124
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
125125
* or rejected.
126-
* @param values An array of Promises.
127-
* @returns A new Promise.
128-
*/
129-
race<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>, T9 | PromiseLike<T9>]): Promise<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>;
130-
131-
/**
132-
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
133-
* or rejected.
134-
* @param values An array of Promises.
135-
* @returns A new Promise.
136-
*/
137-
race<T1, T2, T3, T4, T5, T6, T7, T8>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>, T8 | PromiseLike<T8>]): Promise<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8>;
138-
139-
/**
140-
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
141-
* or rejected.
142-
* @param values An array of Promises.
143-
* @returns A new Promise.
144-
*/
145-
race<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>, T7 | PromiseLike<T7>]): Promise<T1 | T2 | T3 | T4 | T5 | T6 | T7>;
146-
147-
/**
148-
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
149-
* or rejected.
150-
* @param values An array of Promises.
151-
* @returns A new Promise.
152-
*/
153-
race<T1, T2, T3, T4, T5, T6>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>, T6 | PromiseLike<T6>]): Promise<T1 | T2 | T3 | T4 | T5 | T6>;
154-
155-
/**
156-
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
157-
* or rejected.
158-
* @param values An array of Promises.
159-
* @returns A new Promise.
160-
*/
161-
race<T1, T2, T3, T4, T5>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>]): Promise<T1 | T2 | T3 | T4 | T5>;
162-
163-
/**
164-
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
165-
* or rejected.
166-
* @param values An array of Promises.
167-
* @returns A new Promise.
168-
*/
169-
race<T1, T2, T3, T4>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>]): Promise<T1 | T2 | T3 | T4>;
170-
171-
/**
172-
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
173-
* or rejected.
174-
* @param values An array of Promises.
175-
* @returns A new Promise.
176-
*/
177-
race<T1, T2, T3>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<T1 | T2 | T3>;
178-
179-
/**
180-
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
181-
* or rejected.
182-
* @param values An array of Promises.
183-
* @returns A new Promise.
184-
*/
185-
race<T1, T2>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<T1 | T2>;
186-
187-
/**
188-
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
189-
* or rejected.
190-
* @param values An array of Promises.
126+
* @param values An iterable of Promises.
191127
* @returns A new Promise.
192128
*/
193-
race<T>(values: (T | PromiseLike<T>)[]): Promise<T>;
129+
race<T>(values: Iterable<T>): Promise<T extends PromiseLike<infer U> ? U : T>;
194130

195131
/**
196132
* Creates a new rejected promise for the provided reason.

tsserver/lib.es2019.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ and limitations under the License.
2020

2121
/// <reference lib="es2018" />
2222
/// <reference lib="es2019.array" />
23+
/// <reference lib="es2019.object" />
2324
/// <reference lib="es2019.string" />
2425
/// <reference lib="es2019.symbol" />

tsserver/lib.es2019.object.d.ts

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*! *****************************************************************************
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
this file except in compliance with the License. You may obtain a copy of the
5+
License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10+
MERCHANTABLITY OR NON-INFRINGEMENT.
11+
12+
See the Apache Version 2.0 License for specific language governing permissions
13+
and limitations under the License.
14+
***************************************************************************** */
15+
16+
17+
18+
/// <reference no-default-lib="true"/>
19+
20+
21+
/// <reference lib="es2015.iterable" />
22+
23+
interface ObjectConstructor {
24+
/**
25+
* Returns an object created by key-value entries for properties and methods
26+
* @param entries An iterable object that contains key-value entries for properties and methods.
27+
*/
28+
fromEntries<T = any>(entries: Iterable<readonly [PropertyKey, T]>): { [k in PropertyKey]: T };
29+
30+
/**
31+
* Returns an object created by key-value entries for properties and methods
32+
* @param entries An iterable object that contains key-value entries for properties and methods.
33+
*/
34+
fromEntries(entries: Iterable<readonly any[]>): any;
35+
}

tsserver/lib.es2020.d.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*! *****************************************************************************
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
this file except in compliance with the License. You may obtain a copy of the
5+
License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10+
MERCHANTABLITY OR NON-INFRINGEMENT.
11+
12+
See the Apache Version 2.0 License for specific language governing permissions
13+
and limitations under the License.
14+
***************************************************************************** */
15+
16+
17+
18+
/// <reference no-default-lib="true"/>
19+
20+
21+
/// <reference lib="es2019" />
22+
/// <reference lib="es2020.string" />
23+
/// <reference lib="es2020.symbol.wellknown" />

tsserver/lib.es2020.full.d.ts

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*! *****************************************************************************
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
this file except in compliance with the License. You may obtain a copy of the
5+
License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10+
MERCHANTABLITY OR NON-INFRINGEMENT.
11+
12+
See the Apache Version 2.0 License for specific language governing permissions
13+
and limitations under the License.
14+
***************************************************************************** */
15+
16+
17+
18+
/// <reference no-default-lib="true"/>
19+
20+
21+
/// <reference lib="es2020" />
22+
/// <reference lib="dom" />
23+
/// <reference lib="webworker.importscripts" />
24+
/// <reference lib="scripthost" />
25+
/// <reference lib="dom.iterable" />

tsserver/lib.es2020.string.d.ts

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*! *****************************************************************************
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
this file except in compliance with the License. You may obtain a copy of the
5+
License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10+
MERCHANTABLITY OR NON-INFRINGEMENT.
11+
12+
See the Apache Version 2.0 License for specific language governing permissions
13+
and limitations under the License.
14+
***************************************************************************** */
15+
16+
17+
18+
/// <reference no-default-lib="true"/>
19+
20+
21+
/// <reference lib="es2015.iterable" />
22+
23+
interface String {
24+
/**
25+
* Matches a string with a regular expression, and returns an iterable of matches
26+
* containing the results of that search.
27+
* @param regexp A variable name or string literal containing the regular expression pattern and flags.
28+
*/
29+
matchAll(regexp: RegExp): IterableIterator<RegExpMatchArray>;
30+
}
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*! *****************************************************************************
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4+
this file except in compliance with the License. You may obtain a copy of the
5+
License at http://www.apache.org/licenses/LICENSE-2.0
6+
7+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10+
MERCHANTABLITY OR NON-INFRINGEMENT.
11+
12+
See the Apache Version 2.0 License for specific language governing permissions
13+
and limitations under the License.
14+
***************************************************************************** */
15+
16+
17+
18+
/// <reference no-default-lib="true"/>
19+
20+
21+
/// <reference lib="es2015.iterable" />
22+
/// <reference lib="es2015.symbol" />
23+
24+
interface SymbolConstructor {
25+
/**
26+
* A regular expression method that matches the regular expression against a string. Called
27+
* by the String.prototype.matchAll method.
28+
*/
29+
readonly matchAll: symbol;
30+
}
31+
32+
interface RegExp {
33+
/**
34+
* Matches a string with this regular expression, and returns an iterable of matches
35+
* containing the results of that search.
36+
* @param string A string to search within.
37+
*/
38+
[Symbol.matchAll](str: string): IterableIterator<RegExpMatchArray>;
39+
}

tsserver/lib.es5.d.ts

+12-7
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ declare function encodeURI(uri: string): string;
8080
* Encodes a text string as a valid component of a Uniform Resource Identifier (URI).
8181
* @param uriComponent A value representing an encoded URI component.
8282
*/
83-
declare function encodeURIComponent(uriComponent: string): string;
83+
declare function encodeURIComponent(uriComponent: string | number | boolean): string;
8484

8585
/**
8686
* Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.
@@ -255,10 +255,10 @@ interface ObjectConstructor {
255255
isExtensible(o: any): boolean;
256256

257257
/**
258-
* Returns the names of the enumerable properties and methods of an object.
258+
* Returns the names of the enumerable string properties and methods of an object.
259259
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
260260
*/
261-
keys(o: {}): string[];
261+
keys(o: object): string[];
262262
}
263263

264264
/**
@@ -533,7 +533,7 @@ interface Boolean {
533533

534534
interface BooleanConstructor {
535535
new(value?: any): Boolean;
536-
(value?: any): boolean;
536+
<T>(value?: T): boolean;
537537
readonly prototype: Boolean;
538538
}
539539

@@ -1293,13 +1293,13 @@ interface Array<T> {
12931293
* @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
12941294
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
12951295
*/
1296-
every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
1296+
every(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
12971297
/**
12981298
* Determines whether the specified callback function returns true for any element of an array.
12991299
* @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
13001300
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
13011301
*/
1302-
some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;
1302+
some(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
13031303
/**
13041304
* Performs the specified action for each element in an array.
13051305
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
@@ -1323,7 +1323,7 @@ interface Array<T> {
13231323
* @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
13241324
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
13251325
*/
1326-
filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[];
1326+
filter(callbackfn: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
13271327
/**
13281328
* Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
13291329
* @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
@@ -1463,6 +1463,11 @@ type Exclude<T, U> = T extends U ? never : T;
14631463
*/
14641464
type Extract<T, U> = T extends U ? T : never;
14651465

1466+
/**
1467+
* Construct a type with the properties of T except for those in type K.
1468+
*/
1469+
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
1470+
14661471
/**
14671472
* Exclude null and undefined from T
14681473
*/

0 commit comments

Comments
 (0)