Skip to content

Commit b624d47

Browse files
committed
Update LKG
1 parent f9bcd26 commit b624d47

18 files changed

+31742
-26688
lines changed

lib/lib.d.ts

Lines changed: 1728 additions & 2600 deletions
Large diffs are not rendered by default.

lib/lib.dom.d.ts

Lines changed: 1687 additions & 2599 deletions
Large diffs are not rendered by default.

lib/lib.es2015.core.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,27 +225,27 @@ interface NumberConstructor {
225225
* number. Only finite values of the type number, result in true.
226226
* @param number A numeric value.
227227
*/
228-
isFinite(value: any): value is number;
228+
isFinite(number: number): boolean;
229229

230230
/**
231231
* Returns true if the value passed is an integer, false otherwise.
232232
* @param number A numeric value.
233233
*/
234-
isInteger(value: any): value is number;
234+
isInteger(number: number): boolean;
235235

236236
/**
237237
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
238238
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
239239
* to a number. Only values of the type number, that are also NaN, result in true.
240240
* @param number A numeric value.
241241
*/
242-
isNaN(value: any): value is number;
242+
isNaN(number: number): boolean;
243243

244244
/**
245245
* Returns true if the value passed is a safe integer.
246246
* @param number A numeric value.
247247
*/
248-
isSafeInteger(value: any): value is number;
248+
isSafeInteger(number: number): boolean;
249249

250250
/**
251251
* The value of the largest integer n such that n and n + 1 are both exactly representable as

lib/lib.es2016.array.include.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ interface Array<T> {
2727
includes(searchElement: T, fromIndex?: number): boolean;
2828
}
2929

30+
interface ReadonlyArray<T> {
31+
/**
32+
* Determines whether an array includes a certain element, returning true or false as appropriate.
33+
* @param searchElement The element to search for.
34+
* @param fromIndex The position in this array at which to begin searching for searchElement.
35+
*/
36+
includes(searchElement: T, fromIndex?: number): boolean;
37+
}
38+
3039
interface Int8Array {
3140
/**
3241
* Determines whether an array includes a certain element, returning true or false as appropriate.

lib/lib.es2017.object.d.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,22 @@ interface ObjectConstructor {
2424
* @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.
2525
*/
2626
values<T>(o: { [s: string]: T }): T[];
27+
28+
/**
29+
* Returns an array of values of the enumerable properties of an object
30+
* @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.
31+
*/
2732
values(o: any): any[];
33+
34+
/**
35+
* Returns an array of key/values of the enumerable properties of an object
36+
* @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.
37+
*/
38+
entries<T>(o: { [s: string]: T }): [string, T][];
39+
2840
/**
2941
* Returns an array of key/values of the enumerable properties of an object
3042
* @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.
3143
*/
32-
entries<T extends { [key: string]: any }, K extends keyof T>(o: T): [keyof T, T[K]][];
3344
entries(o: any): [string, any][];
3445
}

lib/lib.es5.d.ts

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,19 @@ interface ObjectConstructor {
200200
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
201201
* @param o Object on which to lock the attributes.
202202
*/
203-
freeze<T>(o: T): T;
203+
freeze<T>(a: T[]): ReadonlyArray<T>;
204+
205+
/**
206+
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
207+
* @param o Object on which to lock the attributes.
208+
*/
209+
freeze<T extends Function>(f: T): T;
210+
211+
/**
212+
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
213+
* @param o Object on which to lock the attributes.
214+
*/
215+
freeze<T>(o: T): Readonly<T>;
204216

205217
/**
206218
* Prevents the addition of new properties to an object.
@@ -1363,6 +1375,34 @@ interface ArrayLike<T> {
13631375
readonly [n: number]: T;
13641376
}
13651377

1378+
/**
1379+
* Make all properties in T optional
1380+
*/
1381+
type Partial<T> = {
1382+
[P in keyof T]?: T[P];
1383+
};
1384+
1385+
/**
1386+
* Make all properties in T readonly
1387+
*/
1388+
type Readonly<T> = {
1389+
readonly [P in keyof T]: T[P];
1390+
};
1391+
1392+
/**
1393+
* From T pick a set of properties K
1394+
*/
1395+
type Pick<T, K extends keyof T> = {
1396+
[P in K]: T[P];
1397+
}
1398+
1399+
/**
1400+
* Construct a type with a set of properties K of type T
1401+
*/
1402+
type Record<K extends string, T> = {
1403+
[P in K]: T;
1404+
}
1405+
13661406
/**
13671407
* Represents a raw buffer of binary data, which is used to store data for the
13681408
* different typed arrays. ArrayBuffers cannot be read from or written to directly,

0 commit comments

Comments
 (0)