@rindo/core 2.17.4 → 2.22.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 (108) hide show
  1. package/cli/config-flags.d.ts +33 -21
  2. package/cli/index.cjs +693 -401
  3. package/cli/index.d.ts +3 -0
  4. package/cli/index.js +693 -401
  5. package/cli/package.json +1 -1
  6. package/compiler/lib.dom.d.ts +898 -184
  7. package/compiler/lib.dom.iterable.d.ts +22 -4
  8. package/compiler/lib.es2015.collection.d.ts +62 -1
  9. package/compiler/lib.es2015.core.d.ts +3 -3
  10. package/compiler/lib.es2015.iterable.d.ts +2 -1
  11. package/compiler/lib.es2015.promise.d.ts +9 -4
  12. package/compiler/lib.es2015.proxy.d.ts +91 -2
  13. package/compiler/lib.es2015.reflect.d.ts +26 -3
  14. package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
  15. package/compiler/lib.es2017.intl.d.ts +16 -1
  16. package/compiler/lib.es2019.d.ts +1 -0
  17. package/compiler/lib.es2019.intl.d.ts +25 -0
  18. package/compiler/lib.es2020.bigint.d.ts +7 -5
  19. package/compiler/lib.es2020.d.ts +2 -0
  20. package/compiler/lib.es2020.date.d.ts +44 -0
  21. package/compiler/lib.es2020.intl.d.ts +81 -16
  22. package/compiler/lib.es2020.number.d.ts +30 -0
  23. package/compiler/lib.es2021.intl.d.ts +116 -6
  24. package/compiler/lib.es2022.array.d.ts +123 -0
  25. package/compiler/lib.es2022.d.ts +27 -0
  26. package/compiler/lib.es2022.error.d.ts +75 -0
  27. package/compiler/lib.es2022.full.d.ts +25 -0
  28. package/compiler/lib.es2022.intl.d.ts +111 -0
  29. package/compiler/lib.es2022.object.d.ts +28 -0
  30. package/compiler/lib.es2022.sharedmemory.d.ts +27 -0
  31. package/compiler/lib.es2022.string.d.ts +27 -0
  32. package/compiler/lib.es5.d.ts +62 -31
  33. package/compiler/lib.esnext.d.ts +1 -1
  34. package/compiler/lib.esnext.intl.d.ts +8 -1
  35. package/compiler/lib.webworker.d.ts +540 -81
  36. package/compiler/lib.webworker.iterable.d.ts +19 -4
  37. package/compiler/package.json +1 -1
  38. package/compiler/rindo.d.ts +3 -25
  39. package/compiler/rindo.js +54678 -52205
  40. package/compiler/rindo.min.js +2 -2
  41. package/compiler/sys/in-memory-fs.d.ts +218 -0
  42. package/compiler/transpile.d.ts +32 -0
  43. package/dependencies.json +12 -1
  44. package/dev-server/client/app-error.d.ts +1 -1
  45. package/dev-server/client/index.d.ts +2 -2
  46. package/dev-server/client/index.js +241 -241
  47. package/dev-server/client/package.json +1 -1
  48. package/dev-server/connector.html +3 -3
  49. package/dev-server/index.d.ts +1 -1
  50. package/dev-server/index.js +2 -2
  51. package/dev-server/open-in-editor-api.js +1 -1
  52. package/dev-server/package.json +1 -1
  53. package/dev-server/server-process.js +1192 -1158
  54. package/dev-server/ws.js +1 -1
  55. package/internal/app-data/package.json +1 -1
  56. package/internal/client/css-shim.js +2 -2
  57. package/internal/client/dom.js +1 -1
  58. package/internal/client/index.js +1130 -823
  59. package/internal/client/package.json +1 -1
  60. package/internal/client/patch-browser.js +19 -1
  61. package/internal/client/patch-esm.js +1 -1
  62. package/internal/client/polyfills/css-shim.js +1 -1
  63. package/internal/client/shadow-css.js +1 -1
  64. package/internal/hydrate/index.js +154 -143
  65. package/internal/hydrate/package.json +1 -1
  66. package/internal/hydrate/runner.d.ts +1 -1
  67. package/internal/hydrate/runner.js +106 -106
  68. package/internal/package.json +1 -1
  69. package/internal/rindo-core/index.d.ts +9 -10
  70. package/internal/rindo-private.d.ts +149 -184
  71. package/internal/rindo-public-compiler.d.ts +83 -38
  72. package/internal/rindo-public-docs.d.ts +24 -0
  73. package/internal/rindo-public-runtime.d.ts +79 -7
  74. package/internal/testing/index.js +187 -175
  75. package/internal/testing/package.json +1 -1
  76. package/mock-doc/index.cjs +526 -501
  77. package/mock-doc/index.d.ts +15 -14
  78. package/mock-doc/index.js +526 -501
  79. package/mock-doc/package.json +1 -1
  80. package/package.json +48 -59
  81. package/readme.md +44 -31
  82. package/screenshot/compare/build/p-f4745c2f.entry.js +1 -1
  83. package/screenshot/index.d.ts +1 -1
  84. package/screenshot/index.js +13 -13
  85. package/screenshot/package.json +1 -1
  86. package/screenshot/pixel-match.js +983 -849
  87. package/sys/node/autoprefixer.js +2 -2
  88. package/sys/node/glob.js +1 -1
  89. package/sys/node/index.d.ts +4 -0
  90. package/sys/node/index.js +399 -413
  91. package/sys/node/package.json +1 -1
  92. package/sys/node/prompts.js +1 -1
  93. package/sys/node/worker.js +1 -1
  94. package/testing/index.d.ts +6 -6
  95. package/testing/index.js +684 -839
  96. package/testing/jest/jest-config.d.ts +1 -1
  97. package/testing/jest/jest-preprocessor.d.ts +3 -3
  98. package/testing/jest/jest-serializer.d.ts +1 -2
  99. package/testing/matchers/index.d.ts +3 -3
  100. package/testing/mock-fetch.d.ts +1 -1
  101. package/testing/mocks.d.ts +2 -2
  102. package/testing/package.json +1 -1
  103. package/testing/puppeteer/puppeteer-declarations.d.ts +5 -5
  104. package/testing/puppeteer/puppeteer-element.d.ts +2 -2
  105. package/testing/puppeteer/puppeteer-events.d.ts +1 -1
  106. package/testing/testing-logger.d.ts +1 -1
  107. package/testing/testing-utils.d.ts +6 -5
  108. package/testing/testing.d.ts +1 -1
@@ -46,6 +46,10 @@ interface Cache {
46
46
  addAll(requests: Iterable<RequestInfo>): Promise<void>;
47
47
  }
48
48
 
49
+ interface CanvasPath {
50
+ roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | Iterable<number | DOMPointInit>): void;
51
+ }
52
+
49
53
  interface CanvasPathDrawingStyles {
50
54
  setLineDash(segments: Iterable<number>): void;
51
55
  }
@@ -69,6 +73,9 @@ interface DataTransferItemList {
69
73
  [Symbol.iterator](): IterableIterator<DataTransferItem>;
70
74
  }
71
75
 
76
+ interface EventCounts extends ReadonlyMap<string, number> {
77
+ }
78
+
72
79
  interface FileList {
73
80
  [Symbol.iterator](): IterableIterator<File>;
74
81
  }
@@ -118,7 +125,7 @@ interface Headers {
118
125
 
119
126
  interface IDBDatabase {
120
127
  /** 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. */
121
- transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
128
+ transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
122
129
  }
123
130
 
124
131
  interface IDBObjectStore {
@@ -188,6 +195,10 @@ interface PluginArray {
188
195
  [Symbol.iterator](): IterableIterator<Plugin>;
189
196
  }
190
197
 
198
+ interface RTCRtpTransceiver {
199
+ setCodecPreferences(codecs: Iterable<RTCRtpCodecCapability>): void;
200
+ }
201
+
191
202
  interface RTCStatsReport extends ReadonlyMap<string, any> {
192
203
  }
193
204
 
@@ -229,10 +240,10 @@ interface StyleSheetList {
229
240
 
230
241
  interface SubtleCrypto {
231
242
  deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
232
- generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
233
- generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
243
+ generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
244
+ generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
234
245
  generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKeyPair | CryptoKey>;
235
- importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
246
+ importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
236
247
  importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
237
248
  unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
238
249
  }
@@ -263,6 +274,13 @@ interface WEBGL_draw_buffers {
263
274
  drawBuffersWEBGL(buffers: Iterable<GLenum>): void;
264
275
  }
265
276
 
277
+ interface WEBGL_multi_draw {
278
+ multiDrawArraysInstancedWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, instanceCountsList: Int32Array | Iterable<GLsizei>, instanceCountsOffset: GLuint, drawcount: GLsizei): void;
279
+ multiDrawArraysWEBGL(mode: GLenum, firstsList: Int32Array | Iterable<GLint>, firstsOffset: GLuint, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, drawcount: GLsizei): void;
280
+ 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;
281
+ multiDrawElementsWEBGL(mode: GLenum, countsList: Int32Array | Iterable<GLsizei>, countsOffset: GLuint, type: GLenum, offsetsList: Int32Array | Iterable<GLsizei>, offsetsOffset: GLuint, drawcount: GLsizei): void;
282
+ }
283
+
266
284
  interface WebGL2RenderingContextBase {
267
285
  clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
268
286
  clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;
@@ -19,18 +19,38 @@ and limitations under the License.
19
19
 
20
20
 
21
21
  interface Map<K, V> {
22
+
22
23
  clear(): void;
24
+ /**
25
+ * @returns true if an element in the Map existed and has been removed, or false if the element does not exist.
26
+ */
23
27
  delete(key: K): boolean;
28
+ /**
29
+ * Executes a provided function once per each key/value pair in the Map, in insertion order.
30
+ */
24
31
  forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
32
+ /**
33
+ * 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.
34
+ * @returns Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
35
+ */
25
36
  get(key: K): V | undefined;
37
+ /**
38
+ * @returns boolean indicating whether an element with the specified key exists or not.
39
+ */
26
40
  has(key: K): boolean;
41
+ /**
42
+ * Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
43
+ */
27
44
  set(key: K, value: V): this;
45
+ /**
46
+ * @returns the number of elements in the Map.
47
+ */
28
48
  readonly size: number;
29
49
  }
30
50
 
31
51
  interface MapConstructor {
32
52
  new(): Map<any, any>;
33
- new<K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
53
+ new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
34
54
  readonly prototype: Map<any, any>;
35
55
  }
36
56
  declare var Map: MapConstructor;
@@ -43,9 +63,23 @@ interface ReadonlyMap<K, V> {
43
63
  }
44
64
 
45
65
  interface WeakMap<K extends object, V> {
66
+ /**
67
+ * Removes the specified element from the WeakMap.
68
+ * @returns true if the element was successfully removed, or false if it was not present.
69
+ */
46
70
  delete(key: K): boolean;
71
+ /**
72
+ * @returns a specified element.
73
+ */
47
74
  get(key: K): V | undefined;
75
+ /**
76
+ * @returns a boolean indicating whether an element with the specified key exists or not.
77
+ */
48
78
  has(key: K): boolean;
79
+ /**
80
+ * Adds a new element with a specified key and value.
81
+ * @param key Must be an object.
82
+ */
49
83
  set(key: K, value: V): this;
50
84
  }
51
85
 
@@ -56,11 +90,28 @@ interface WeakMapConstructor {
56
90
  declare var WeakMap: WeakMapConstructor;
57
91
 
58
92
  interface Set<T> {
93
+ /**
94
+ * Appends a new element with a specified value to the end of the Set.
95
+ */
59
96
  add(value: T): this;
97
+
60
98
  clear(): void;
99
+ /**
100
+ * Removes a specified value from the Set.
101
+ * @returns Returns true if an element in the Set existed and has been removed, or false if the element does not exist.
102
+ */
61
103
  delete(value: T): boolean;
104
+ /**
105
+ * Executes a provided function once per each value in the Set object, in insertion order.
106
+ */
62
107
  forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
108
+ /**
109
+ * @returns a boolean indicating whether an element with the specified value exists in the Set or not.
110
+ */
63
111
  has(value: T): boolean;
112
+ /**
113
+ * @returns the number of (unique) elements in Set.
114
+ */
64
115
  readonly size: number;
65
116
  }
66
117
 
@@ -77,8 +128,18 @@ interface ReadonlySet<T> {
77
128
  }
78
129
 
79
130
  interface WeakSet<T extends object> {
131
+ /**
132
+ * Appends a new object to the end of the WeakSet.
133
+ */
80
134
  add(value: T): this;
135
+ /**
136
+ * Removes the specified element from the WeakSet.
137
+ * @returns Returns true if the element existed and has been removed, or false if the element does not exist.
138
+ */
81
139
  delete(value: T): boolean;
140
+ /**
141
+ * @returns a boolean indicating whether an object exists in the WeakSet or not.
142
+ */
82
143
  has(value: T): boolean;
83
144
  }
84
145
 
@@ -283,7 +283,7 @@ interface ObjectConstructor {
283
283
  * @param target The target object to copy to.
284
284
  * @param source The source object from which to copy properties.
285
285
  */
286
- assign<T, U>(target: T, source: U): T & U;
286
+ assign<T extends {}, U>(target: T, source: U): T & U;
287
287
 
288
288
  /**
289
289
  * Copy the values of all of the enumerable own properties from one or more source objects to a
@@ -292,7 +292,7 @@ interface ObjectConstructor {
292
292
  * @param source1 The first source object from which to copy properties.
293
293
  * @param source2 The second source object from which to copy properties.
294
294
  */
295
- assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
295
+ assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
296
296
 
297
297
  /**
298
298
  * Copy the values of all of the enumerable own properties from one or more source objects to a
@@ -302,7 +302,7 @@ interface ObjectConstructor {
302
302
  * @param source2 The second source object from which to copy properties.
303
303
  * @param source3 The third source object from which to copy properties.
304
304
  */
305
- assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
305
+ assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
306
306
 
307
307
  /**
308
308
  * Copy the values of all of the enumerable own properties from one or more source objects to a
@@ -157,7 +157,8 @@ interface ReadonlyMap<K, V> {
157
157
  }
158
158
 
159
159
  interface MapConstructor {
160
- new <K, V>(iterable: Iterable<readonly [K, V]>): Map<K, V>;
160
+ new(): Map<any, any>;
161
+ new <K, V>(iterable?: Iterable<readonly [K, V]> | null): Map<K, V>;
161
162
  }
162
163
 
163
164
  interface WeakMap<K extends object, V> { }
@@ -41,7 +41,7 @@ interface PromiseConstructor {
41
41
  all<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]> }>;
42
42
 
43
43
  // see: lib.es2015.iterable.d.ts
44
- // all<T>(values: Iterable<T | PromiseLike<T>>): Promise<T[]>;
44
+ // all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
45
45
 
46
46
  /**
47
47
  * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
@@ -52,7 +52,7 @@ interface PromiseConstructor {
52
52
  race<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
53
53
 
54
54
  // see: lib.es2015.iterable.d.ts
55
- // race<T>(values: Iterable<T>): Promise<T extends PromiseLike<infer U> ? U : T>;
55
+ // race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
56
56
 
57
57
  /**
58
58
  * Creates a new rejected promise for the provided reason.
@@ -66,13 +66,18 @@ interface PromiseConstructor {
66
66
  * @returns A resolved promise.
67
67
  */
68
68
  resolve(): Promise<void>;
69
-
70
69
  /**
71
70
  * Creates a new resolved promise for the provided value.
72
71
  * @param value A promise.
73
72
  * @returns A promise whose internal state matches the provided promise.
74
73
  */
75
- resolve<T>(value: T | PromiseLike<T>): Promise<T>;
74
+ resolve<T>(value: T): Promise<Awaited<T>>;
75
+ /**
76
+ * Creates a new resolved promise for the provided value.
77
+ * @param value A promise.
78
+ * @returns A promise whose internal state matches the provided promise.
79
+ */
80
+ resolve<T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
76
81
  }
77
82
 
78
83
  declare var Promise: PromiseConstructor;
@@ -19,23 +19,112 @@ and limitations under the License.
19
19
 
20
20
 
21
21
  interface ProxyHandler<T extends object> {
22
+ /**
23
+ * A trap method for a function call.
24
+ * @param target The original callable object which is being proxied.
25
+ */
22
26
  apply?(target: T, thisArg: any, argArray: any[]): any;
27
+
28
+ /**
29
+ * A trap for the `new` operator.
30
+ * @param target The original object which is being proxied.
31
+ * @param newTarget The constructor that was originally called.
32
+ */
23
33
  construct?(target: T, argArray: any[], newTarget: Function): object;
24
- defineProperty?(target: T, p: string | symbol, attributes: PropertyDescriptor): boolean;
34
+
35
+ /**
36
+ * A trap for `Object.defineProperty()`.
37
+ * @param target The original object which is being proxied.
38
+ * @returns A `Boolean` indicating whether or not the property has been defined.
39
+ */
40
+ defineProperty?(target: T, property: string | symbol, attributes: PropertyDescriptor): boolean;
41
+
42
+ /**
43
+ * A trap for the `delete` operator.
44
+ * @param target The original object which is being proxied.
45
+ * @param p The name or `Symbol` of the property to delete.
46
+ * @returns A `Boolean` indicating whether or not the property was deleted.
47
+ */
25
48
  deleteProperty?(target: T, p: string | symbol): boolean;
49
+
50
+ /**
51
+ * A trap for getting a property value.
52
+ * @param target The original object which is being proxied.
53
+ * @param p The name or `Symbol` of the property to get.
54
+ * @param receiver The proxy or an object that inherits from the proxy.
55
+ */
26
56
  get?(target: T, p: string | symbol, receiver: any): any;
57
+
58
+ /**
59
+ * A trap for `Object.getOwnPropertyDescriptor()`.
60
+ * @param target The original object which is being proxied.
61
+ * @param p The name of the property whose description should be retrieved.
62
+ */
27
63
  getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined;
64
+
65
+ /**
66
+ * A trap for the `[[GetPrototypeOf]]` internal method.
67
+ * @param target The original object which is being proxied.
68
+ */
28
69
  getPrototypeOf?(target: T): object | null;
70
+
71
+ /**
72
+ * A trap for the `in` operator.
73
+ * @param target The original object which is being proxied.
74
+ * @param p The name or `Symbol` of the property to check for existence.
75
+ */
29
76
  has?(target: T, p: string | symbol): boolean;
77
+
78
+ /**
79
+ * A trap for `Object.isExtensible()`.
80
+ * @param target The original object which is being proxied.
81
+ */
30
82
  isExtensible?(target: T): boolean;
83
+
84
+ /**
85
+ * A trap for `Reflect.ownKeys()`.
86
+ * @param target The original object which is being proxied.
87
+ */
31
88
  ownKeys?(target: T): ArrayLike<string | symbol>;
89
+
90
+ /**
91
+ * A trap for `Object.preventExtensions()`.
92
+ * @param target The original object which is being proxied.
93
+ */
32
94
  preventExtensions?(target: T): boolean;
33
- set?(target: T, p: string | symbol, value: any, receiver: any): boolean;
95
+
96
+ /**
97
+ * A trap for setting a property value.
98
+ * @param target The original object which is being proxied.
99
+ * @param p The name or `Symbol` of the property to set.
100
+ * @param receiver The object to which the assignment was originally directed.
101
+ * @returns A `Boolean` indicating whether or not the property was set.
102
+ */
103
+ set?(target: T, p: string | symbol, newValue: any, receiver: any): boolean;
104
+
105
+ /**
106
+ * A trap for `Object.setPrototypeOf()`.
107
+ * @param target The original object which is being proxied.
108
+ * @param newPrototype The object's new prototype or `null`.
109
+ */
34
110
  setPrototypeOf?(target: T, v: object | null): boolean;
35
111
  }
36
112
 
37
113
  interface ProxyConstructor {
114
+ /**
115
+ * Creates a revocable Proxy object.
116
+ * @param target A target object to wrap with Proxy.
117
+ * @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
118
+ */
38
119
  revocable<T extends object>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
120
+
121
+ /**
122
+ * Creates a Proxy object. The Proxy object allows you to create an object that can be used in place of the
123
+ * original object, but which may redefine fundamental Object operations like getting, setting, and defining
124
+ * properties. Proxy objects are commonly used to log property accesses, validate, format, or sanitize inputs.
125
+ * @param target A target object to wrap with Proxy.
126
+ * @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
127
+ */
39
128
  new <T extends object>(target: T, handler: ProxyHandler<T>): T;
40
129
  }
41
130
  declare var Proxy: ProxyConstructor;
@@ -26,6 +26,11 @@ declare namespace Reflect {
26
26
  * @param thisArgument The object to be used as the this object.
27
27
  * @param argumentsList An array of argument values to be passed to the function.
28
28
  */
29
+ function apply<T, A extends readonly any[], R>(
30
+ target: (this: T, ...args: A) => R,
31
+ thisArgument: T,
32
+ argumentsList: Readonly<A>,
33
+ ): R;
29
34
  function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
30
35
 
31
36
  /**
@@ -35,6 +40,11 @@ declare namespace Reflect {
35
40
  * @param argumentsList An array of argument values to be passed to the constructor.
36
41
  * @param newTarget The constructor to be used as the `new.target` object.
37
42
  */
43
+ function construct<A extends readonly any[], R>(
44
+ target: new (...args: A) => R,
45
+ argumentsList: Readonly<A>,
46
+ newTarget?: new (...args: any) => any,
47
+ ): R;
38
48
  function construct(target: Function, argumentsList: ArrayLike<any>, newTarget?: Function): any;
39
49
 
40
50
  /**
@@ -44,7 +54,7 @@ declare namespace Reflect {
44
54
  * @param propertyKey The property name.
45
55
  * @param attributes Descriptor for the property. It can be for a data property or an accessor property.
46
56
  */
47
- function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
57
+ function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): boolean;
48
58
 
49
59
  /**
50
60
  * Removes a property from an object, equivalent to `delete target[propertyKey]`,
@@ -61,7 +71,11 @@ declare namespace Reflect {
61
71
  * @param receiver The reference to use as the `this` value in the getter function,
62
72
  * if `target[propertyKey]` is an accessor property.
63
73
  */
64
- function get(target: object, propertyKey: PropertyKey, receiver?: any): any;
74
+ function get<T extends object, P extends PropertyKey>(
75
+ target: T,
76
+ propertyKey: P,
77
+ receiver?: unknown,
78
+ ): P extends keyof T ? T[P] : any;
65
79
 
66
80
  /**
67
81
  * Gets the own property descriptor of the specified object.
@@ -69,7 +83,10 @@ declare namespace Reflect {
69
83
  * @param target Object that contains the property.
70
84
  * @param propertyKey The property name.
71
85
  */
72
- function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined;
86
+ function getOwnPropertyDescriptor<T extends object, P extends PropertyKey>(
87
+ target: T,
88
+ propertyKey: P,
89
+ ): TypedPropertyDescriptor<P extends keyof T ? T[P] : any> | undefined;
73
90
 
74
91
  /**
75
92
  * Returns the prototype of an object.
@@ -111,6 +128,12 @@ declare namespace Reflect {
111
128
  * @param receiver The reference to use as the `this` value in the setter function,
112
129
  * if `target[propertyKey]` is an accessor property.
113
130
  */
131
+ function set<T extends object, P extends PropertyKey>(
132
+ target: T,
133
+ propertyKey: P,
134
+ value: P extends keyof T ? T[P] : any,
135
+ receiver?: any,
136
+ ): boolean;
114
137
  function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
115
138
 
116
139
  /**
@@ -239,9 +239,9 @@ interface String {
239
239
  match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null;
240
240
 
241
241
  /**
242
- * Replaces first match with string or all matches with RegExp.
243
- * @param searchValue A string or RegExp search value.
244
- * @param replaceValue A string containing the text to replace for match.
242
+ * Passes a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. This method is expected to implement its own replacement algorithm.
243
+ * @param searchValue An object that supports searching for and replacing matches within a string.
244
+ * @param replaceValue The replacement text.
245
245
  */
246
246
  replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;
247
247
 
@@ -19,7 +19,22 @@ and limitations under the License.
19
19
 
20
20
 
21
21
  declare namespace Intl {
22
- type DateTimeFormatPartTypes = "day" | "dayPeriod" | "era" | "hour" | "literal" | "minute" | "month" | "second" | "timeZoneName" | "weekday" | "year";
22
+
23
+ interface DateTimeFormatPartTypesRegistry {
24
+ day: any
25
+ dayPeriod: any
26
+ era: any
27
+ hour: any
28
+ literal: any
29
+ minute: any
30
+ month: any
31
+ second: any
32
+ timeZoneName: any
33
+ weekday: any
34
+ year: any
35
+ }
36
+
37
+ type DateTimeFormatPartTypes = keyof DateTimeFormatPartTypesRegistry;
23
38
 
24
39
  interface DateTimeFormatPart {
25
40
  type: DateTimeFormatPartTypes;
@@ -23,3 +23,4 @@ and limitations under the License.
23
23
  /// <reference lib="es2019.object" />
24
24
  /// <reference lib="es2019.string" />
25
25
  /// <reference lib="es2019.symbol" />
26
+ /// <reference lib="es2019.intl" />
@@ -0,0 +1,25 @@
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
+
18
+ /// <reference no-default-lib="true"/>
19
+
20
+
21
+ declare namespace Intl {
22
+ interface DateTimeFormatPartTypesRegistry {
23
+ unknown: any
24
+ }
25
+ }
@@ -18,6 +18,8 @@ and limitations under the License.
18
18
  /// <reference no-default-lib="true"/>
19
19
 
20
20
 
21
+ /// <reference lib="es2020.intl" />
22
+
21
23
  interface BigIntToLocaleStringOptions {
22
24
  /**
23
25
  * The locale matching algorithm to use.The default is "best fit". For information about this option, see the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation Intl page}.
@@ -112,7 +114,7 @@ interface BigInt {
112
114
  toString(radix?: number): string;
113
115
 
114
116
  /** Returns a string representation appropriate to the host environment's current locale. */
115
- toLocaleString(locales?: string, options?: BigIntToLocaleStringOptions): string;
117
+ toLocaleString(locales?: Intl.LocalesArgument, options?: BigIntToLocaleStringOptions): string;
116
118
 
117
119
  /** Returns the primitive value of the specified object. */
118
120
  valueOf(): bigint;
@@ -691,6 +693,7 @@ interface DataView {
691
693
  * Gets the BigInt64 value at the specified byte offset from the start of the view. There is
692
694
  * no alignment constraint; multi-byte values may be fetched from any offset.
693
695
  * @param byteOffset The place in the buffer at which the value should be retrieved.
696
+ * @param littleEndian If false or undefined, a big-endian value should be read.
694
697
  */
695
698
  getBigInt64(byteOffset: number, littleEndian?: boolean): bigint;
696
699
 
@@ -698,6 +701,7 @@ interface DataView {
698
701
  * Gets the BigUint64 value at the specified byte offset from the start of the view. There is
699
702
  * no alignment constraint; multi-byte values may be fetched from any offset.
700
703
  * @param byteOffset The place in the buffer at which the value should be retrieved.
704
+ * @param littleEndian If false or undefined, a big-endian value should be read.
701
705
  */
702
706
  getBigUint64(byteOffset: number, littleEndian?: boolean): bigint;
703
707
 
@@ -705,8 +709,7 @@ interface DataView {
705
709
  * Stores a BigInt64 value at the specified byte offset from the start of the view.
706
710
  * @param byteOffset The place in the buffer at which the value should be set.
707
711
  * @param value The value to set.
708
- * @param littleEndian If false or undefined, a big-endian value should be written,
709
- * otherwise a little-endian value should be written.
712
+ * @param littleEndian If false or undefined, a big-endian value should be written.
710
713
  */
711
714
  setBigInt64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
712
715
 
@@ -714,8 +717,7 @@ interface DataView {
714
717
  * Stores a BigUint64 value at the specified byte offset from the start of the view.
715
718
  * @param byteOffset The place in the buffer at which the value should be set.
716
719
  * @param value The value to set.
717
- * @param littleEndian If false or undefined, a big-endian value should be written,
718
- * otherwise a little-endian value should be written.
720
+ * @param littleEndian If false or undefined, a big-endian value should be written.
719
721
  */
720
722
  setBigUint64(byteOffset: number, value: bigint, littleEndian?: boolean): void;
721
723
  }
@@ -20,6 +20,8 @@ and limitations under the License.
20
20
 
21
21
  /// <reference lib="es2019" />
22
22
  /// <reference lib="es2020.bigint" />
23
+ /// <reference lib="es2020.date" />
24
+ /// <reference lib="es2020.number" />
23
25
  /// <reference lib="es2020.promise" />
24
26
  /// <reference lib="es2020.sharedmemory" />
25
27
  /// <reference lib="es2020.string" />
@@ -0,0 +1,44 @@
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
+
18
+ /// <reference no-default-lib="true"/>
19
+
20
+
21
+ /// <reference lib="es2020.intl" />
22
+
23
+ interface Date {
24
+ /**
25
+ * Converts a date and time to a string by using the current or specified locale.
26
+ * @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects 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.
27
+ * @param options An object that contains one or more properties that specify comparison options.
28
+ */
29
+ toLocaleString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
30
+
31
+ /**
32
+ * Converts a date to a string by using the current or specified locale.
33
+ * @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects 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.
34
+ * @param options An object that contains one or more properties that specify comparison options.
35
+ */
36
+ toLocaleDateString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
37
+
38
+ /**
39
+ * Converts a time to a string by using the current or specified locale.
40
+ * @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects 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.
41
+ * @param options An object that contains one or more properties that specify comparison options.
42
+ */
43
+ toLocaleTimeString(locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions): string;
44
+ }