Skip to content

Commit c7c3158

Browse files
committed
Update LKG
1 parent b10c2ba commit c7c3158

13 files changed

+14751
-10388
lines changed

lib/lib.d.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ interface NumberConstructor {
529529
/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */
530530
declare const Number: NumberConstructor;
531531

532-
interface TemplateStringsArray extends Array<string> {
533-
readonly raw: string[];
532+
interface TemplateStringsArray extends ReadonlyArray<string> {
533+
readonly raw: ReadonlyArray<string>
534534
}
535535

536536
interface Math {
@@ -1022,7 +1022,12 @@ interface ReadonlyArray<T> {
10221022
* Combines two or more arrays.
10231023
* @param items Additional items to add to the end of array1.
10241024
*/
1025-
concat(...items: T[]): T[];
1025+
concat(...items: T[][]): T[];
1026+
/**
1027+
* Combines two or more arrays.
1028+
* @param items Additional items to add to the end of array1.
1029+
*/
1030+
concat(...items: (T | T[])[]): T[];
10261031
/**
10271032
* Adds all the elements of an array separated by the specified separator string.
10281033
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
@@ -1124,6 +1129,11 @@ interface Array<T> {
11241129
* Removes the last element from an array and returns it.
11251130
*/
11261131
pop(): T | undefined;
1132+
/**
1133+
* Combines two or more arrays.
1134+
* @param items Additional items to add to the end of array1.
1135+
*/
1136+
concat(...items: T[][]): T[];
11271137
/**
11281138
* Combines two or more arrays.
11291139
* @param items Additional items to add to the end of array1.

lib/lib.es2015.core.d.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ interface ArrayConstructor {
8484
of<T>(...items: T[]): Array<T>;
8585
}
8686

87+
interface DateConstructor {
88+
new (value: Date): Date;
89+
}
90+
8791
interface Function {
8892
/**
8993
* Returns the name of the function. Function names are read-only and can not be changed.
@@ -242,7 +246,7 @@ interface NumberConstructor {
242246
/**
243247
* The value of the largest integer n such that n and n + 1 are both exactly representable as
244248
* a Number value.
245-
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
249+
* The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.
246250
*/
247251
readonly MAX_SAFE_INTEGER: number;
248252

@@ -359,6 +363,30 @@ interface ObjectConstructor {
359363
defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;
360364
}
361365

366+
interface ReadonlyArray<T> {
367+
/**
368+
* Returns the value of the first element in the array where predicate is true, and undefined
369+
* otherwise.
370+
* @param predicate find calls predicate once for each element of the array, in ascending
371+
* order, until it finds one where predicate returns true. If such an element is found, find
372+
* immediately returns that element value. Otherwise, find returns undefined.
373+
* @param thisArg If provided, it will be used as the this value for each invocation of
374+
* predicate. If it is not provided, undefined is used instead.
375+
*/
376+
find(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg?: any): T | undefined;
377+
378+
/**
379+
* Returns the index of the first element in the array where predicate is true, and undefined
380+
* otherwise.
381+
* @param predicate find calls predicate once for each element of the array, in ascending
382+
* order, until it finds one where predicate returns true. If such an element is found,
383+
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
384+
* @param thisArg If provided, it will be used as the this value for each invocation of
385+
* predicate. If it is not provided, undefined is used instead.
386+
*/
387+
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
388+
}
389+
362390
interface RegExp {
363391
/**
364392
* Returns a string indicating the flags of the regular expression in question. This field is read-only.

lib/lib.es2015.iterable.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,26 @@ interface ArrayConstructor {
7979
from<T>(iterable: Iterable<T>): Array<T>;
8080
}
8181

82+
interface ReadonlyArray<T> {
83+
/** Iterator */
84+
[Symbol.iterator](): IterableIterator<T>;
85+
86+
/**
87+
* Returns an array of key, value pairs for every entry in the array
88+
*/
89+
entries(): IterableIterator<[number, T]>;
90+
91+
/**
92+
* Returns an list of keys in the array
93+
*/
94+
keys(): IterableIterator<number>;
95+
96+
/**
97+
* Returns an list of values in the array
98+
*/
99+
values(): IterableIterator<T>;
100+
}
101+
82102
interface IArguments {
83103
/** Iterator */
84104
[Symbol.iterator](): IterableIterator<any>;

lib/lib.es5.d.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ interface NumberConstructor {
529529
/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */
530530
declare const Number: NumberConstructor;
531531

532-
interface TemplateStringsArray extends Array<string> {
533-
readonly raw: string[];
532+
interface TemplateStringsArray extends ReadonlyArray<string> {
533+
readonly raw: ReadonlyArray<string>
534534
}
535535

536536
interface Math {
@@ -1022,7 +1022,12 @@ interface ReadonlyArray<T> {
10221022
* Combines two or more arrays.
10231023
* @param items Additional items to add to the end of array1.
10241024
*/
1025-
concat(...items: T[]): T[];
1025+
concat(...items: T[][]): T[];
1026+
/**
1027+
* Combines two or more arrays.
1028+
* @param items Additional items to add to the end of array1.
1029+
*/
1030+
concat(...items: (T | T[])[]): T[];
10261031
/**
10271032
* Adds all the elements of an array separated by the specified separator string.
10281033
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
@@ -1124,6 +1129,11 @@ interface Array<T> {
11241129
* Removes the last element from an array and returns it.
11251130
*/
11261131
pop(): T | undefined;
1132+
/**
1133+
* Combines two or more arrays.
1134+
* @param items Additional items to add to the end of array1.
1135+
*/
1136+
concat(...items: T[][]): T[];
11271137
/**
11281138
* Combines two or more arrays.
11291139
* @param items Additional items to add to the end of array1.

lib/lib.es6.d.ts

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ interface NumberConstructor {
529529
/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */
530530
declare const Number: NumberConstructor;
531531

532-
interface TemplateStringsArray extends Array<string> {
533-
readonly raw: string[];
532+
interface TemplateStringsArray extends ReadonlyArray<string> {
533+
readonly raw: ReadonlyArray<string>
534534
}
535535

536536
interface Math {
@@ -1022,7 +1022,12 @@ interface ReadonlyArray<T> {
10221022
* Combines two or more arrays.
10231023
* @param items Additional items to add to the end of array1.
10241024
*/
1025-
concat(...items: T[]): T[];
1025+
concat(...items: T[][]): T[];
1026+
/**
1027+
* Combines two or more arrays.
1028+
* @param items Additional items to add to the end of array1.
1029+
*/
1030+
concat(...items: (T | T[])[]): T[];
10261031
/**
10271032
* Adds all the elements of an array separated by the specified separator string.
10281033
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
@@ -1124,6 +1129,11 @@ interface Array<T> {
11241129
* Removes the last element from an array and returns it.
11251130
*/
11261131
pop(): T | undefined;
1132+
/**
1133+
* Combines two or more arrays.
1134+
* @param items Additional items to add to the end of array1.
1135+
*/
1136+
concat(...items: T[][]): T[];
11271137
/**
11281138
* Combines two or more arrays.
11291139
* @param items Additional items to add to the end of array1.
@@ -4190,6 +4200,10 @@ interface ArrayConstructor {
41904200
of<T>(...items: T[]): Array<T>;
41914201
}
41924202

4203+
interface DateConstructor {
4204+
new (value: Date): Date;
4205+
}
4206+
41934207
interface Function {
41944208
/**
41954209
* Returns the name of the function. Function names are read-only and can not be changed.
@@ -4348,7 +4362,7 @@ interface NumberConstructor {
43484362
/**
43494363
* The value of the largest integer n such that n and n + 1 are both exactly representable as
43504364
* a Number value.
4351-
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
4365+
* The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.
43524366
*/
43534367
readonly MAX_SAFE_INTEGER: number;
43544368

@@ -4465,6 +4479,30 @@ interface ObjectConstructor {
44654479
defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;
44664480
}
44674481

4482+
interface ReadonlyArray<T> {
4483+
/**
4484+
* Returns the value of the first element in the array where predicate is true, and undefined
4485+
* otherwise.
4486+
* @param predicate find calls predicate once for each element of the array, in ascending
4487+
* order, until it finds one where predicate returns true. If such an element is found, find
4488+
* immediately returns that element value. Otherwise, find returns undefined.
4489+
* @param thisArg If provided, it will be used as the this value for each invocation of
4490+
* predicate. If it is not provided, undefined is used instead.
4491+
*/
4492+
find(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg?: any): T | undefined;
4493+
4494+
/**
4495+
* Returns the index of the first element in the array where predicate is true, and undefined
4496+
* otherwise.
4497+
* @param predicate find calls predicate once for each element of the array, in ascending
4498+
* order, until it finds one where predicate returns true. If such an element is found,
4499+
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
4500+
* @param thisArg If provided, it will be used as the this value for each invocation of
4501+
* predicate. If it is not provided, undefined is used instead.
4502+
*/
4503+
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
4504+
}
4505+
44684506
interface RegExp {
44694507
/**
44704508
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
@@ -4754,6 +4792,26 @@ interface ArrayConstructor {
47544792
from<T>(iterable: Iterable<T>): Array<T>;
47554793
}
47564794

4795+
interface ReadonlyArray<T> {
4796+
/** Iterator */
4797+
[Symbol.iterator](): IterableIterator<T>;
4798+
4799+
/**
4800+
* Returns an array of key, value pairs for every entry in the array
4801+
*/
4802+
entries(): IterableIterator<[number, T]>;
4803+
4804+
/**
4805+
* Returns an list of keys in the array
4806+
*/
4807+
keys(): IterableIterator<number>;
4808+
4809+
/**
4810+
* Returns an list of values in the array
4811+
*/
4812+
values(): IterableIterator<T>;
4813+
}
4814+
47574815
interface IArguments {
47584816
/** Iterator */
47594817
[Symbol.iterator](): IterableIterator<any>;

0 commit comments

Comments
 (0)