typescript 5.3.3 → 5.4.2

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 (47) hide show
  1. package/README.md +1 -1
  2. package/lib/cancellationToken.js +0 -1
  3. package/lib/cs/diagnosticMessages.generated.json +1 -1
  4. package/lib/de/diagnosticMessages.generated.json +1 -1
  5. package/lib/es/diagnosticMessages.generated.json +1 -1
  6. package/lib/fr/diagnosticMessages.generated.json +1 -1
  7. package/lib/it/diagnosticMessages.generated.json +1 -1
  8. package/lib/ja/diagnosticMessages.generated.json +1 -1
  9. package/lib/ko/diagnosticMessages.generated.json +1 -1
  10. package/lib/lib.dom.asynciterable.d.ts +28 -0
  11. package/lib/lib.dom.d.ts +363 -153
  12. package/lib/lib.dom.iterable.d.ts +35 -28
  13. package/lib/lib.es2016.d.ts +1 -0
  14. package/lib/lib.es2016.intl.d.ts +31 -0
  15. package/lib/lib.es2018.full.d.ts +1 -0
  16. package/lib/lib.es2018.intl.d.ts +6 -5
  17. package/lib/lib.es2019.full.d.ts +1 -0
  18. package/lib/lib.es2020.full.d.ts +1 -0
  19. package/lib/lib.es2020.intl.d.ts +36 -16
  20. package/lib/lib.es2020.string.d.ts +15 -1
  21. package/lib/lib.es2021.full.d.ts +1 -0
  22. package/lib/lib.es2021.intl.d.ts +2 -2
  23. package/lib/lib.es2022.full.d.ts +1 -0
  24. package/lib/lib.es2022.intl.d.ts +2 -2
  25. package/lib/lib.es2023.full.d.ts +1 -0
  26. package/lib/lib.es5.d.ts +21 -6
  27. package/lib/lib.esnext.collection.d.ts +29 -0
  28. package/lib/lib.esnext.d.ts +3 -0
  29. package/lib/lib.esnext.disposable.d.ts +1 -1
  30. package/lib/lib.esnext.full.d.ts +1 -0
  31. package/lib/lib.esnext.object.d.ts +29 -0
  32. package/lib/lib.esnext.promise.d.ts +35 -0
  33. package/lib/lib.webworker.asynciterable.d.ts +28 -0
  34. package/lib/lib.webworker.d.ts +202 -111
  35. package/lib/lib.webworker.iterable.d.ts +29 -28
  36. package/lib/pl/diagnosticMessages.generated.json +1 -1
  37. package/lib/pt-br/diagnosticMessages.generated.json +1 -1
  38. package/lib/ru/diagnosticMessages.generated.json +1 -1
  39. package/lib/tr/diagnosticMessages.generated.json +1 -1
  40. package/lib/tsc.js +2685 -1330
  41. package/lib/tsserver.js +4611 -2423
  42. package/lib/typescript.d.ts +95 -30
  43. package/lib/typescript.js +4568 -2219
  44. package/lib/typingsInstaller.js +501 -218
  45. package/lib/zh-cn/diagnosticMessages.generated.json +1 -1
  46. package/lib/zh-tw/diagnosticMessages.generated.json +1 -1
  47. package/package.json +28 -29
@@ -152,6 +152,12 @@ interface Headers {
152
152
  values(): IterableIterator<string>;
153
153
  }
154
154
 
155
+ interface Highlight extends Set<AbstractRange> {
156
+ }
157
+
158
+ interface HighlightRegistry extends Map<string, Highlight> {
159
+ }
160
+
155
161
  interface IDBDatabase {
156
162
  /**
157
163
  * 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.
@@ -305,6 +311,7 @@ interface SubtleCrypto {
305
311
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/deriveKey) */
306
312
  deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
307
313
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
314
+ generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
308
315
  generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
309
316
  generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
310
317
  generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
@@ -344,22 +351,22 @@ interface WEBGL_draw_buffers {
344
351
 
345
352
  interface WEBGL_multi_draw {
346
353
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawArraysInstancedWEBGL) */
347
- multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
354
+ multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: number, countsList: Int32Array | Iterable<GLsizei>, countsOffset: number, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: number, drawcount: GLsizei): void;
348
355
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawArraysWEBGL) */
349
- multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, drawcount: GLsizei): void;
356
+ multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: number, countsList: Int32Array | Iterable<GLsizei>, countsOffset: number, drawcount: GLsizei): void;
350
357
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawElementsInstancedWEBGL) */
351
- multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
358
+ multiDrawElementsInstancedWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: number, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: number, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: number, drawcount: GLsizei): void;
352
359
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WEBGL_multi_draw/multiDrawElementsWEBGL) */
353
- multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
360
+ multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: number, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: number, drawcount: GLsizei): void;
354
361
  }
355
362
 
356
363
  interface WebGL2RenderingContextBase {
357
364
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/clearBuffer) */
358
- clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
365
+ clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: number): void;
359
366
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/clearBuffer) */
360
- clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;
367
+ clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: number): void;
361
368
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/clearBuffer) */
362
- clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLuint>, srcOffset?: GLuint): void;
369
+ clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLuint>, srcOffset?: number): void;
363
370
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/drawBuffers) */
364
371
  drawBuffers(buffers: Iterable<GLenum>): void;
365
372
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/getActiveUniforms) */
@@ -373,25 +380,25 @@ interface WebGL2RenderingContextBase {
373
380
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/transformFeedbackVaryings) */
374
381
  transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable<string>, bufferMode: GLenum): void;
375
382
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniform) */
376
- uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
383
+ uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: number, srcLength?: GLuint): void;
377
384
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniform) */
378
- uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
385
+ uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: number, srcLength?: GLuint): void;
379
386
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniform) */
380
- uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
387
+ uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: number, srcLength?: GLuint): void;
381
388
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniform) */
382
- uniform4uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
389
+ uniform4uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: number, srcLength?: GLuint): void;
383
390
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
384
- uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
391
+ uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
385
392
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
386
- uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
393
+ uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
387
394
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
388
- uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
395
+ uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
389
396
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
390
- uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
397
+ uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
391
398
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
392
- uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
399
+ uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
393
400
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/uniformMatrix) */
394
- uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
401
+ uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
395
402
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/vertexAttribI) */
396
403
  vertexAttribI4iv(index: GLuint, values: Iterable<GLint>): void;
397
404
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/vertexAttribI) */
@@ -400,27 +407,27 @@ interface WebGL2RenderingContextBase {
400
407
 
401
408
  interface WebGL2RenderingContextOverloads {
402
409
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
403
- uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
410
+ uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
404
411
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
405
- uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
412
+ uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: number, srcLength?: GLuint): void;
406
413
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
407
- uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
414
+ uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
408
415
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
409
- uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
416
+ uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: number, srcLength?: GLuint): void;
410
417
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
411
- uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
418
+ uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
412
419
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
413
- uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
420
+ uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: number, srcLength?: GLuint): void;
414
421
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
415
- uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
422
+ uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
416
423
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniform) */
417
- uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
424
+ uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: number, srcLength?: GLuint): void;
418
425
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniformMatrix) */
419
- uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
426
+ uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
420
427
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniformMatrix) */
421
- uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
428
+ uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
422
429
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/uniformMatrix) */
423
- uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
430
+ uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: number, srcLength?: GLuint): void;
424
431
  }
425
432
 
426
433
  interface WebGLRenderingContextBase {
@@ -18,3 +18,4 @@ and limitations under the License.
18
18
 
19
19
  /// <reference lib="es2015" />
20
20
  /// <reference lib="es2016.array.include" />
21
+ /// <reference lib="es2016.intl" />
@@ -0,0 +1,31 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+ /// <reference no-default-lib="true"/>
18
+
19
+ declare namespace Intl {
20
+ /**
21
+ * The `Intl.getCanonicalLocales()` method returns an array containing
22
+ * the canonical locale names. Duplicates will be omitted and elements
23
+ * will be validated as structurally valid language tags.
24
+ *
25
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales)
26
+ *
27
+ * @param locale A list of String values for which to get the canonical locale names
28
+ * @returns An array containing the canonical and validated locale names.
29
+ */
30
+ function getCanonicalLocales(locale?: string | readonly string[]): string[];
31
+ }
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -47,12 +47,13 @@ declare namespace Intl {
47
47
  select(n: number): LDMLPluralRule;
48
48
  }
49
49
 
50
- const PluralRules: {
51
- new (locales?: string | string[], options?: PluralRulesOptions): PluralRules;
52
- (locales?: string | string[], options?: PluralRulesOptions): PluralRules;
50
+ interface PluralRulesConstructor {
51
+ new (locales?: string | readonly string[], options?: PluralRulesOptions): PluralRules;
52
+ (locales?: string | readonly string[], options?: PluralRulesOptions): PluralRules;
53
+ supportedLocalesOf(locales: string | readonly string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
54
+ }
53
55
 
54
- supportedLocalesOf(locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
55
- };
56
+ const PluralRules: PluralRulesConstructor;
56
57
 
57
58
  // We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here:
58
59
  type ES2018NumberFormatPartType = "literal" | "nan" | "infinity" | "percent" | "integer" | "group" | "decimal" | "fraction" | "plusSign" | "minusSign" | "percentSign" | "currency" | "code" | "symbol" | "name";
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -19,9 +19,11 @@ and limitations under the License.
19
19
  /// <reference lib="es2018.intl" />
20
20
  declare namespace Intl {
21
21
  /**
22
- * [Unicode BCP 47 Locale Identifiers](https://unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers) definition.
22
+ * A string that is a valid [Unicode BCP 47 Locale Identifier](https://unicode.org/reports/tr35/#Unicode_locale_identifier).
23
23
  *
24
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
24
+ * For example: "fa", "es-MX", "zh-Hant-TW".
25
+ *
26
+ * See [MDN - Intl - locales argument](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
25
27
  */
26
28
  type UnicodeBCP47LocaleIdentifier = string;
27
29
 
@@ -89,16 +91,9 @@ declare namespace Intl {
89
91
  type RelativeTimeFormatStyle = "long" | "short" | "narrow";
90
92
 
91
93
  /**
92
- * [BCP 47 language tag](http://tools.ietf.org/html/rfc5646) definition.
94
+ * The locale or locales to use
93
95
  *
94
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
95
- */
96
- type BCP47LanguageTag = string;
97
-
98
- /**
99
- * The locale(s) to use
100
- *
101
- * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
96
+ * See [MDN - Intl - locales argument](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
102
97
  */
103
98
  type LocalesArgument = UnicodeBCP47LocaleIdentifier | Locale | readonly (UnicodeBCP47LocaleIdentifier | Locale)[] | undefined;
104
99
 
@@ -218,7 +213,7 @@ declare namespace Intl {
218
213
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat).
219
214
  */
220
215
  new (
221
- locales?: UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[],
216
+ locales?: LocalesArgument,
222
217
  options?: RelativeTimeFormatOptions,
223
218
  ): RelativeTimeFormat;
224
219
 
@@ -241,7 +236,7 @@ declare namespace Intl {
241
236
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf).
242
237
  */
243
238
  supportedLocalesOf(
244
- locales?: UnicodeBCP47LocaleIdentifier | UnicodeBCP47LocaleIdentifier[],
239
+ locales?: LocalesArgument,
245
240
  options?: RelativeTimeFormatOptions,
246
241
  ): UnicodeBCP47LocaleIdentifier[];
247
242
  };
@@ -312,7 +307,7 @@ declare namespace Intl {
312
307
  /** Attempts to remove information about the locale that would be added by calling `Locale.maximize()`. */
313
308
  minimize(): Locale;
314
309
  /** Returns the locale's full locale identifier string. */
315
- toString(): BCP47LanguageTag;
310
+ toString(): UnicodeBCP47LocaleIdentifier;
316
311
  }
317
312
 
318
313
  /**
@@ -330,7 +325,7 @@ declare namespace Intl {
330
325
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale).
331
326
  */
332
327
  const Locale: {
333
- new (tag: BCP47LanguageTag | Locale, options?: LocaleOptions): Locale;
328
+ new (tag: UnicodeBCP47LocaleIdentifier | Locale, options?: LocaleOptions): Locale;
334
329
  };
335
330
 
336
331
  type DisplayNamesFallback =
@@ -424,6 +419,31 @@ declare namespace Intl {
424
419
  *
425
420
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
426
421
  */
427
- supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): BCP47LanguageTag[];
422
+ supportedLocalesOf(locales?: LocalesArgument, options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher; }): UnicodeBCP47LocaleIdentifier[];
428
423
  };
424
+
425
+ interface CollatorConstructor {
426
+ new (locales?: LocalesArgument, options?: CollatorOptions): Collator;
427
+ (locales?: LocalesArgument, options?: CollatorOptions): Collator;
428
+ supportedLocalesOf(locales: LocalesArgument, options?: CollatorOptions): string[];
429
+ }
430
+
431
+ interface DateTimeFormatConstructor {
432
+ new (locales?: LocalesArgument, options?: DateTimeFormatOptions): DateTimeFormat;
433
+ (locales?: LocalesArgument, options?: DateTimeFormatOptions): DateTimeFormat;
434
+ supportedLocalesOf(locales: LocalesArgument, options?: DateTimeFormatOptions): string[];
435
+ }
436
+
437
+ interface NumberFormatConstructor {
438
+ new (locales?: LocalesArgument, options?: NumberFormatOptions): NumberFormat;
439
+ (locales?: LocalesArgument, options?: NumberFormatOptions): NumberFormat;
440
+ supportedLocalesOf(locales: LocalesArgument, options?: NumberFormatOptions): string[];
441
+ }
442
+
443
+ interface PluralRulesConstructor {
444
+ new (locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules;
445
+ (locales?: LocalesArgument, options?: PluralRulesOptions): PluralRules;
446
+
447
+ supportedLocalesOf(locales: LocalesArgument, options?: { localeMatcher?: "lookup" | "best fit"; }): string[];
448
+ }
429
449
  }
@@ -24,5 +24,19 @@ interface String {
24
24
  * containing the results of that search.
25
25
  * @param regexp A variable name or string literal containing the regular expression pattern and flags.
26
26
  */
27
- matchAll(regexp: RegExp): IterableIterator<RegExpMatchArray>;
27
+ matchAll(regexp: RegExp): IterableIterator<RegExpExecArray>;
28
+
29
+ /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */
30
+ toLocaleLowerCase(locales?: Intl.LocalesArgument): string;
31
+
32
+ /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */
33
+ toLocaleUpperCase(locales?: Intl.LocalesArgument): string;
34
+
35
+ /**
36
+ * Determines whether two strings are equivalent in the current or specified locale.
37
+ * @param that String to compare to target string
38
+ * @param locales A locale string or array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.
39
+ * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.
40
+ */
41
+ localeCompare(that: string, locales?: Intl.LocalesArgument, options?: Intl.CollatorOptions): number;
28
42
  }
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -143,7 +143,7 @@ declare namespace Intl {
143
143
  *
144
144
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat).
145
145
  */
146
- new (locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: ListFormatOptions): ListFormat;
146
+ new (locales?: LocalesArgument, options?: ListFormatOptions): ListFormat;
147
147
 
148
148
  /**
149
149
  * Returns an array containing those of the provided locales that are
@@ -161,6 +161,6 @@ declare namespace Intl {
161
161
  *
162
162
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/supportedLocalesOf).
163
163
  */
164
- supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick<ListFormatOptions, "localeMatcher">): BCP47LanguageTag[];
164
+ supportedLocalesOf(locales: LocalesArgument, options?: Pick<ListFormatOptions, "localeMatcher">): UnicodeBCP47LocaleIdentifier[];
165
165
  };
166
166
  }
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -89,7 +89,7 @@ declare namespace Intl {
89
89
  *
90
90
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter).
91
91
  */
92
- new (locales?: BCP47LanguageTag | BCP47LanguageTag[], options?: SegmenterOptions): Segmenter;
92
+ new (locales?: LocalesArgument, options?: SegmenterOptions): Segmenter;
93
93
 
94
94
  /**
95
95
  * Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale.
@@ -103,7 +103,7 @@ declare namespace Intl {
103
103
  *
104
104
  * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/supportedLocalesOf)
105
105
  */
106
- supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick<SegmenterOptions, "localeMatcher">): BCP47LanguageTag[];
106
+ supportedLocalesOf(locales: LocalesArgument, options?: Pick<SegmenterOptions, "localeMatcher">): UnicodeBCP47LocaleIdentifier[];
107
107
  };
108
108
 
109
109
  /**
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
package/lib/lib.es5.d.ts CHANGED
@@ -644,6 +644,7 @@ interface ImportCallOptions {
644
644
 
645
645
  /**
646
646
  * The type for the `assert` property of the optional second argument to `import()`.
647
+ * @deprecated
647
648
  */
648
649
  interface ImportAssertions {
649
650
  [key: string]: string;
@@ -1666,6 +1667,11 @@ type Capitalize<S extends string> = intrinsic;
1666
1667
  */
1667
1668
  type Uncapitalize<S extends string> = intrinsic;
1668
1669
 
1670
+ /**
1671
+ * Marker for non-inference type position
1672
+ */
1673
+ type NoInfer<T> = intrinsic;
1674
+
1669
1675
  /**
1670
1676
  * Marker for contextual 'this' type
1671
1677
  */
@@ -4418,11 +4424,14 @@ declare namespace Intl {
4418
4424
  compare(x: string, y: string): number;
4419
4425
  resolvedOptions(): ResolvedCollatorOptions;
4420
4426
  }
4421
- var Collator: {
4427
+
4428
+ interface CollatorConstructor {
4422
4429
  new (locales?: string | string[], options?: CollatorOptions): Collator;
4423
4430
  (locales?: string | string[], options?: CollatorOptions): Collator;
4424
4431
  supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];
4425
- };
4432
+ }
4433
+
4434
+ var Collator: CollatorConstructor;
4426
4435
 
4427
4436
  interface NumberFormatOptions {
4428
4437
  localeMatcher?: string | undefined;
@@ -4454,12 +4463,15 @@ declare namespace Intl {
4454
4463
  format(value: number): string;
4455
4464
  resolvedOptions(): ResolvedNumberFormatOptions;
4456
4465
  }
4457
- var NumberFormat: {
4466
+
4467
+ interface NumberFormatConstructor {
4458
4468
  new (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
4459
4469
  (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;
4460
4470
  supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];
4461
4471
  readonly prototype: NumberFormat;
4462
- };
4472
+ }
4473
+
4474
+ var NumberFormat: NumberFormatConstructor;
4463
4475
 
4464
4476
  interface DateTimeFormatOptions {
4465
4477
  localeMatcher?: "best fit" | "lookup" | undefined;
@@ -4498,12 +4510,15 @@ declare namespace Intl {
4498
4510
  format(date?: Date | number): string;
4499
4511
  resolvedOptions(): ResolvedDateTimeFormatOptions;
4500
4512
  }
4501
- var DateTimeFormat: {
4513
+
4514
+ interface DateTimeFormatConstructor {
4502
4515
  new (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
4503
4516
  (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;
4504
4517
  supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];
4505
4518
  readonly prototype: DateTimeFormat;
4506
- };
4519
+ }
4520
+
4521
+ var DateTimeFormat: DateTimeFormatConstructor;
4507
4522
  }
4508
4523
 
4509
4524
  interface String {
@@ -0,0 +1,29 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+ /// <reference no-default-lib="true"/>
18
+
19
+ interface MapConstructor {
20
+ /**
21
+ * Groups members of an iterable according to the return value of the passed callback.
22
+ * @param items An iterable.
23
+ * @param keySelector A callback which will be invoked for each item in items.
24
+ */
25
+ groupBy<K, T>(
26
+ items: Iterable<T>,
27
+ keySelector: (item: T, index: number) => K,
28
+ ): Map<K, T[]>;
29
+ }
@@ -20,3 +20,6 @@ and limitations under the License.
20
20
  /// <reference lib="esnext.intl" />
21
21
  /// <reference lib="esnext.decorators" />
22
22
  /// <reference lib="esnext.disposable" />
23
+ /// <reference lib="esnext.promise" />
24
+ /// <reference lib="esnext.object" />
25
+ /// <reference lib="esnext.collection" />
@@ -43,7 +43,7 @@ interface SuppressedError extends Error {
43
43
  suppressed: any;
44
44
  }
45
45
 
46
- interface SuppressedErrorConstructor extends ErrorConstructor {
46
+ interface SuppressedErrorConstructor {
47
47
  new (error: any, suppressed: any, message?: string): SuppressedError;
48
48
  (error: any, suppressed: any, message?: string): SuppressedError;
49
49
  readonly prototype: SuppressedError;
@@ -21,3 +21,4 @@ and limitations under the License.
21
21
  /// <reference lib="webworker.importscripts" />
22
22
  /// <reference lib="scripthost" />
23
23
  /// <reference lib="dom.iterable" />
24
+ /// <reference lib="dom.asynciterable" />
@@ -0,0 +1,29 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+ /// <reference no-default-lib="true"/>
18
+
19
+ interface ObjectConstructor {
20
+ /**
21
+ * Groups members of an iterable according to the return value of the passed callback.
22
+ * @param items An iterable.
23
+ * @param keySelector A callback which will be invoked for each item in items.
24
+ */
25
+ groupBy<K extends PropertyKey, T>(
26
+ items: Iterable<T>,
27
+ keySelector: (item: T, index: number) => K,
28
+ ): Partial<Record<K, T[]>>;
29
+ }
@@ -0,0 +1,35 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+ /// <reference no-default-lib="true"/>
18
+
19
+ interface PromiseWithResolvers<T> {
20
+ promise: Promise<T>;
21
+ resolve: (value: T | PromiseLike<T>) => void;
22
+ reject: (reason?: any) => void;
23
+ }
24
+
25
+ interface PromiseConstructor {
26
+ /**
27
+ * Creates a new Promise and returns it in an object, along with its resolve and reject functions.
28
+ * @returns An object with the properties `promise`, `resolve`, and `reject`.
29
+ *
30
+ * ```ts
31
+ * const { promise, resolve, reject } = Promise.withResolvers<T>();
32
+ * ```
33
+ */
34
+ withResolvers<T>(): PromiseWithResolvers<T>;
35
+ }
@@ -0,0 +1,28 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+ /// <reference no-default-lib="true"/>
18
+
19
+ /////////////////////////////
20
+ /// Worker Async Iterable APIs
21
+ /////////////////////////////
22
+
23
+ interface FileSystemDirectoryHandle {
24
+ [Symbol.asyncIterator](): AsyncIterableIterator<[string, FileSystemHandle]>;
25
+ entries(): AsyncIterableIterator<[string, FileSystemHandle]>;
26
+ keys(): AsyncIterableIterator<string>;
27
+ values(): AsyncIterableIterator<FileSystemHandle>;
28
+ }