Skip to content

Commit a8bdade

Browse files
committed
Upgrade TypeScript to 4.9
1 parent 8dc9dbe commit a8bdade

36 files changed

+2577
-624
lines changed

TypeScript

Submodule TypeScript updated 7864 files

docs/diff/es2015.collection.d.ts.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,25 @@ Index: es2015.collection.d.ts
55
===================================================================
66
--- es2015.collection.d.ts
77
+++ es2015.collection.d.ts
8-
@@ -1,28 +1,27 @@
9-
interface Map<K, V> {
10-
clear(): void;
8+
@@ -3,14 +3,11 @@
9+
/**
10+
* @returns true if an element in the Map existed and has been removed, or false if the element does not exist.
11+
*/
1112
delete(key: K): boolean;
13+
- /**
14+
- * Executes a provided function once per each key/value pair in the Map, in insertion order.
15+
- */
1216
- forEach(
1317
- callbackfn: (value: V, key: K, map: Map<K, V>) => void,
1418
- thisArg?: any
1519
+ forEach<This = undefined>(
1620
+ callbackfn: (this: This, value: V, key: K, map: this) => void,
1721
+ thisArg?: This
1822
): void;
19-
get(key: K): V | undefined;
20-
has(key: K): boolean;
21-
set(key: K, value: V): this;
23+
/**
24+
* Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.
25+
* @returns Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
26+
@@ -30,18 +27,17 @@
2227
readonly size: number;
2328
}
2429

@@ -41,7 +46,7 @@ Index: es2015.collection.d.ts
4146
get(key: K): V | undefined;
4247
has(key: K): boolean;
4348
readonly size: number;
44-
@@ -35,37 +34,37 @@
49+
@@ -68,12 +64,12 @@
4550
set(key: K, value: V): this;
4651
}
4752

@@ -57,17 +62,25 @@ Index: es2015.collection.d.ts
5762
declare var WeakMap: WeakMapConstructor;
5863

5964
interface Set<T> {
60-
add(value: T): this;
61-
clear(): void;
65+
@@ -87,14 +83,11 @@
66+
* Removes a specified value from the Set.
67+
* @returns Returns true if an element in the Set existed and has been removed, or false if the element does not exist.
68+
*/
6269
delete(value: T): boolean;
70+
- /**
71+
- * Executes a provided function once per each value in the Set object, in insertion order.
72+
- */
6373
- forEach(
6474
- callbackfn: (value: T, value2: T, set: Set<T>) => void,
6575
- thisArg?: any
6676
+ forEach<This = undefined>(
6777
+ callbackfn: (this: This, value: T, value2: T, set: this) => void,
6878
+ thisArg?: This
6979
): void;
70-
has(value: T): boolean;
80+
/**
81+
* @returns a boolean indicating whether an element with the specified value exists in the Set or not.
82+
*/
83+
@@ -105,17 +98,17 @@
7184
readonly size: number;
7285
}
7386

docs/diff/es2015.core.d.ts.md

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -85,55 +85,14 @@ Index: es2015.core.d.ts
8585

8686
/**
8787
* Returns a new array from a set of elements.
88-
@@ -209,36 +219,35 @@
89-
* that is representable as a Number value, which is approximately:
90-
* 2.2204460492503130808472633361816 x 10‍−‍16.
91-
*/
92-
readonly EPSILON: number;
93-
-
94-
/**
95-
* Returns true if passed value is finite.
96-
* Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a
97-
* number. Only finite values of the type number, result in true.
98-
* @param number A numeric value.
99-
*/
100-
- isFinite(number: unknown): boolean;
101-
+ isFinite(number: unknown): number is number;
102-
103-
/**
104-
* Returns true if the value passed is an integer, false otherwise.
105-
* @param number A numeric value.
106-
*/
107-
- isInteger(number: unknown): boolean;
108-
+ isInteger(number: unknown): number is number;
109-
110-
/**
111-
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
112-
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
113-
* to a number. Only values of the type number, that are also NaN, result in true.
114-
* @param number A numeric value.
115-
*/
116-
- isNaN(number: unknown): boolean;
117-
+ isNaN(number: unknown): number is number;
118-
119-
/**
120-
* Returns true if the value passed is a safe integer.
121-
* @param number A numeric value.
122-
*/
123-
- isSafeInteger(number: unknown): boolean;
124-
+ isSafeInteger(number: unknown): number is number;
125-
126-
/**
127-
* The value of the largest integer n such that n and n + 1 are both exactly representable as
128-
* a Number value.
129-
@@ -273,49 +282,20 @@
88+
@@ -273,49 +283,20 @@
13089
/**
13190
* Copy the values of all of the enumerable own properties from one or more source objects to a
13291
* target object. Returns the target object.
13392
* @param target The target object to copy to.
13493
- * @param source The source object from which to copy properties.
13594
- */
136-
- assign<T, U>(target: T, source: U): T & U;
95+
- assign<T extends {}, U>(target: T, source: U): T & U;
13796
-
13897
- /**
13998
- * Copy the values of all of the enumerable own properties from one or more source objects to a
@@ -142,7 +101,7 @@ Index: es2015.core.d.ts
142101
- * @param source1 The first source object from which to copy properties.
143102
- * @param source2 The second source object from which to copy properties.
144103
- */
145-
- assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
104+
- assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
146105
-
147106
- /**
148107
- * Copy the values of all of the enumerable own properties from one or more source objects to a
@@ -152,7 +111,7 @@ Index: es2015.core.d.ts
152111
- * @param source2 The second source object from which to copy properties.
153112
- * @param source3 The third source object from which to copy properties.
154113
- */
155-
- assign<T, U, V, W>(
114+
- assign<T extends {}, U, V, W>(
156115
- target: T,
157116
- source1: U,
158117
- source2: V,
@@ -181,7 +140,7 @@ Index: es2015.core.d.ts
181140
/**
182141
* Returns the names of the enumerable string properties and methods of an object.
183142
* @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.
184-
@@ -326,16 +306,23 @@
143+
@@ -326,16 +307,23 @@
185144
* Returns true if the values are the same value, false otherwise.
186145
* @param value1 The first value.
187146
* @param value2 The second value.
@@ -207,7 +166,7 @@ Index: es2015.core.d.ts
207166

208167
interface ReadonlyArray<T> {
209168
/**
210-
@@ -346,20 +333,25 @@
169+
@@ -346,20 +334,25 @@
211170
* immediately returns that element value. Otherwise, find returns undefined.
212171
* @param thisArg If provided, it will be used as the this value for each invocation of
213172
* predicate. If it is not provided, undefined is used instead.
@@ -244,7 +203,7 @@ Index: es2015.core.d.ts
244203

245204
/**
246205
* Returns the index of the first element in the array where predicate is true, and -1
247-
@@ -369,11 +361,11 @@
206+
@@ -369,11 +362,11 @@
248207
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
249208
* @param thisArg If provided, it will be used as the this value for each invocation of
250209
* predicate. If it is not provided, undefined is used instead.
@@ -259,7 +218,7 @@ Index: es2015.core.d.ts
259218
}
260219

261220
interface RegExp {
262-
@@ -433,26 +425,17 @@
221+
@@ -433,26 +426,17 @@
263222
* same as the corresponding elements of this object (converted to a String) starting at
264223
* endPosition – length(this). Otherwise returns false.
265224
*/

docs/diff/es2015.proxy.d.ts.md

Lines changed: 82 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,117 @@ Index: es2015.proxy.d.ts
55
===================================================================
66
--- es2015.proxy.d.ts
77
+++ es2015.proxy.d.ts
8-
@@ -1,25 +1,25 @@
8+
@@ -1,101 +1,35 @@
99
interface ProxyHandler<T extends object> {
10+
- /**
11+
- * A trap method for a function call.
12+
- * @param target The original callable object which is being proxied.
13+
- */
1014
- apply?(target: T, thisArg: any, argArray: any[]): any;
15+
-
16+
- /**
17+
- * A trap for the `new` operator.
18+
- * @param target The original object which is being proxied.
19+
- * @param newTarget The constructor that was originally called.
20+
- */
1121
- construct?(target: T, argArray: any[], newTarget: Function): object;
22+
-
23+
- /**
24+
- * A trap for `Object.defineProperty()`.
25+
- * @param target The original object which is being proxied.
26+
- * @returns A `Boolean` indicating whether or not the property has been defined.
27+
- */
1228
+ apply?(target: T, thisArg: unknown, argArray: unknown[]): any;
1329
+ construct?(target: T, argArray: unknown[], newTarget: unknown): object;
1430
defineProperty?(
1531
target: T,
16-
- p: string | symbol,
32+
- property: string | symbol,
1733
+ p: PropertyKey,
1834
attributes: PropertyDescriptor
1935
): boolean;
36+
-
37+
- /**
38+
- * A trap for the `delete` operator.
39+
- * @param target The original object which is being proxied.
40+
- * @param p The name or `Symbol` of the property to delete.
41+
- * @returns A `Boolean` indicating whether or not the property was deleted.
42+
- */
2043
- deleteProperty?(target: T, p: string | symbol): boolean;
44+
-
45+
- /**
46+
- * A trap for getting a property value.
47+
- * @param target The original object which is being proxied.
48+
- * @param p The name or `Symbol` of the property to get.
49+
- * @param receiver The proxy or an object that inherits from the proxy.
50+
- */
2151
- get?(target: T, p: string | symbol, receiver: any): any;
52+
-
53+
- /**
54+
- * A trap for `Object.getOwnPropertyDescriptor()`.
55+
- * @param target The original object which is being proxied.
56+
- * @param p The name of the property whose description should be retrieved.
57+
- */
2258
+ deleteProperty?(target: T, p: PropertyKey): boolean;
2359
+ get?(target: T, p: PropertyKey, receiver: unknown): any;
2460
getOwnPropertyDescriptor?(
2561
target: T,
2662
- p: string | symbol
2763
+ p: PropertyKey
2864
): PropertyDescriptor | undefined;
65+
-
66+
- /**
67+
- * A trap for the `[[GetPrototypeOf]]` internal method.
68+
- * @param target The original object which is being proxied.
69+
- */
2970
getPrototypeOf?(target: T): object | null;
30-
- has?(target: T, p: string | symbol): boolean;
3171
+ has?(target: T, p: PropertyKey): boolean;
72+
73+
/**
74+
- * A trap for the `in` operator.
75+
- * @param target The original object which is being proxied.
76+
- * @param p The name or `Symbol` of the property to check for existence.
77+
- */
78+
- has?(target: T, p: string | symbol): boolean;
79+
-
80+
- /**
81+
* A trap for `Object.isExtensible()`.
82+
* @param target The original object which is being proxied.
83+
*/
3284
isExtensible?(target: T): boolean;
33-
- ownKeys?(target: T): ArrayLike<string | symbol>;
3485
+ ownKeys?(target: T): PropertyKey[];
86+
87+
/**
88+
- * A trap for `Reflect.ownKeys()`.
89+
- * @param target The original object which is being proxied.
90+
- */
91+
- ownKeys?(target: T): ArrayLike<string | symbol>;
92+
-
93+
- /**
94+
* A trap for `Object.preventExtensions()`.
95+
* @param target The original object which is being proxied.
96+
*/
3597
preventExtensions?(target: T): boolean;
36-
- set?(target: T, p: string | symbol, value: any, receiver: any): boolean;
98+
-
99+
- /**
100+
- * A trap for setting a property value.
101+
- * @param target The original object which is being proxied.
102+
- * @param p The name or `Symbol` of the property to set.
103+
- * @param receiver The object to which the assignment was originally directed.
104+
- * @returns A `Boolean` indicating whether or not the property was set.
105+
- */
106+
- set?(target: T, p: string | symbol, newValue: any, receiver: any): boolean;
107+
-
108+
- /**
109+
- * A trap for `Object.setPrototypeOf()`.
110+
- * @param target The original object which is being proxied.
111+
- * @param newPrototype The object's new prototype or `null`.
112+
- */
37113
- setPrototypeOf?(target: T, v: object | null): boolean;
38114
+ set?(target: T, p: PropertyKey, value: unknown, receiver: unknown): boolean;
39115
+ setPrototypeOf?(target: T, v: unknown): boolean;
40116
}
41117

42118
interface ProxyConstructor {
43-
revocable<T extends object>(
119+
/**
44120

45121
```

0 commit comments

Comments
 (0)