Skip to content

Commit 912e685

Browse files
committed
update LKG, resolve merge issues
1 parent d126173 commit 912e685

22 files changed

+246339
-179431
lines changed

lib/lib.d.ts

Lines changed: 82 additions & 90 deletions
Large diffs are not rendered by default.

lib/lib.dom.iterable.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ and limitations under the License.
1414
***************************************************************************** */
1515

1616
/// <reference no-default-lib="true"/>
17-
/// <reference path="lib.dom.generated.d.ts" />
17+
/// <reference path="lib.dom.d.ts" />
1818

1919
interface DOMTokenList {
2020
[Symbol.iterator](): IterableIterator<string>;

lib/lib.es2015.collection.d.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ and limitations under the License.
1717
interface Map<K, V> {
1818
clear(): void;
1919
delete(key: K): boolean;
20-
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
20+
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
2121
get(key: K): V | undefined;
2222
has(key: K): boolean;
23-
set(key: K, value: V): this;
23+
set(key: K, value?: V): this;
2424
readonly size: number;
2525
}
2626

@@ -31,11 +31,18 @@ interface MapConstructor {
3131
}
3232
declare var Map: MapConstructor;
3333

34+
interface ReadonlyMap<K, V> {
35+
forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;
36+
get(key: K): V|undefined;
37+
has(key: K): boolean;
38+
readonly size: number;
39+
}
40+
3441
interface WeakMap<K, V> {
3542
delete(key: K): boolean;
3643
get(key: K): V | undefined;
3744
has(key: K): boolean;
38-
set(key: K, value: V): this;
45+
set(key: K, value?: V): this;
3946
}
4047

4148
interface WeakMapConstructor {
@@ -49,7 +56,7 @@ interface Set<T> {
4956
add(value: T): this;
5057
clear(): void;
5158
delete(value: T): boolean;
52-
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
59+
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
5360
has(value: T): boolean;
5461
readonly size: number;
5562
}
@@ -61,6 +68,12 @@ interface SetConstructor {
6168
}
6269
declare var Set: SetConstructor;
6370

71+
interface ReadonlySet<T> {
72+
forEach(callbackfn: (value: T, value2: T, set: ReadonlySet<T>) => void, thisArg?: any): void;
73+
has(value: T): boolean;
74+
readonly size: number;
75+
}
76+
6477
interface WeakSet<T> {
6578
add(value: T): this;
6679
delete(value: T): boolean;

lib/lib.es2015.core.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ interface Array<T> {
2929
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T | undefined;
3030

3131
/**
32-
* Returns the index of the first element in the array where predicate is true, and undefined
32+
* Returns the index of the first element in the array where predicate is true, and -1
3333
* otherwise.
3434
* @param predicate find calls predicate once for each element of the array, in ascending
35-
* order, until it finds one where predicate returns true. If such an element is found,
35+
* order, until it finds one where predicate returns true. If such an element is found,
3636
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
3737
* @param thisArg If provided, it will be used as the this value for each invocation of
3838
* predicate. If it is not provided, undefined is used instead.
3939
*/
40-
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
40+
findIndex(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): number;
4141

4242
/**
4343
* Returns the this object after filling the section identified by start and end with value
@@ -376,15 +376,15 @@ interface ReadonlyArray<T> {
376376
find(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg?: any): T | undefined;
377377

378378
/**
379-
* Returns the index of the first element in the array where predicate is true, and undefined
379+
* Returns the index of the first element in the array where predicate is true, and -1
380380
* otherwise.
381381
* @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,
382+
* order, until it finds one where predicate returns true. If such an element is found,
383383
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
384384
* @param thisArg If provided, it will be used as the this value for each invocation of
385385
* predicate. If it is not provided, undefined is used instead.
386386
*/
387-
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
387+
findIndex(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): number;
388388
}
389389

390390
interface RegExp {

lib/lib.es2015.promise.d.ts

Lines changed: 91 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,42 +24,45 @@ interface Promise<T> {
2424
* @param onrejected The callback to execute when the Promise is rejected.
2525
* @returns A Promise for the completion of which ever callback is executed.
2626
*/
27-
then<TResult1, TResult2>(onfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
27+
then(onfulfilled?: ((value: T) => T | PromiseLike<T>) | undefined | null, onrejected?: ((reason: any) => T | PromiseLike<T>) | undefined | null): Promise<T>;
2828

2929
/**
3030
* Attaches callbacks for the resolution and/or rejection of the Promise.
3131
* @param onfulfilled The callback to execute when the Promise is resolved.
3232
* @param onrejected The callback to execute when the Promise is rejected.
3333
* @returns A Promise for the completion of which ever callback is executed.
3434
*/
35-
then<TResult>(onfulfilled: (value: T) => TResult | PromiseLike<TResult>, onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
35+
then<TResult>(onfulfilled: ((value: T) => T | PromiseLike<T>) | undefined | null, onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>;
3636

3737
/**
3838
* Attaches callbacks for the resolution and/or rejection of the Promise.
3939
* @param onfulfilled The callback to execute when the Promise is resolved.
40+
* @param onrejected The callback to execute when the Promise is rejected.
4041
* @returns A Promise for the completion of which ever callback is executed.
4142
*/
42-
then<TResult>(onfulfilled: (value: T) => TResult | PromiseLike<TResult>): Promise<TResult>;
43+
then<TResult>(onfulfilled: (value: T) => TResult | PromiseLike<TResult>, onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<TResult>;
4344

4445
/**
45-
* Creates a new Promise with the same internal state of this Promise.
46-
* @returns A Promise.
46+
* Attaches callbacks for the resolution and/or rejection of the Promise.
47+
* @param onfulfilled The callback to execute when the Promise is resolved.
48+
* @param onrejected The callback to execute when the Promise is rejected.
49+
* @returns A Promise for the completion of which ever callback is executed.
4750
*/
48-
then(): Promise<T>;
51+
then<TResult1, TResult2>(onfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
4952

5053
/**
5154
* Attaches a callback for only the rejection of the Promise.
5255
* @param onrejected The callback to execute when the Promise is rejected.
5356
* @returns A Promise for the completion of the callback.
5457
*/
55-
catch<TResult>(onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>;
58+
catch(onrejected?: ((reason: any) => T | PromiseLike<T>) | undefined | null): Promise<T>;
5659

5760
/**
5861
* Attaches a callback for only the rejection of the Promise.
5962
* @param onrejected The callback to execute when the Promise is rejected.
6063
* @returns A Promise for the completion of the callback.
6164
*/
62-
catch(onrejected: (reason: any) => T | PromiseLike<T>): Promise<T>;
65+
catch<TResult>(onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>;
6366
}
6467

6568
interface PromiseConstructor {
@@ -156,6 +159,86 @@ interface PromiseConstructor {
156159
*/
157160
all<T>(values: (T | PromiseLike<T>)[]): Promise<T[]>;
158161

162+
/**
163+
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
164+
* or rejected.
165+
* @param values An array of Promises.
166+
* @returns A new Promise.
167+
*/
168+
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>;
169+
170+
/**
171+
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
172+
* or rejected.
173+
* @param values An array of Promises.
174+
* @returns A new Promise.
175+
*/
176+
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>;
177+
178+
/**
179+
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
180+
* or rejected.
181+
* @param values An array of Promises.
182+
* @returns A new Promise.
183+
*/
184+
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>;
185+
186+
/**
187+
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
188+
* or rejected.
189+
* @param values An array of Promises.
190+
* @returns A new Promise.
191+
*/
192+
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>;
193+
194+
/**
195+
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
196+
* or rejected.
197+
* @param values An array of Promises.
198+
* @returns A new Promise.
199+
*/
200+
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>;
201+
202+
/**
203+
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
204+
* or rejected.
205+
* @param values An array of Promises.
206+
* @returns A new Promise.
207+
*/
208+
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>;
209+
210+
/**
211+
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
212+
* or rejected.
213+
* @param values An array of Promises.
214+
* @returns A new Promise.
215+
*/
216+
race<T1, T2, T3, T4>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>]): Promise<T1 | T2 | T3 | T4>;
217+
218+
/**
219+
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
220+
* or rejected.
221+
* @param values An array of Promises.
222+
* @returns A new Promise.
223+
*/
224+
race<T1, T2, T3>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<T1 | T2 | T3>;
225+
226+
/**
227+
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
228+
* or rejected.
229+
* @param values An array of Promises.
230+
* @returns A new Promise.
231+
*/
232+
race<T1, T2>(values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<T1 | T2>;
233+
234+
/**
235+
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
236+
* or rejected.
237+
* @param values An array of Promises.
238+
* @returns A new Promise.
239+
*/
240+
race<T>(values: (T | PromiseLike<T>)[]): Promise<T>;
241+
159242
/**
160243
* Creates a new rejected promise for the provided reason.
161244
* @param reason The reason the promise was rejected.

lib/lib.es2015.proxy.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface ProxyHandler<T> {
1919
setPrototypeOf? (target: T, v: any): boolean;
2020
isExtensible? (target: T): boolean;
2121
preventExtensions? (target: T): boolean;
22-
getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined;
22+
getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor;
2323
has? (target: T, p: PropertyKey): boolean;
2424
get? (target: T, p: PropertyKey, receiver: any): any;
2525
set? (target: T, p: PropertyKey, value: any, receiver: any): boolean;
@@ -35,4 +35,4 @@ interface ProxyConstructor {
3535
revocable<T>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
3636
new <T>(target: T, handler: ProxyHandler<T>): T
3737
}
38-
declare var Proxy: ProxyConstructor;
38+
declare var Proxy: ProxyConstructor;

lib/lib.es2015.reflect.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ declare namespace Reflect {
2222
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
2323
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
2424
function getPrototypeOf(target: any): any;
25-
function has(target: any, propertyKey: string): boolean;
26-
function has(target: any, propertyKey: symbol): boolean;
25+
function has(target: any, propertyKey: PropertyKey): boolean;
2726
function isExtensible(target: any): boolean;
2827
function ownKeys(target: any): Array<PropertyKey>;
2928
function preventExtensions(target: any): boolean;

0 commit comments

Comments
 (0)