@unotest/web 0.49.2 → 0.51.0

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.
@@ -0,0 +1,1289 @@
1
+ // GENERATED by scripts/build-dsl-types.ts from TypeScript's es2022 lib,
2
+ // cut down to the scenario library (libraryCatalog) — do not edit.
3
+ // The jsconfig sets noLib: these are the editor's only globals.
4
+
5
+ interface Boolean {}
6
+ interface Function {}
7
+ interface IArguments {}
8
+ interface Object {}
9
+ interface CallableFunction {}
10
+ interface NewableFunction {}
11
+
12
+ interface String {
13
+ /**
14
+ * Returns the character at the specified index.
15
+ * @param pos The zero-based index of the desired character.
16
+ */
17
+ charAt(pos: number): string;
18
+ /**
19
+ * Returns the position of the first occurrence of a substring.
20
+ * @param searchString The substring to search for in the string
21
+ * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.
22
+ */
23
+ indexOf(searchString: string, position?: number): number;
24
+ /**
25
+ * Returns the last occurrence of a substring in the string.
26
+ * @param searchString The substring to search for.
27
+ * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.
28
+ */
29
+ lastIndexOf(searchString: string, position?: number): number;
30
+ /**
31
+ * Determines whether two strings are equivalent in the current locale.
32
+ * @param that String to compare to target string
33
+ */
34
+ localeCompare(that: string): number;
35
+ /**
36
+ * Matches a string with a regular expression, and returns an array containing the results of that search.
37
+ * @param regexp A variable name or string literal containing the regular expression pattern and flags.
38
+ */
39
+ match(regexp: string | RegExp): RegExpMatchArray | null;
40
+ /**
41
+ * Replaces text in a string, using a regular expression or search string.
42
+ * @param searchValue A string or regular expression to search for.
43
+ * @param replaceValue A string containing the text to replace. When the {@linkcode searchValue} is a `RegExp`, all matches are replaced if the `g` flag is set (or only those matches at the beginning, if the `y` flag is also present). Otherwise, only the first match of {@linkcode searchValue} is replaced.
44
+ */
45
+ replace(searchValue: string | RegExp, replaceValue: string): string;
46
+ /**
47
+ * Replaces text in a string, using a regular expression or search string.
48
+ * @param searchValue A string to search for.
49
+ * @param replacer A function that returns the replacement text.
50
+ */
51
+ replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
52
+ /**
53
+ * Finds the first substring match in a regular expression search.
54
+ * @param regexp The regular expression pattern and applicable flags.
55
+ */
56
+ search(regexp: string | RegExp): number;
57
+ /**
58
+ * Returns a section of a string.
59
+ * @param start The index to the beginning of the specified portion of stringObj.
60
+ * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.
61
+ * If this value is not specified, the substring continues to the end of stringObj.
62
+ */
63
+ slice(start?: number, end?: number): string;
64
+ /**
65
+ * Split a string into substrings using the specified separator and return them as an array.
66
+ * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.
67
+ * @param limit A value used to limit the number of elements returned in the array.
68
+ */
69
+ split(separator: string | RegExp, limit?: number): string[];
70
+ /**
71
+ * Returns the substring at the specified location within a String object.
72
+ * @param start The zero-based index number indicating the beginning of the substring.
73
+ * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.
74
+ * If end is omitted, the characters from start through the end of the original string are returned.
75
+ */
76
+ substring(start: number, end?: number): string;
77
+ /** Converts all the alphabetic characters in a string to lowercase. */
78
+ toLowerCase(): string;
79
+ /** Converts all the alphabetic characters in a string to uppercase. */
80
+ toUpperCase(): string;
81
+ /** Removes the leading and trailing white space and line terminator characters from a string. */
82
+ trim(): string;
83
+ /** Returns the length of a String object. */
84
+ readonly length: number;
85
+ readonly [index: number]: string;
86
+ /**
87
+ * Returns true if searchString appears as a substring of the result of converting this
88
+ * object to a String, at one or more positions that are
89
+ * greater than or equal to position; otherwise, returns false.
90
+ * @param searchString search string
91
+ * @param position If position is undefined, 0 is assumed, so as to search all of the String.
92
+ */
93
+ includes(searchString: string, position?: number): boolean;
94
+ /**
95
+ * Returns true if the sequence of elements of searchString converted to a String is the
96
+ * same as the corresponding elements of this object (converted to a String) starting at
97
+ * endPosition – length(this). Otherwise returns false.
98
+ */
99
+ endsWith(searchString: string, endPosition?: number): boolean;
100
+ /**
101
+ * Returns the String value result of normalizing the string into the normalization form
102
+ * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.
103
+ * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default
104
+ * is "NFC"
105
+ */
106
+ normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string;
107
+ /**
108
+ * Returns the String value result of normalizing the string into the normalization form
109
+ * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.
110
+ * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default
111
+ * is "NFC"
112
+ */
113
+ normalize(form?: string): string;
114
+ /**
115
+ * Returns a String value that is made from count copies appended together. If count is 0,
116
+ * the empty string is returned.
117
+ * @param count number of copies to append
118
+ */
119
+ repeat(count: number): string;
120
+ /**
121
+ * Returns true if the sequence of elements of searchString converted to a String is the
122
+ * same as the corresponding elements of this object (converted to a String) starting at
123
+ * position. Otherwise returns false.
124
+ */
125
+ startsWith(searchString: string, position?: number): boolean;
126
+ /** Iterator */
127
+ [Symbol.iterator](): StringIterator<string>;
128
+ /**
129
+ * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
130
+ * The padding is applied from the start (left) of the current string.
131
+ *
132
+ * @param maxLength The length of the resulting string once the current string has been padded.
133
+ * If this parameter is smaller than the current string's length, the current string will be returned as it is.
134
+ *
135
+ * @param fillString The string to pad the current string with.
136
+ * If this string is too long, it will be truncated and the left-most part will be applied.
137
+ * The default value for this parameter is " " (U+0020).
138
+ */
139
+ padStart(maxLength: number, fillString?: string): string;
140
+ /**
141
+ * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
142
+ * The padding is applied from the end (right) of the current string.
143
+ *
144
+ * @param maxLength The length of the resulting string once the current string has been padded.
145
+ * If this parameter is smaller than the current string's length, the current string will be returned as it is.
146
+ *
147
+ * @param fillString The string to pad the current string with.
148
+ * If this string is too long, it will be truncated and the left-most part will be applied.
149
+ * The default value for this parameter is " " (U+0020).
150
+ */
151
+ padEnd(maxLength: number, fillString?: string): string;
152
+ /** Removes the trailing white space and line terminator characters from a string. */
153
+ trimEnd(): string;
154
+ /** Removes the leading white space and line terminator characters from a string. */
155
+ trimStart(): string;
156
+ /**
157
+ * Replace all instances of a substring in a string, using a regular expression or search string.
158
+ * @param searchValue A string to search for.
159
+ * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
160
+ */
161
+ replaceAll(searchValue: string | RegExp, replaceValue: string): string;
162
+ /**
163
+ * Replace all instances of a substring in a string, using a regular expression or search string.
164
+ * @param searchValue A string to search for.
165
+ * @param replacer A function that returns the replacement text.
166
+ */
167
+ replaceAll(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
168
+ /**
169
+ * Returns a new String consisting of the single UTF-16 code unit located at the specified index.
170
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
171
+ */
172
+ at(index: number): string | undefined;
173
+ }
174
+
175
+ interface Number {
176
+ /**
177
+ * Returns a string representation of an object.
178
+ * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.
179
+ */
180
+ toString(radix?: number): string;
181
+ /**
182
+ * Returns a string representing a number in fixed-point notation.
183
+ * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
184
+ */
185
+ toFixed(fractionDigits?: number): string;
186
+ /**
187
+ * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.
188
+ * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
189
+ */
190
+ toPrecision(precision?: number): string;
191
+ }
192
+
193
+ interface RegExp {
194
+ /**
195
+ * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.
196
+ * @param string String on which to perform the search.
197
+ */
198
+ test(string: string): boolean;
199
+ /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */
200
+ readonly source: string;
201
+ /**
202
+ * Returns a string indicating the flags of the regular expression in question. This field is read-only.
203
+ * The characters in this string are sequenced and concatenated in the following order:
204
+ *
205
+ * - "g" for global
206
+ * - "i" for ignoreCase
207
+ * - "m" for multiline
208
+ * - "u" for unicode
209
+ * - "y" for sticky
210
+ *
211
+ * If no flags are set, the value is the empty string.
212
+ */
213
+ readonly flags: string;
214
+ }
215
+
216
+ interface Array<T> {
217
+ /**
218
+ * Gets or sets the length of the array. This is a number one higher than the highest index in the array.
219
+ */
220
+ length: number;
221
+ /**
222
+ * Removes the last element from an array and returns it.
223
+ * If the array is empty, undefined is returned and the array is not modified.
224
+ */
225
+ pop(): T | undefined;
226
+ /**
227
+ * Appends new elements to the end of an array, and returns the new length of the array.
228
+ * @param items New elements to add to the array.
229
+ */
230
+ push(...items: T[]): number;
231
+ /**
232
+ * Combines two or more arrays.
233
+ * This method returns a new array without modifying any existing arrays.
234
+ * @param items Additional arrays and/or items to add to the end of the array.
235
+ */
236
+ concat(...items: ConcatArray<T>[]): T[];
237
+ /**
238
+ * Combines two or more arrays.
239
+ * This method returns a new array without modifying any existing arrays.
240
+ * @param items Additional arrays and/or items to add to the end of the array.
241
+ */
242
+ concat(...items: (T | ConcatArray<T>)[]): T[];
243
+ /**
244
+ * Adds all the elements of an array into a string, separated by the specified separator string.
245
+ * @param separator A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma.
246
+ */
247
+ join(separator?: string): string;
248
+ /**
249
+ * Reverses the elements in an array in place.
250
+ * This method mutates the array and returns a reference to the same array.
251
+ */
252
+ reverse(): T[];
253
+ /**
254
+ * Removes the first element from an array and returns it.
255
+ * If the array is empty, undefined is returned and the array is not modified.
256
+ */
257
+ shift(): T | undefined;
258
+ /**
259
+ * Returns a copy of a section of an array.
260
+ * For both start and end, a negative index can be used to indicate an offset from the end of the array.
261
+ * For example, -2 refers to the second to last element of the array.
262
+ * @param start The beginning index of the specified portion of the array.
263
+ * If start is undefined, then the slice begins at index 0.
264
+ * @param end The end index of the specified portion of the array. This is exclusive of the element at the index 'end'.
265
+ * If end is undefined, then the slice extends to the end of the array.
266
+ */
267
+ slice(start?: number, end?: number): T[];
268
+ /**
269
+ * Sorts an array in place.
270
+ * This method mutates the array and returns a reference to the same array.
271
+ * @param compareFn Function used to determine the order of the elements. It is expected to return
272
+ * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
273
+ * value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order.
274
+ * ```ts
275
+ * [11,2,22,1].sort((a, b) => a - b)
276
+ * ```
277
+ */
278
+ sort(compareFn?: (a: T, b: T) => number): this;
279
+ /**
280
+ * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
281
+ * @param start The zero-based location in the array from which to start removing elements.
282
+ * @param deleteCount The number of elements to remove. Omitting this argument will remove all elements from the start
283
+ * paramater location to end of the array. If value of this argument is either a negative number, zero, undefined, or a type
284
+ * that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements.
285
+ * @returns An array containing the elements that were deleted.
286
+ */
287
+ splice(start: number, deleteCount?: number): T[];
288
+ /**
289
+ * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
290
+ * @param start The zero-based location in the array from which to start removing elements.
291
+ * @param deleteCount The number of elements to remove. If value of this argument is either a negative number, zero,
292
+ * undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and
293
+ * not remove any elements.
294
+ * @param items Elements to insert into the array in place of the deleted elements.
295
+ * @returns An array containing the elements that were deleted.
296
+ */
297
+ splice(start: number, deleteCount: number, ...items: T[]): T[];
298
+ /**
299
+ * Inserts new elements at the start of an array, and returns the new length of the array.
300
+ * @param items Elements to insert at the start of the array.
301
+ */
302
+ unshift(...items: T[]): number;
303
+ /**
304
+ * Returns the index of the first occurrence of a value in an array, or -1 if it is not present.
305
+ * @param searchElement The value to locate in the array.
306
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
307
+ */
308
+ indexOf(searchElement: T, fromIndex?: number): number;
309
+ /**
310
+ * Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present.
311
+ * @param searchElement The value to locate in the array.
312
+ * @param fromIndex The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array.
313
+ */
314
+ lastIndexOf(searchElement: T, fromIndex?: number): number;
315
+ /**
316
+ * Determines whether all the members of an array satisfy the specified test.
317
+ * @param predicate A function that accepts up to three arguments. The every method calls
318
+ * the predicate function for each element in the array until the predicate returns a value
319
+ * which is coercible to the Boolean value false, or until the end of the array.
320
+ * @param thisArg An object to which the this keyword can refer in the predicate function.
321
+ * If thisArg is omitted, undefined is used as the this value.
322
+ */
323
+ every<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];
324
+ /**
325
+ * Determines whether all the members of an array satisfy the specified test.
326
+ * @param predicate A function that accepts up to three arguments. The every method calls
327
+ * the predicate function for each element in the array until the predicate returns a value
328
+ * which is coercible to the Boolean value false, or until the end of the array.
329
+ * @param thisArg An object to which the this keyword can refer in the predicate function.
330
+ * If thisArg is omitted, undefined is used as the this value.
331
+ */
332
+ every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
333
+ /**
334
+ * Determines whether the specified callback function returns true for any element of an array.
335
+ * @param predicate A function that accepts up to three arguments. The some method calls
336
+ * the predicate function for each element in the array until the predicate returns a value
337
+ * which is coercible to the Boolean value true, or until the end of the array.
338
+ * @param thisArg An object to which the this keyword can refer in the predicate function.
339
+ * If thisArg is omitted, undefined is used as the this value.
340
+ */
341
+ some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;
342
+ /**
343
+ * Performs the specified action for each element in an array.
344
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
345
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
346
+ */
347
+ forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;
348
+ /**
349
+ * Calls a defined callback function on each element of an array, and returns an array that contains the results.
350
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
351
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
352
+ */
353
+ map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];
354
+ /**
355
+ * Returns the elements of an array that meet the condition specified in a callback function.
356
+ * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
357
+ * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
358
+ */
359
+ filter<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];
360
+ /**
361
+ * Returns the elements of an array that meet the condition specified in a callback function.
362
+ * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
363
+ * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
364
+ */
365
+ filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];
366
+ /**
367
+ * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
368
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
369
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
370
+ */
371
+ reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
372
+ reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
373
+ /**
374
+ * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
375
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
376
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
377
+ */
378
+ reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
379
+ /**
380
+ * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
381
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
382
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
383
+ */
384
+ reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
385
+ reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
386
+ /**
387
+ * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
388
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
389
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
390
+ */
391
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
392
+ [n: number]: T;
393
+ /**
394
+ * Returns the value of the first element in the array where predicate is true, and undefined
395
+ * otherwise.
396
+ * @param predicate find calls predicate once for each element of the array, in ascending
397
+ * order, until it finds one where predicate returns true. If such an element is found, find
398
+ * immediately returns that element value. Otherwise, find returns undefined.
399
+ * @param thisArg If provided, it will be used as the this value for each invocation of
400
+ * predicate. If it is not provided, undefined is used instead.
401
+ */
402
+ find<S extends T>(predicate: (value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;
403
+ find(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined;
404
+ /**
405
+ * Returns the index of the first element in the array where predicate is true, and -1
406
+ * otherwise.
407
+ * @param predicate find calls predicate once for each element of the array, in ascending
408
+ * order, until it finds one where predicate returns true. If such an element is found,
409
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
410
+ * @param thisArg If provided, it will be used as the this value for each invocation of
411
+ * predicate. If it is not provided, undefined is used instead.
412
+ */
413
+ findIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;
414
+ /**
415
+ * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array
416
+ * @param value value to fill array section with
417
+ * @param start index to start filling the array at. If start is negative, it is treated as
418
+ * length+start where length is the length of the array.
419
+ * @param end index to stop filling the array at. If end is negative, it is treated as
420
+ * length+end.
421
+ */
422
+ fill(value: T, start?: number, end?: number): this;
423
+ /** Iterator */
424
+ [Symbol.iterator](): ArrayIterator<T>;
425
+ /**
426
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
427
+ * @param searchElement The element to search for.
428
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
429
+ */
430
+ includes(searchElement: T, fromIndex?: number): boolean;
431
+ /**
432
+ * Calls a defined callback function on each element of an array. Then, flattens the result into
433
+ * a new array.
434
+ * This is identical to a map followed by flat with depth 1.
435
+ *
436
+ * @param callback A function that accepts up to three arguments. The flatMap method calls the
437
+ * callback function one time for each element in the array.
438
+ * @param thisArg An object to which the this keyword can refer in the callback function. If
439
+ * thisArg is omitted, undefined is used as the this value.
440
+ */
441
+ flatMap<U, This = undefined>(
442
+ callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray<U>,
443
+ thisArg?: This,
444
+ ): U[];
445
+ /**
446
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
447
+ * specified depth.
448
+ *
449
+ * @param depth The maximum recursion depth
450
+ */
451
+ flat<A, D extends number = 1>(
452
+ this: A,
453
+ depth?: D,
454
+ ): FlatArray<A, D>[];
455
+ /**
456
+ * Returns the item located at the specified index.
457
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
458
+ */
459
+ at(index: number): T | undefined;
460
+ }
461
+
462
+ interface ReadonlyArray<T> {
463
+ /**
464
+ * Gets the length of the array. This is a number one higher than the highest element defined in an array.
465
+ */
466
+ readonly length: number;
467
+ /**
468
+ * Combines two or more arrays.
469
+ * @param items Additional items to add to the end of array1.
470
+ */
471
+ concat(...items: ConcatArray<T>[]): T[];
472
+ /**
473
+ * Combines two or more arrays.
474
+ * @param items Additional items to add to the end of array1.
475
+ */
476
+ concat(...items: (T | ConcatArray<T>)[]): T[];
477
+ /**
478
+ * Adds all the elements of an array separated by the specified separator string.
479
+ * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
480
+ */
481
+ join(separator?: string): string;
482
+ /**
483
+ * Returns a section of an array.
484
+ * @param start The beginning of the specified portion of the array.
485
+ * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'.
486
+ */
487
+ slice(start?: number, end?: number): T[];
488
+ /**
489
+ * Returns the index of the first occurrence of a value in an array.
490
+ * @param searchElement The value to locate in the array.
491
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
492
+ */
493
+ indexOf(searchElement: T, fromIndex?: number): number;
494
+ /**
495
+ * Returns the index of the last occurrence of a specified value in an array.
496
+ * @param searchElement The value to locate in the array.
497
+ * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.
498
+ */
499
+ lastIndexOf(searchElement: T, fromIndex?: number): number;
500
+ /**
501
+ * Determines whether all the members of an array satisfy the specified test.
502
+ * @param predicate A function that accepts up to three arguments. The every method calls
503
+ * the predicate function for each element in the array until the predicate returns a value
504
+ * which is coercible to the Boolean value false, or until the end of the array.
505
+ * @param thisArg An object to which the this keyword can refer in the predicate function.
506
+ * If thisArg is omitted, undefined is used as the this value.
507
+ */
508
+ every<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): this is readonly S[];
509
+ /**
510
+ * Determines whether all the members of an array satisfy the specified test.
511
+ * @param predicate A function that accepts up to three arguments. The every method calls
512
+ * the predicate function for each element in the array until the predicate returns a value
513
+ * which is coercible to the Boolean value false, or until the end of the array.
514
+ * @param thisArg An object to which the this keyword can refer in the predicate function.
515
+ * If thisArg is omitted, undefined is used as the this value.
516
+ */
517
+ every(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;
518
+ /**
519
+ * Determines whether the specified callback function returns true for any element of an array.
520
+ * @param predicate A function that accepts up to three arguments. The some method calls
521
+ * the predicate function for each element in the array until the predicate returns a value
522
+ * which is coercible to the Boolean value true, or until the end of the array.
523
+ * @param thisArg An object to which the this keyword can refer in the predicate function.
524
+ * If thisArg is omitted, undefined is used as the this value.
525
+ */
526
+ some(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;
527
+ /**
528
+ * Performs the specified action for each element in an array.
529
+ * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
530
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
531
+ */
532
+ forEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void;
533
+ /**
534
+ * Calls a defined callback function on each element of an array, and returns an array that contains the results.
535
+ * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
536
+ * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
537
+ */
538
+ map<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[];
539
+ /**
540
+ * Returns the elements of an array that meet the condition specified in a callback function.
541
+ * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
542
+ * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
543
+ */
544
+ filter<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S[];
545
+ /**
546
+ * Returns the elements of an array that meet the condition specified in a callback function.
547
+ * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
548
+ * @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.
549
+ */
550
+ filter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[];
551
+ /**
552
+ * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
553
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
554
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
555
+ */
556
+ reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;
557
+ reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;
558
+ /**
559
+ * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
560
+ * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
561
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
562
+ */
563
+ reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;
564
+ /**
565
+ * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
566
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
567
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
568
+ */
569
+ reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;
570
+ reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;
571
+ /**
572
+ * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
573
+ * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
574
+ * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
575
+ */
576
+ reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;
577
+ readonly [n: number]: T;
578
+ /**
579
+ * Returns the value of the first element in the array where predicate is true, and undefined
580
+ * otherwise.
581
+ * @param predicate find calls predicate once for each element of the array, in ascending
582
+ * order, until it finds one where predicate returns true. If such an element is found, find
583
+ * immediately returns that element value. Otherwise, find returns undefined.
584
+ * @param thisArg If provided, it will be used as the this value for each invocation of
585
+ * predicate. If it is not provided, undefined is used instead.
586
+ */
587
+ find<S extends T>(predicate: (value: T, index: number, obj: readonly T[]) => value is S, thisArg?: any): S | undefined;
588
+ find(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): T | undefined;
589
+ /**
590
+ * Returns the index of the first element in the array where predicate is true, and -1
591
+ * otherwise.
592
+ * @param predicate find calls predicate once for each element of the array, in ascending
593
+ * order, until it finds one where predicate returns true. If such an element is found,
594
+ * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
595
+ * @param thisArg If provided, it will be used as the this value for each invocation of
596
+ * predicate. If it is not provided, undefined is used instead.
597
+ */
598
+ findIndex(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): number;
599
+ /** Iterator of values in the array. */
600
+ [Symbol.iterator](): ArrayIterator<T>;
601
+ /**
602
+ * Determines whether an array includes a certain element, returning true or false as appropriate.
603
+ * @param searchElement The element to search for.
604
+ * @param fromIndex The position in this array at which to begin searching for searchElement.
605
+ */
606
+ includes(searchElement: T, fromIndex?: number): boolean;
607
+ /**
608
+ * Calls a defined callback function on each element of an array. Then, flattens the result into
609
+ * a new array.
610
+ * This is identical to a map followed by flat with depth 1.
611
+ *
612
+ * @param callback A function that accepts up to three arguments. The flatMap method calls the
613
+ * callback function one time for each element in the array.
614
+ * @param thisArg An object to which the this keyword can refer in the callback function. If
615
+ * thisArg is omitted, undefined is used as the this value.
616
+ */
617
+ flatMap<U, This = undefined>(
618
+ callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray<U>,
619
+ thisArg?: This,
620
+ ): U[];
621
+ /**
622
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
623
+ * specified depth.
624
+ *
625
+ * @param depth The maximum recursion depth
626
+ */
627
+ flat<A, D extends number = 1>(
628
+ this: A,
629
+ depth?: D,
630
+ ): FlatArray<A, D>[];
631
+ /**
632
+ * Returns the item located at the specified index.
633
+ * @param index The zero-based index of the desired code unit. A negative index will count back from the last item.
634
+ */
635
+ at(index: number): T | undefined;
636
+ }
637
+
638
+ interface Map<K, V> {
639
+ clear(): void;
640
+ /**
641
+ * @returns true if an element in the Map existed and has been removed, or false if the element does not exist.
642
+ */
643
+ delete(key: K): boolean;
644
+ /**
645
+ * Executes a provided function once per each key/value pair in the Map, in insertion order.
646
+ */
647
+ forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
648
+ /**
649
+ * 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.
650
+ * @returns Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
651
+ */
652
+ get(key: K): V | undefined;
653
+ /**
654
+ * @returns boolean indicating whether an element with the specified key exists or not.
655
+ */
656
+ has(key: K): boolean;
657
+ /**
658
+ * 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.
659
+ */
660
+ set(key: K, value: V): this;
661
+ /**
662
+ * @returns the number of elements in the Map.
663
+ */
664
+ readonly size: number;
665
+ /** Returns an iterable of entries in the map. */
666
+ [Symbol.iterator](): MapIterator<[K, V]>;
667
+ }
668
+
669
+ interface Set<T> {
670
+ /**
671
+ * Appends a new element with a specified value to the end of the Set.
672
+ */
673
+ add(value: T): this;
674
+ clear(): void;
675
+ /**
676
+ * Removes a specified value from the Set.
677
+ * @returns Returns true if an element in the Set existed and has been removed, or false if the element does not exist.
678
+ */
679
+ delete(value: T): boolean;
680
+ /**
681
+ * Executes a provided function once per each value in the Set object, in insertion order.
682
+ */
683
+ forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
684
+ /**
685
+ * @returns a boolean indicating whether an element with the specified value exists in the Set or not.
686
+ */
687
+ has(value: T): boolean;
688
+ /**
689
+ * @returns the number of (unique) elements in Set.
690
+ */
691
+ readonly size: number;
692
+ /** Iterates over values in the set. */
693
+ [Symbol.iterator](): SetIterator<T>;
694
+ }
695
+
696
+ interface Math {
697
+ /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */
698
+ readonly E: number;
699
+ /** The natural logarithm of 10. */
700
+ readonly LN10: number;
701
+ /** The natural logarithm of 2. */
702
+ readonly LN2: number;
703
+ /** The base-2 logarithm of e. */
704
+ readonly LOG2E: number;
705
+ /** The base-10 logarithm of e. */
706
+ readonly LOG10E: number;
707
+ /** Pi. This is the ratio of the circumference of a circle to its diameter. */
708
+ readonly PI: number;
709
+ /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */
710
+ readonly SQRT1_2: number;
711
+ /** The square root of 2. */
712
+ readonly SQRT2: number;
713
+ /**
714
+ * Returns the absolute value of a number (the value without regard to whether it is positive or negative).
715
+ * For example, the absolute value of -5 is the same as the absolute value of 5.
716
+ * @param x A numeric expression for which the absolute value is needed.
717
+ */
718
+ abs(x: number): number;
719
+ /**
720
+ * Returns the arc cosine (or inverse cosine) of a number.
721
+ * @param x A numeric expression.
722
+ */
723
+ acos(x: number): number;
724
+ /**
725
+ * Returns the arcsine of a number.
726
+ * @param x A numeric expression.
727
+ */
728
+ asin(x: number): number;
729
+ /**
730
+ * Returns the arctangent of a number.
731
+ * @param x A numeric expression for which the arctangent is needed.
732
+ */
733
+ atan(x: number): number;
734
+ /**
735
+ * Returns the angle (in radians) between the X axis and the line going through both the origin and the given point.
736
+ * @param y A numeric expression representing the cartesian y-coordinate.
737
+ * @param x A numeric expression representing the cartesian x-coordinate.
738
+ */
739
+ atan2(y: number, x: number): number;
740
+ /**
741
+ * Returns the smallest integer greater than or equal to its numeric argument.
742
+ * @param x A numeric expression.
743
+ */
744
+ ceil(x: number): number;
745
+ /**
746
+ * Returns the cosine of a number.
747
+ * @param x A numeric expression that contains an angle measured in radians.
748
+ */
749
+ cos(x: number): number;
750
+ /**
751
+ * Returns e (the base of natural logarithms) raised to a power.
752
+ * @param x A numeric expression representing the power of e.
753
+ */
754
+ exp(x: number): number;
755
+ /**
756
+ * Returns the greatest integer less than or equal to its numeric argument.
757
+ * @param x A numeric expression.
758
+ */
759
+ floor(x: number): number;
760
+ /**
761
+ * Returns the natural logarithm (base e) of a number.
762
+ * @param x A numeric expression.
763
+ */
764
+ log(x: number): number;
765
+ /**
766
+ * Returns the larger of a set of supplied numeric expressions.
767
+ * @param values Numeric expressions to be evaluated.
768
+ */
769
+ max(...values: number[]): number;
770
+ /**
771
+ * Returns the smaller of a set of supplied numeric expressions.
772
+ * @param values Numeric expressions to be evaluated.
773
+ */
774
+ min(...values: number[]): number;
775
+ /**
776
+ * Returns the value of a base expression taken to a specified power.
777
+ * @param x The base value of the expression.
778
+ * @param y The exponent value of the expression.
779
+ */
780
+ pow(x: number, y: number): number;
781
+ /** Returns a pseudorandom number between 0 and 1. */
782
+ random(): number;
783
+ /**
784
+ * Returns a supplied numeric expression rounded to the nearest integer.
785
+ * @param x The value to be rounded to the nearest integer.
786
+ */
787
+ round(x: number): number;
788
+ /**
789
+ * Returns the sine of a number.
790
+ * @param x A numeric expression that contains an angle measured in radians.
791
+ */
792
+ sin(x: number): number;
793
+ /**
794
+ * Returns the square root of a number.
795
+ * @param x A numeric expression.
796
+ */
797
+ sqrt(x: number): number;
798
+ /**
799
+ * Returns the tangent of a number.
800
+ * @param x A numeric expression that contains an angle measured in radians.
801
+ */
802
+ tan(x: number): number;
803
+ /**
804
+ * Returns the number of leading zero bits in the 32-bit binary representation of a number.
805
+ * @param x A numeric expression.
806
+ */
807
+ clz32(x: number): number;
808
+ /**
809
+ * Returns the result of 32-bit multiplication of two numbers.
810
+ * @param x First number
811
+ * @param y Second number
812
+ */
813
+ imul(x: number, y: number): number;
814
+ /**
815
+ * Returns the sign of the x, indicating whether x is positive, negative or zero.
816
+ * @param x The numeric expression to test
817
+ */
818
+ sign(x: number): number;
819
+ /**
820
+ * Returns the base 10 logarithm of a number.
821
+ * @param x A numeric expression.
822
+ */
823
+ log10(x: number): number;
824
+ /**
825
+ * Returns the base 2 logarithm of a number.
826
+ * @param x A numeric expression.
827
+ */
828
+ log2(x: number): number;
829
+ /**
830
+ * Returns the natural logarithm of 1 + x.
831
+ * @param x A numeric expression.
832
+ */
833
+ log1p(x: number): number;
834
+ /**
835
+ * Returns the result of (e^x - 1), which is an implementation-dependent approximation to
836
+ * subtracting 1 from the exponential function of x (e raised to the power of x, where e
837
+ * is the base of the natural logarithms).
838
+ * @param x A numeric expression.
839
+ */
840
+ expm1(x: number): number;
841
+ /**
842
+ * Returns the hyperbolic cosine of a number.
843
+ * @param x A numeric expression that contains an angle measured in radians.
844
+ */
845
+ cosh(x: number): number;
846
+ /**
847
+ * Returns the hyperbolic sine of a number.
848
+ * @param x A numeric expression that contains an angle measured in radians.
849
+ */
850
+ sinh(x: number): number;
851
+ /**
852
+ * Returns the hyperbolic tangent of a number.
853
+ * @param x A numeric expression that contains an angle measured in radians.
854
+ */
855
+ tanh(x: number): number;
856
+ /**
857
+ * Returns the inverse hyperbolic cosine of a number.
858
+ * @param x A numeric expression that contains an angle measured in radians.
859
+ */
860
+ acosh(x: number): number;
861
+ /**
862
+ * Returns the inverse hyperbolic sine of a number.
863
+ * @param x A numeric expression that contains an angle measured in radians.
864
+ */
865
+ asinh(x: number): number;
866
+ /**
867
+ * Returns the inverse hyperbolic tangent of a number.
868
+ * @param x A numeric expression that contains an angle measured in radians.
869
+ */
870
+ atanh(x: number): number;
871
+ /**
872
+ * Returns the square root of the sum of squares of its arguments.
873
+ * @param values Values to compute the square root for.
874
+ * If no arguments are passed, the result is +0.
875
+ * If there is only one argument, the result is the absolute value.
876
+ * If any argument is +Infinity or -Infinity, the result is +Infinity.
877
+ * If any argument is NaN, the result is NaN.
878
+ * If all arguments are either +0 or −0, the result is +0.
879
+ */
880
+ hypot(...values: number[]): number;
881
+ /**
882
+ * Returns the integral part of the a numeric expression, x, removing any fractional digits.
883
+ * If x is already an integer, the result is x.
884
+ * @param x A numeric expression.
885
+ */
886
+ trunc(x: number): number;
887
+ /**
888
+ * Returns the nearest single precision float representation of a number.
889
+ * @param x A numeric expression.
890
+ */
891
+ fround(x: number): number;
892
+ /**
893
+ * Returns an implementation-dependent approximation to the cube root of number.
894
+ * @param x A numeric expression.
895
+ */
896
+ cbrt(x: number): number;
897
+ }
898
+
899
+ interface JSON {
900
+ /**
901
+ * Converts a JavaScript Object Notation (JSON) string into an object.
902
+ * @param text A valid JSON string.
903
+ * @param reviver A function that transforms the results. This function is called for each member of the object.
904
+ * If a member contains nested objects, the nested objects are transformed before the parent object is.
905
+ * @throws {SyntaxError} If `text` is not valid JSON.
906
+ */
907
+ parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
908
+ /**
909
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
910
+ * @param value A JavaScript value, usually an object or array, to be converted.
911
+ * @param replacer A function that transforms the results.
912
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
913
+ * @throws {TypeError} If a circular reference or a BigInt value is found.
914
+ */
915
+ stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
916
+ /**
917
+ * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
918
+ * @param value A JavaScript value, usually an object or array, to be converted.
919
+ * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
920
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
921
+ * @throws {TypeError} If a circular reference or a BigInt value is found.
922
+ */
923
+ stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
924
+ }
925
+
926
+ interface NumberConstructor {
927
+ (value?: any): number;
928
+ /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */
929
+ readonly MAX_VALUE: number;
930
+ /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */
931
+ readonly MIN_VALUE: number;
932
+ /**
933
+ * A value that is not a number.
934
+ * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.
935
+ */
936
+ readonly NaN: number;
937
+ /**
938
+ * A value that is less than the largest negative number that can be represented in JavaScript.
939
+ * JavaScript displays NEGATIVE_INFINITY values as -infinity.
940
+ */
941
+ readonly NEGATIVE_INFINITY: number;
942
+ /**
943
+ * A value greater than the largest number that can be represented in JavaScript.
944
+ * JavaScript displays POSITIVE_INFINITY values as infinity.
945
+ */
946
+ readonly POSITIVE_INFINITY: number;
947
+ /**
948
+ * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
949
+ * that is representable as a Number value, which is approximately:
950
+ * 2.2204460492503130808472633361816 x 10‍−‍16.
951
+ */
952
+ readonly EPSILON: number;
953
+ /**
954
+ * Returns true if passed value is finite.
955
+ * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a
956
+ * number. Only finite values of the type number, result in true.
957
+ * @param number A numeric value.
958
+ */
959
+ isFinite(number: unknown): boolean;
960
+ /**
961
+ * Returns true if the value passed is an integer, false otherwise.
962
+ * @param number A numeric value.
963
+ */
964
+ isInteger(number: unknown): boolean;
965
+ /**
966
+ * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
967
+ * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
968
+ * to a number. Only values of the type number, that are also NaN, result in true.
969
+ * @param number A numeric value.
970
+ */
971
+ isNaN(number: unknown): boolean;
972
+ /**
973
+ * Returns true if the value passed is a safe integer.
974
+ * @param number A numeric value.
975
+ */
976
+ isSafeInteger(number: unknown): boolean;
977
+ /**
978
+ * The value of the largest integer n such that n and n + 1 are both exactly representable as
979
+ * a Number value.
980
+ * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.
981
+ */
982
+ readonly MAX_SAFE_INTEGER: number;
983
+ /**
984
+ * The value of the smallest integer n such that n and n − 1 are both exactly representable as
985
+ * a Number value.
986
+ * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
987
+ */
988
+ readonly MIN_SAFE_INTEGER: number;
989
+ /**
990
+ * Converts a string to a floating-point number.
991
+ * @param string A string that contains a floating-point number.
992
+ */
993
+ parseFloat(string: string): number;
994
+ /**
995
+ * Converts A string to an integer.
996
+ * @param string A string to convert into a number.
997
+ * @param radix A value between 2 and 36 that specifies the base of the number in `string`.
998
+ * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
999
+ * All other strings are considered decimal.
1000
+ */
1001
+ parseInt(string: string, radix?: number): number;
1002
+ }
1003
+
1004
+ interface StringConstructor {
1005
+ (value?: any): string;
1006
+ /**
1007
+ * String.raw is usually used as a tag function of a Tagged Template String. When called as
1008
+ * such, the first argument will be a well formed template call site object and the rest
1009
+ * parameter will contain the substitution values. It can also be called directly, for example,
1010
+ * to interleave strings and values from your own tag function, and in this case the only thing
1011
+ * it needs from the first argument is the raw property.
1012
+ * @param template A well-formed template string call site representation.
1013
+ * @param substitutions A set of substitution values.
1014
+ */
1015
+ raw(template: { raw: readonly string[] | ArrayLike<string>; }, ...substitutions: any[]): string;
1016
+ }
1017
+
1018
+ interface ArrayConstructor {
1019
+ isArray(arg: any): arg is any[];
1020
+ /**
1021
+ * Creates an array from an array-like object.
1022
+ * @param arrayLike An array-like object to convert to an array.
1023
+ */
1024
+ from<T>(arrayLike: ArrayLike<T>): T[];
1025
+ /**
1026
+ * Creates an array from an iterable object.
1027
+ * @param arrayLike An array-like object to convert to an array.
1028
+ * @param mapfn A mapping function to call on every element of the array.
1029
+ * @param thisArg Value of 'this' used to invoke the mapfn.
1030
+ */
1031
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
1032
+ /**
1033
+ * Returns a new array from a set of elements.
1034
+ * @param items A set of elements to include in the new array object.
1035
+ */
1036
+ of<T>(...items: T[]): T[];
1037
+ }
1038
+
1039
+ interface ObjectConstructor {
1040
+ /**
1041
+ * Returns the names of the enumerable string properties and methods of an object.
1042
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
1043
+ */
1044
+ keys(o: object): string[];
1045
+ /**
1046
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
1047
+ * target object. Returns the target object.
1048
+ * @param target The target object to copy to.
1049
+ * @param source The source object from which to copy properties.
1050
+ */
1051
+ assign<T extends {}, U>(target: T, source: U): T & U;
1052
+ /**
1053
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
1054
+ * target object. Returns the target object.
1055
+ * @param target The target object to copy to.
1056
+ * @param source1 The first source object from which to copy properties.
1057
+ * @param source2 The second source object from which to copy properties.
1058
+ */
1059
+ assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
1060
+ /**
1061
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
1062
+ * target object. Returns the target object.
1063
+ * @param target The target object to copy to.
1064
+ * @param source1 The first source object from which to copy properties.
1065
+ * @param source2 The second source object from which to copy properties.
1066
+ * @param source3 The third source object from which to copy properties.
1067
+ */
1068
+ assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
1069
+ /**
1070
+ * Copy the values of all of the enumerable own properties from one or more source objects to a
1071
+ * target object. Returns the target object.
1072
+ * @param target The target object to copy to.
1073
+ * @param sources One or more source objects from which to copy properties
1074
+ */
1075
+ assign(target: object, ...sources: any[]): any;
1076
+ /**
1077
+ * Returns the names of the enumerable string properties and methods of an object.
1078
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
1079
+ */
1080
+ keys(o: {}): string[];
1081
+ /**
1082
+ * Returns an array of values of the enumerable own properties of an object
1083
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
1084
+ */
1085
+ values<T>(o: { [s: string]: T; } | ArrayLike<T>): T[];
1086
+ /**
1087
+ * Returns an array of values of the enumerable own properties of an object
1088
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
1089
+ */
1090
+ values(o: {}): any[];
1091
+ /**
1092
+ * Returns an array of key/values of the enumerable own properties of an object
1093
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
1094
+ */
1095
+ entries<T>(o: { [s: string]: T; } | ArrayLike<T>): [string, T][];
1096
+ /**
1097
+ * Returns an array of key/values of the enumerable own properties of an object
1098
+ * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
1099
+ */
1100
+ entries(o: {}): [string, any][];
1101
+ /**
1102
+ * Determines whether an object has a property with the specified name.
1103
+ * @param o An object.
1104
+ * @param v A property name.
1105
+ */
1106
+ hasOwn(o: object, v: PropertyKey): boolean;
1107
+ }
1108
+
1109
+ interface MapConstructor {
1110
+ new (): Map<any, any>;
1111
+ new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
1112
+ new (): Map<any, any>;
1113
+ }
1114
+
1115
+ interface SetConstructor {
1116
+ new <T = any>(values?: readonly T[] | null): Set<T>;
1117
+ }
1118
+
1119
+ /*! *****************************************************************************
1120
+ Copyright (c) Microsoft Corporation. All rights reserved.
1121
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
1122
+ this file except in compliance with the License. You may obtain a copy of the
1123
+ License at http://www.apache.org/licenses/LICENSE-2.0
1124
+
1125
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1126
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
1127
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
1128
+ MERCHANTABLITY OR NON-INFRINGEMENT.
1129
+
1130
+ See the Apache Version 2.0 License for specific language governing permissions
1131
+ and limitations under the License.
1132
+ ***************************************************************************** */
1133
+
1134
+
1135
+ /// <reference no-default-lib="true"/>
1136
+
1137
+ type FlatArray<Arr, Depth extends number> = {
1138
+ done: Arr;
1139
+ recur: Arr extends ReadonlyArray<infer InnerArr> ? FlatArray<InnerArr, [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]>
1140
+ : Arr;
1141
+ }[Depth extends -1 ? "done" : "recur"];
1142
+
1143
+ /**
1144
+ * Defines the `TReturn` type used for built-in iterators produced by `Array`, `Map`, `Set`, and others.
1145
+ * This is `undefined` when `strictBuiltInIteratorReturn` is `true`; otherwise, this is `any`.
1146
+ */
1147
+ type BuiltinIteratorReturn = intrinsic;
1148
+
1149
+ declare type PropertyKey = string | number | symbol;
1150
+
1151
+ interface ArrayIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
1152
+ [Symbol.iterator](): ArrayIterator<T>;
1153
+ }
1154
+
1155
+ interface ArrayLike<T> {
1156
+ readonly length: number;
1157
+ readonly [n: number]: T;
1158
+ }
1159
+
1160
+ interface ConcatArray<T> {
1161
+ readonly length: number;
1162
+ readonly [n: number]: T;
1163
+ join(separator?: string): string;
1164
+ slice(start?: number, end?: number): T[];
1165
+ }
1166
+
1167
+ interface Iterator<T, TReturn = any, TNext = any> {
1168
+
1169
+ }
1170
+
1171
+ interface IteratorObject<T, TReturn = unknown, TNext = unknown> extends Iterator<T, TReturn, TNext> {
1172
+ [Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
1173
+ }
1174
+
1175
+ interface MapIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
1176
+ [Symbol.iterator](): MapIterator<T>;
1177
+ }
1178
+
1179
+ interface RegExpIndicesArray extends Array<[number, number]> {
1180
+ groups?: {
1181
+ [key: string]: [number, number];
1182
+ };
1183
+ }
1184
+
1185
+ interface RegExpMatchArray extends Array<string> {
1186
+ /**
1187
+ * The index of the search at which the result was found.
1188
+ */
1189
+ index?: number;
1190
+ /**
1191
+ * A copy of the search string.
1192
+ */
1193
+ input?: string;
1194
+ groups?: {
1195
+ [key: string]: string;
1196
+ };
1197
+ indices?: RegExpIndicesArray;
1198
+ }
1199
+
1200
+ interface SetIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
1201
+ [Symbol.iterator](): SetIterator<T>;
1202
+ }
1203
+
1204
+ interface StringIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
1205
+ [Symbol.iterator](): StringIterator<T>;
1206
+ }
1207
+
1208
+ interface SymbolConstructor {
1209
+ /**
1210
+ * A method that returns the default iterator for an object. Called by the semantics of the
1211
+ * for-of statement.
1212
+ */
1213
+ readonly iterator: unique symbol;
1214
+ }
1215
+ declare var Symbol: SymbolConstructor;
1216
+
1217
+ declare var Math: Math;
1218
+ declare var JSON: JSON;
1219
+ declare var Number: NumberConstructor;
1220
+ declare var String: StringConstructor;
1221
+ declare var Array: ArrayConstructor;
1222
+ declare var Object: ObjectConstructor;
1223
+ declare var Map: MapConstructor;
1224
+ declare var Set: SetConstructor;
1225
+ /**
1226
+ * Converts a string to an integer.
1227
+ * @param string A string to convert into a number.
1228
+ * @param radix A value between 2 and 36 that specifies the base of the number in `string`.
1229
+ * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
1230
+ * All other strings are considered decimal.
1231
+ */
1232
+ declare function parseInt(string: string, radix?: number): number;
1233
+ /**
1234
+ * Converts a string to a floating-point number.
1235
+ * @param string A string that contains a floating-point number.
1236
+ */
1237
+ declare function parseFloat(string: string): number;
1238
+ /**
1239
+ * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).
1240
+ * @param number A numeric value.
1241
+ */
1242
+ declare function isNaN(number: number): boolean;
1243
+ /**
1244
+ * Determines whether a supplied number is finite.
1245
+ * @param number Any numeric value.
1246
+ */
1247
+ declare function isFinite(number: number): boolean;
1248
+
1249
+ interface Array<T> {
1250
+ /** arr.sortBy(key?, {desc?})
1251
+ *
1252
+ * Sorts the array in place by a field of its objects (or by the
1253
+ * elements themselves without a key) and returns it. Stable; the
1254
+ * compared values are all numbers or all strings. */
1255
+ sortBy(key?: string | null, options?: { desc?: boolean }): T[];
1256
+ // ES2023, after the editor's lib.
1257
+ findLast(predicate: (value: T, index: number, array: T[]) => unknown): T | undefined;
1258
+ findLastIndex(predicate: (value: T, index: number, array: T[]) => unknown): number;
1259
+ toReversed(): T[];
1260
+ toSorted(compareFn?: (a: T, b: T) => number): T[];
1261
+ toSpliced(start: number, deleteCount?: number, ...items: T[]): T[];
1262
+ with(index: number, value: T): T[];
1263
+ }
1264
+ interface String {
1265
+ /** All the matches of a global regular expression, as an array. */
1266
+ matchAll(regexp: RegExp): RegExpMatchArray[];
1267
+ }
1268
+ // keys(), values() and entries() answer arrays: the language has no
1269
+ // iterator objects.
1270
+ interface Map<K, V> {
1271
+ keys(): K[];
1272
+ values(): V[];
1273
+ entries(): [K, V][];
1274
+ }
1275
+ interface Set<T> {
1276
+ keys(): T[];
1277
+ values(): T[];
1278
+ entries(): [T, T][];
1279
+ }
1280
+ interface ArrayConstructor {
1281
+ /** The entries of a Map, the items of a Set, the characters of a string. */
1282
+ from<K, V>(source: Map<K, V>): [K, V][];
1283
+ from<T>(source: Set<T>): T[];
1284
+ from(source: string): string[];
1285
+ }
1286
+ interface ObjectConstructor {
1287
+ /** An object from [key, value] pairs: the inverse of Object.entries. */
1288
+ fromEntries<T = any>(entries: readonly (readonly [PropertyKey, T])[]): { [k: string]: T };
1289
+ }