Skip to content

Commit adedc19

Browse files
committed
Update LKG
1 parent 207f1aa commit adedc19

19 files changed

+38202
-36022
lines changed

lib/lib.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ interface ObjectConstructor {
166166
* Creates an object that has the specified prototype, and that optionally contains specified properties.
167167
* @param o Object to use as a prototype. May be null
168168
*/
169-
create<T>(o: T): T;
169+
create<T extends object>(o: T): T;
170170

171171
/**
172172
* Creates an object that has the specified prototype, and that optionally contains specified properties.
173173
* @param o Object to use as a prototype. May be null
174174
* @param properties JavaScript object that contains one or more property descriptors.
175175
*/
176-
create(o: any, properties: PropertyDescriptorMap): any;
176+
create(o: object | null, properties: PropertyDescriptorMap): any;
177177

178178
/**
179179
* Adds a property to an object, or modifies attributes of an existing property.

lib/lib.es2015.collection.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface Map<K, V> {
2424
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
2525
get(key: K): V | undefined;
2626
has(key: K): boolean;
27-
set(key: K, value?: V): this;
27+
set(key: K, value: V): this;
2828
readonly size: number;
2929
}
3030

@@ -42,16 +42,16 @@ interface ReadonlyMap<K, V> {
4242
readonly size: number;
4343
}
4444

45-
interface WeakMap<K, V> {
45+
interface WeakMap<K extends object, V> {
4646
delete(key: K): boolean;
4747
get(key: K): V | undefined;
4848
has(key: K): boolean;
49-
set(key: K, value?: V): this;
49+
set(key: K, value: V): this;
5050
}
5151

5252
interface WeakMapConstructor {
5353
new (): WeakMap<any, any>;
54-
new <K, V>(entries?: [K, V][]): WeakMap<K, V>;
54+
new <K extends object, V>(entries?: [K, V][]): WeakMap<K, V>;
5555
readonly prototype: WeakMap<any, any>;
5656
}
5757
declare var WeakMap: WeakMapConstructor;

lib/lib.es2015.core.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ interface ObjectConstructor {
345345
* @param o The object to change its prototype.
346346
* @param proto The value of the new prototype or null.
347347
*/
348-
setPrototypeOf(o: any, proto: any): any;
348+
setPrototypeOf(o: any, proto: object | null): any;
349349

350350
/**
351351
* Gets the own property descriptor of the specified object.

lib/lib.es2015.iterable.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ interface MapConstructor {
119119
new <K, V>(iterable: Iterable<[K, V]>): Map<K, V>;
120120
}
121121

122-
interface WeakMap<K, V> { }
122+
interface WeakMap<K extends object, V> { }
123123

124124
interface WeakMapConstructor {
125-
new <K, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
125+
new <K extends object, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
126126
}
127127

128128
interface Set<T> {
@@ -462,4 +462,4 @@ interface Float64ArrayConstructor {
462462
* @param thisArg Value of 'this' used to invoke the mapfn.
463463
*/
464464
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
465-
}
465+
}

lib/lib.es2015.proxy.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ and limitations under the License.
1919

2020

2121
interface ProxyHandler<T> {
22-
getPrototypeOf? (target: T): {} | null;
22+
getPrototypeOf? (target: T): object | null;
2323
setPrototypeOf? (target: T, v: any): boolean;
2424
isExtensible? (target: T): boolean;
2525
preventExtensions? (target: T): boolean;
@@ -32,7 +32,7 @@ interface ProxyHandler<T> {
3232
enumerate? (target: T): PropertyKey[];
3333
ownKeys? (target: T): PropertyKey[];
3434
apply? (target: T, thisArg: any, argArray?: any): any;
35-
construct? (target: T, argArray: any, newTarget?: any): {};
35+
construct? (target: T, argArray: any, newTarget?: any): object
3636
}
3737

3838
interface ProxyConstructor {

lib/lib.es2015.symbol.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface Symbol {
2323
toString(): string;
2424

2525
/** Returns the primitive value of the specified object. */
26-
valueOf(): Object;
26+
valueOf(): symbol;
2727
}
2828

2929
interface SymbolConstructor {

lib/lib.es2015.symbol.wellknown.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ interface Map<K, V> {
130130
readonly [Symbol.toStringTag]: "Map";
131131
}
132132

133-
interface WeakMap<K, V>{
133+
interface WeakMap<K extends object, V>{
134134
readonly [Symbol.toStringTag]: "WeakMap";
135135
}
136136

@@ -344,4 +344,4 @@ interface Float32Array {
344344
*/
345345
interface Float64Array {
346346
readonly [Symbol.toStringTag]: "Float64Array";
347-
}
347+
}

lib/lib.es5.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ interface ObjectConstructor {
166166
* Creates an object that has the specified prototype, and that optionally contains specified properties.
167167
* @param o Object to use as a prototype. May be null
168168
*/
169-
create<T>(o: T): T;
169+
create<T extends object>(o: T): T;
170170

171171
/**
172172
* Creates an object that has the specified prototype, and that optionally contains specified properties.
173173
* @param o Object to use as a prototype. May be null
174174
* @param properties JavaScript object that contains one or more property descriptors.
175175
*/
176-
create(o: any, properties: PropertyDescriptorMap): any;
176+
create(o: object | null, properties: PropertyDescriptorMap): any;
177177

178178
/**
179179
* Adds a property to an object, or modifies attributes of an existing property.

lib/lib.es6.d.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ interface ObjectConstructor {
166166
* Creates an object that has the specified prototype, and that optionally contains specified properties.
167167
* @param o Object to use as a prototype. May be null
168168
*/
169-
create<T>(o: T): T;
169+
create<T extends object>(o: T): T;
170170

171171
/**
172172
* Creates an object that has the specified prototype, and that optionally contains specified properties.
173173
* @param o Object to use as a prototype. May be null
174174
* @param properties JavaScript object that contains one or more property descriptors.
175175
*/
176-
create(o: any, properties: PropertyDescriptorMap): any;
176+
create(o: object | null, properties: PropertyDescriptorMap): any;
177177

178178
/**
179179
* Adds a property to an object, or modifies attributes of an existing property.
@@ -4523,7 +4523,7 @@ interface ObjectConstructor {
45234523
* @param o The object to change its prototype.
45244524
* @param proto The value of the new prototype or null.
45254525
*/
4526-
setPrototypeOf(o: any, proto: any): any;
4526+
setPrototypeOf(o: any, proto: object | null): any;
45274527

45284528
/**
45294529
* Gets the own property descriptor of the specified object.
@@ -4728,7 +4728,7 @@ interface Map<K, V> {
47284728
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
47294729
get(key: K): V | undefined;
47304730
has(key: K): boolean;
4731-
set(key: K, value?: V): this;
4731+
set(key: K, value: V): this;
47324732
readonly size: number;
47334733
}
47344734

@@ -4746,16 +4746,16 @@ interface ReadonlyMap<K, V> {
47464746
readonly size: number;
47474747
}
47484748

4749-
interface WeakMap<K, V> {
4749+
interface WeakMap<K extends object, V> {
47504750
delete(key: K): boolean;
47514751
get(key: K): V | undefined;
47524752
has(key: K): boolean;
4753-
set(key: K, value?: V): this;
4753+
set(key: K, value: V): this;
47544754
}
47554755

47564756
interface WeakMapConstructor {
47574757
new (): WeakMap<any, any>;
4758-
new <K, V>(entries?: [K, V][]): WeakMap<K, V>;
4758+
new <K extends object, V>(entries?: [K, V][]): WeakMap<K, V>;
47594759
readonly prototype: WeakMap<any, any>;
47604760
}
47614761
declare var WeakMap: WeakMapConstructor;
@@ -4911,10 +4911,10 @@ interface MapConstructor {
49114911
new <K, V>(iterable: Iterable<[K, V]>): Map<K, V>;
49124912
}
49134913

4914-
interface WeakMap<K, V> { }
4914+
interface WeakMap<K extends object, V> { }
49154915

49164916
interface WeakMapConstructor {
4917-
new <K, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
4917+
new <K extends object, V>(iterable: Iterable<[K, V]>): WeakMap<K, V>;
49184918
}
49194919

49204920
interface Set<T> {
@@ -5256,6 +5256,7 @@ interface Float64ArrayConstructor {
52565256
from(arrayLike: Iterable<number>, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;
52575257
}
52585258

5259+
52595260
/**
52605261
* Represents the completion of an asynchronous operation
52615262
*/
@@ -5512,7 +5513,7 @@ interface PromiseConstructor {
55125513
declare var Promise: PromiseConstructor;
55135514

55145515
interface ProxyHandler<T> {
5515-
getPrototypeOf? (target: T): {} | null;
5516+
getPrototypeOf? (target: T): object | null;
55165517
setPrototypeOf? (target: T, v: any): boolean;
55175518
isExtensible? (target: T): boolean;
55185519
preventExtensions? (target: T): boolean;
@@ -5525,7 +5526,7 @@ interface ProxyHandler<T> {
55255526
enumerate? (target: T): PropertyKey[];
55265527
ownKeys? (target: T): PropertyKey[];
55275528
apply? (target: T, thisArg: any, argArray?: any): any;
5528-
construct? (target: T, argArray: any, newTarget?: any): {};
5529+
construct? (target: T, argArray: any, newTarget?: any): object
55295530
}
55305531

55315532
interface ProxyConstructor {
@@ -5556,7 +5557,7 @@ interface Symbol {
55565557
toString(): string;
55575558

55585559
/** Returns the primitive value of the specified object. */
5559-
valueOf(): Object;
5560+
valueOf(): symbol;
55605561
}
55615562

55625563
interface SymbolConstructor {
@@ -5700,7 +5701,7 @@ interface Map<K, V> {
57005701
readonly [Symbol.toStringTag]: "Map";
57015702
}
57025703

5703-
interface WeakMap<K, V>{
5704+
interface WeakMap<K extends object, V>{
57045705
readonly [Symbol.toStringTag]: "WeakMap";
57055706
}
57065707

@@ -5917,6 +5918,7 @@ interface Float64Array {
59175918
}
59185919

59195920

5921+
59205922
/////////////////////////////
59215923
/// IE DOM APIs
59225924
/////////////////////////////

lib/protocol.d.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1798,9 +1798,10 @@ declare namespace ts.server.protocol {
17981798
namespace JsxEmit {
17991799
type None = "None";
18001800
type Preserve = "Preserve";
1801+
type ReactNative = "ReactNative";
18011802
type React = "React";
18021803
}
1803-
type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React;
1804+
type JsxEmit = JsxEmit.None | JsxEmit.Preserve | JsxEmit.React | JsxEmit.ReactNative;
18041805
namespace ModuleKind {
18051806
type None = "None";
18061807
type CommonJS = "CommonJS";
@@ -1862,6 +1863,11 @@ declare namespace ts.server.protocol {
18621863
isMixedContent: boolean;
18631864
}
18641865

1866+
/**
1867+
* Type of objects whose values are all of the same type.
1868+
* The `in` and `for-in` operators can *not* be safely used,
1869+
* since `Object.prototype` may be modified by outside code.
1870+
*/
18651871
interface MapLike<T> {
18661872
[index: string]: T;
18671873
}

0 commit comments

Comments
 (0)