typescript 4.4.3 → 4.5.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/SECURITY.md +41 -0
  2. package/lib/cs/diagnosticMessages.generated.json +47 -59
  3. package/lib/de/diagnosticMessages.generated.json +50 -62
  4. package/lib/es/diagnosticMessages.generated.json +48 -60
  5. package/lib/fr/diagnosticMessages.generated.json +50 -62
  6. package/lib/it/diagnosticMessages.generated.json +50 -62
  7. package/lib/ja/diagnosticMessages.generated.json +50 -62
  8. package/lib/ko/diagnosticMessages.generated.json +47 -59
  9. package/lib/lib.dom.d.ts +669 -1896
  10. package/lib/lib.dom.iterable.d.ts +16 -48
  11. package/lib/lib.es2015.core.d.ts +53 -13
  12. package/lib/lib.es2015.iterable.d.ts +2 -10
  13. package/lib/lib.es2015.promise.d.ts +2 -74
  14. package/lib/lib.es2018.intl.d.ts +23 -11
  15. package/lib/lib.es2019.string.d.ts +8 -2
  16. package/lib/lib.es2020.intl.d.ts +173 -114
  17. package/lib/lib.es2020.promise.d.ts +2 -3
  18. package/lib/lib.es2021.d.ts +1 -0
  19. package/lib/lib.es2021.intl.d.ts +44 -0
  20. package/lib/lib.es2021.promise.d.ts +8 -1
  21. package/lib/lib.es5.d.ts +101 -41
  22. package/lib/lib.esnext.intl.d.ts +1 -10
  23. package/lib/lib.webworker.d.ts +183 -520
  24. package/lib/lib.webworker.iterable.d.ts +10 -30
  25. package/lib/pl/diagnosticMessages.generated.json +50 -62
  26. package/lib/protocol.d.ts +1 -0
  27. package/lib/pt-br/diagnosticMessages.generated.json +50 -62
  28. package/lib/ru/diagnosticMessages.generated.json +48 -60
  29. package/lib/tr/diagnosticMessages.generated.json +50 -62
  30. package/lib/tsc.js +7109 -5440
  31. package/lib/tsserver.js +11335 -8683
  32. package/lib/tsserverlibrary.d.ts +382 -273
  33. package/lib/tsserverlibrary.js +11335 -8683
  34. package/lib/typescript.d.ts +379 -271
  35. package/lib/typescript.js +11312 -8670
  36. package/lib/typescriptServices.d.ts +379 -271
  37. package/lib/typescriptServices.js +11312 -8670
  38. package/lib/typingsInstaller.js +8269 -6299
  39. package/lib/zh-cn/diagnosticMessages.generated.json +50 -62
  40. package/lib/zh-tw/diagnosticMessages.generated.json +50 -62
  41. package/package.json +5 -7
@@ -78,17 +78,11 @@ interface FontFaceSet extends Set<FontFace> {
78
78
 
79
79
  interface FormData {
80
80
  [Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
81
- /**
82
- * Returns an array of key, value pairs for every entry in the list.
83
- */
81
+ /** Returns an array of key, value pairs for every entry in the list. */
84
82
  entries(): IterableIterator<[string, FormDataEntryValue]>;
85
- /**
86
- * Returns a list of keys in the list.
87
- */
83
+ /** Returns a list of keys in the list. */
88
84
  keys(): IterableIterator<string>;
89
- /**
90
- * Returns a list of values in the list.
91
- */
85
+ /** Returns a list of values in the list. */
92
86
  values(): IterableIterator<FormDataEntryValue>;
93
87
  }
94
88
 
@@ -114,24 +108,16 @@ interface HTMLSelectElement {
114
108
 
115
109
  interface Headers {
116
110
  [Symbol.iterator](): IterableIterator<[string, string]>;
117
- /**
118
- * Returns an iterator allowing to go through all key/value pairs contained in this object.
119
- */
111
+ /** Returns an iterator allowing to go through all key/value pairs contained in this object. */
120
112
  entries(): IterableIterator<[string, string]>;
121
- /**
122
- * Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
123
- */
113
+ /** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
124
114
  keys(): IterableIterator<string>;
125
- /**
126
- * Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
127
- */
115
+ /** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
128
116
  values(): IterableIterator<string>;
129
117
  }
130
118
 
131
119
  interface IDBDatabase {
132
- /**
133
- * Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names.
134
- */
120
+ /** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
135
121
  transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
136
122
  }
137
123
 
@@ -175,33 +161,21 @@ interface Navigator {
175
161
 
176
162
  interface NodeList {
177
163
  [Symbol.iterator](): IterableIterator<Node>;
178
- /**
179
- * Returns an array of key, value pairs for every entry in the list.
180
- */
164
+ /** Returns an array of key, value pairs for every entry in the list. */
181
165
  entries(): IterableIterator<[number, Node]>;
182
- /**
183
- * Returns an list of keys in the list.
184
- */
166
+ /** Returns an list of keys in the list. */
185
167
  keys(): IterableIterator<number>;
186
- /**
187
- * Returns an list of values in the list.
188
- */
168
+ /** Returns an list of values in the list. */
189
169
  values(): IterableIterator<Node>;
190
170
  }
191
171
 
192
172
  interface NodeListOf<TNode extends Node> {
193
173
  [Symbol.iterator](): IterableIterator<TNode>;
194
- /**
195
- * Returns an array of key, value pairs for every entry in the list.
196
- */
174
+ /** Returns an array of key, value pairs for every entry in the list. */
197
175
  entries(): IterableIterator<[number, TNode]>;
198
- /**
199
- * Returns an list of keys in the list.
200
- */
176
+ /** Returns an list of keys in the list. */
201
177
  keys(): IterableIterator<number>;
202
- /**
203
- * Returns an list of values in the list.
204
- */
178
+ /** Returns an list of values in the list. */
205
179
  values(): IterableIterator<TNode>;
206
180
  }
207
181
 
@@ -283,17 +257,11 @@ interface TouchList {
283
257
 
284
258
  interface URLSearchParams {
285
259
  [Symbol.iterator](): IterableIterator<[string, string]>;
286
- /**
287
- * Returns an array of key, value pairs for every entry in the search params.
288
- */
260
+ /** Returns an array of key, value pairs for every entry in the search params. */
289
261
  entries(): IterableIterator<[string, string]>;
290
- /**
291
- * Returns a list of keys in the search params.
292
- */
262
+ /** Returns a list of keys in the search params. */
293
263
  keys(): IterableIterator<string>;
294
- /**
295
- * Returns a list of values in the search params.
296
- */
264
+ /** Returns a list of values in the search params. */
297
265
  values(): IterableIterator<string>;
298
266
  }
299
267
 
@@ -455,47 +455,87 @@ interface String {
455
455
 
456
456
  /**
457
457
  * Returns an `<a>` HTML anchor element and sets the name attribute to the text value
458
+ * @deprecated A legacy feature for browser compatibility
458
459
  * @param name
459
460
  */
460
461
  anchor(name: string): string;
461
462
 
462
- /** Returns a `<big>` HTML element */
463
+ /**
464
+ * Returns a `<big>` HTML element
465
+ * @deprecated A legacy feature for browser compatibility
466
+ */
463
467
  big(): string;
464
468
 
465
- /** Returns a `<blink>` HTML element */
469
+ /**
470
+ * Returns a `<blink>` HTML element
471
+ * @deprecated A legacy feature for browser compatibility
472
+ */
466
473
  blink(): string;
467
474
 
468
- /** Returns a `<b>` HTML element */
475
+ /**
476
+ * Returns a `<b>` HTML element
477
+ * @deprecated A legacy feature for browser compatibility
478
+ */
469
479
  bold(): string;
470
480
 
471
- /** Returns a `<tt>` HTML element */
481
+ /**
482
+ * Returns a `<tt>` HTML element
483
+ * @deprecated A legacy feature for browser compatibility
484
+ */
472
485
  fixed(): string;
473
486
 
474
- /** Returns a `<font>` HTML element and sets the color attribute value */
487
+ /**
488
+ * Returns a `<font>` HTML element and sets the color attribute value
489
+ * @deprecated A legacy feature for browser compatibility
490
+ */
475
491
  fontcolor(color: string): string;
476
492
 
477
- /** Returns a `<font>` HTML element and sets the size attribute value */
493
+ /**
494
+ * Returns a `<font>` HTML element and sets the size attribute value
495
+ * @deprecated A legacy feature for browser compatibility
496
+ */
478
497
  fontsize(size: number): string;
479
498
 
480
- /** Returns a `<font>` HTML element and sets the size attribute value */
499
+ /**
500
+ * Returns a `<font>` HTML element and sets the size attribute value
501
+ * @deprecated A legacy feature for browser compatibility
502
+ */
481
503
  fontsize(size: string): string;
482
504
 
483
- /** Returns an `<i>` HTML element */
505
+ /**
506
+ * Returns an `<i>` HTML element
507
+ * @deprecated A legacy feature for browser compatibility
508
+ */
484
509
  italics(): string;
485
510
 
486
- /** Returns an `<a>` HTML element and sets the href attribute value */
511
+ /**
512
+ * Returns an `<a>` HTML element and sets the href attribute value
513
+ * @deprecated A legacy feature for browser compatibility
514
+ */
487
515
  link(url: string): string;
488
516
 
489
- /** Returns a `<small>` HTML element */
517
+ /**
518
+ * Returns a `<small>` HTML element
519
+ * @deprecated A legacy feature for browser compatibility
520
+ */
490
521
  small(): string;
491
522
 
492
- /** Returns a `<strike>` HTML element */
523
+ /**
524
+ * Returns a `<strike>` HTML element
525
+ * @deprecated A legacy feature for browser compatibility
526
+ */
493
527
  strike(): string;
494
528
 
495
- /** Returns a `<sub>` HTML element */
529
+ /**
530
+ * Returns a `<sub>` HTML element
531
+ * @deprecated A legacy feature for browser compatibility
532
+ */
496
533
  sub(): string;
497
534
 
498
- /** Returns a `<sup>` HTML element */
535
+ /**
536
+ * Returns a `<sup>` HTML element
537
+ * @deprecated A legacy feature for browser compatibility
538
+ */
499
539
  sup(): string;
500
540
  }
501
541
 
@@ -223,7 +223,7 @@ interface PromiseConstructor {
223
223
  * @param values An iterable of Promises.
224
224
  * @returns A new Promise.
225
225
  */
226
- all<T>(values: Iterable<T | PromiseLike<T>>): Promise<T[]>;
226
+ all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
227
227
 
228
228
  /**
229
229
  * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
@@ -231,15 +231,7 @@ interface PromiseConstructor {
231
231
  * @param values An iterable of Promises.
232
232
  * @returns A new Promise.
233
233
  */
234
- race<T>(values: Iterable<T>): Promise<T extends PromiseLike<infer U> ? U : T>;
235
-
236
- /**
237
- * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
238
- * or rejected.
239
- * @param values An iterable of Promises.
240
- * @returns A new Promise.
241
- */
242
- race<T>(values: Iterable<T | PromiseLike<T>>): Promise<T>;
234
+ race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
243
235
  }
244
236
 
245
237
  interface String {
@@ -38,79 +38,7 @@ interface PromiseConstructor {
38
38
  * @param values An array of Promises.
39
39
  * @returns A new Promise.
40
40
  */
41
- all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: readonly [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]>;
42
-
43
- /**
44
- * Creates a Promise that is resolved with an array of results when all of the provided Promises
45
- * resolve, or rejected when any Promise is rejected.
46
- * @param values An array of Promises.
47
- * @returns A new Promise.
48
- */
49
- all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: readonly [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]>;
50
-
51
- /**
52
- * Creates a Promise that is resolved with an array of results when all of the provided Promises
53
- * resolve, or rejected when any Promise is rejected.
54
- * @param values An array of Promises.
55
- * @returns A new Promise.
56
- */
57
- all<T1, T2, T3, T4, T5, T6, T7, T8>(values: readonly [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]>;
58
-
59
- /**
60
- * Creates a Promise that is resolved with an array of results when all of the provided Promises
61
- * resolve, or rejected when any Promise is rejected.
62
- * @param values An array of Promises.
63
- * @returns A new Promise.
64
- */
65
- all<T1, T2, T3, T4, T5, T6, T7>(values: readonly [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]>;
66
-
67
- /**
68
- * Creates a Promise that is resolved with an array of results when all of the provided Promises
69
- * resolve, or rejected when any Promise is rejected.
70
- * @param values An array of Promises.
71
- * @returns A new Promise.
72
- */
73
- all<T1, T2, T3, T4, T5, T6>(values: readonly [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]>;
74
-
75
- /**
76
- * Creates a Promise that is resolved with an array of results when all of the provided Promises
77
- * resolve, or rejected when any Promise is rejected.
78
- * @param values An array of Promises.
79
- * @returns A new Promise.
80
- */
81
- all<T1, T2, T3, T4, T5>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>, T5 | PromiseLike<T5>]): Promise<[T1, T2, T3, T4, T5]>;
82
-
83
- /**
84
- * Creates a Promise that is resolved with an array of results when all of the provided Promises
85
- * resolve, or rejected when any Promise is rejected.
86
- * @param values An array of Promises.
87
- * @returns A new Promise.
88
- */
89
- all<T1, T2, T3, T4>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>]): Promise<[T1, T2, T3, T4]>;
90
-
91
- /**
92
- * Creates a Promise that is resolved with an array of results when all of the provided Promises
93
- * resolve, or rejected when any Promise is rejected.
94
- * @param values An array of Promises.
95
- * @returns A new Promise.
96
- */
97
- all<T1, T2, T3>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]): Promise<[T1, T2, T3]>;
98
-
99
- /**
100
- * Creates a Promise that is resolved with an array of results when all of the provided Promises
101
- * resolve, or rejected when any Promise is rejected.
102
- * @param values An array of Promises.
103
- * @returns A new Promise.
104
- */
105
- all<T1, T2>(values: readonly [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;
106
-
107
- /**
108
- * Creates a Promise that is resolved with an array of results when all of the provided Promises
109
- * resolve, or rejected when any Promise is rejected.
110
- * @param values An array of Promises.
111
- * @returns A new Promise.
112
- */
113
- all<T>(values: readonly (T | PromiseLike<T>)[]): Promise<T[]>;
41
+ all<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]> }>;
114
42
 
115
43
  // see: lib.es2015.iterable.d.ts
116
44
  // all<T>(values: Iterable<T | PromiseLike<T>>): Promise<T[]>;
@@ -121,7 +49,7 @@ interface PromiseConstructor {
121
49
  * @param values An array of Promises.
122
50
  * @returns A new Promise.
123
51
  */
124
- race<T>(values: readonly T[]): Promise<T extends PromiseLike<infer U> ? U : T>;
52
+ race<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
125
53
 
126
54
  // see: lib.es2015.iterable.d.ts
127
55
  // race<T>(values: Iterable<T>): Promise<T extends PromiseLike<infer U> ? U : T>;
@@ -25,13 +25,13 @@ declare namespace Intl {
25
25
  type PluralRuleType = "cardinal" | "ordinal";
26
26
 
27
27
  interface PluralRulesOptions {
28
- localeMatcher?: "lookup" | "best fit";
29
- type?: PluralRuleType;
30
- minimumIntegerDigits?: number;
31
- minimumFractionDigits?: number;
32
- maximumFractionDigits?: number;
33
- minimumSignificantDigits?: number;
34
- maximumSignificantDigits?: number;
28
+ localeMatcher?: "lookup" | "best fit" | undefined;
29
+ type?: PluralRuleType | undefined;
30
+ minimumIntegerDigits?: number | undefined;
31
+ minimumFractionDigits?: number | undefined;
32
+ maximumFractionDigits?: number | undefined;
33
+ minimumSignificantDigits?: number | undefined;
34
+ maximumSignificantDigits?: number | undefined;
35
35
  }
36
36
 
37
37
  interface ResolvedPluralRulesOptions {
@@ -53,9 +53,21 @@ declare namespace Intl {
53
53
  const PluralRules: {
54
54
  new (locales?: string | string[], options?: PluralRulesOptions): PluralRules;
55
55
  (locales?: string | string[], options?: PluralRulesOptions): PluralRules;
56
- supportedLocalesOf(
57
- locales: string | string[],
58
- options?: PluralRulesOptions,
59
- ): string[];
56
+
57
+ supportedLocalesOf(locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit" }): string[];
60
58
  };
59
+
60
+ // We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here:
61
+ type ES2018NumberFormatPartType = "literal" | "nan" | "infinity" | "percent" | "integer" | "group" | "decimal" | "fraction" | "plusSign" | "minusSign" | "percentSign" | "currency" | "code" | "symbol" | "name";
62
+ type ES2020NumberFormatPartType = "compact" | "exponentInteger" | "exponentMinusSign" | "exponentSeparator" | "unit" | "unknown";
63
+ type NumberFormatPartTypes = ES2018NumberFormatPartType | ES2020NumberFormatPartType;
64
+
65
+ interface NumberFormatPart {
66
+ type: NumberFormatPartTypes;
67
+ value: string;
68
+ }
69
+
70
+ interface NumberFormat {
71
+ formatToParts(number?: number | bigint): NumberFormatPart[];
72
+ }
61
73
  }
@@ -25,9 +25,15 @@ interface String {
25
25
  /** Removes the leading white space and line terminator characters from a string. */
26
26
  trimStart(): string;
27
27
 
28
- /** Removes the leading white space and line terminator characters from a string. */
28
+ /**
29
+ * Removes the leading white space and line terminator characters from a string.
30
+ * @deprecated A legacy feature for browser compatibility. Use `trimStart` instead
31
+ */
29
32
  trimLeft(): string;
30
33
 
31
- /** Removes the trailing white space and line terminator characters from a string. */
34
+ /**
35
+ * Removes the trailing white space and line terminator characters from a string.
36
+ * @deprecated A legacy feature for browser compatibility. Use `trimEnd` instead
37
+ */
32
38
  trimRight(): string;
33
39
  }