strict-ts-lib-v6.0 0.2.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.
Files changed (109) hide show
  1. package/README.md +28 -0
  2. package/libs/decorators/index.d.ts +360 -0
  3. package/libs/decorators/legacy/index.d.ts +17 -0
  4. package/libs/dom/asynciterable/index.d.ts +2 -0
  5. package/libs/dom/index.d.ts +53065 -0
  6. package/libs/dom/iterable/index.d.ts +2 -0
  7. package/libs/es2015/collection/index.d.ts +151 -0
  8. package/libs/es2015/core/index.d.ts +645 -0
  9. package/libs/es2015/generator/index.d.ts +63 -0
  10. package/libs/es2015/index.d.ts +10 -0
  11. package/libs/es2015/iterable/index.d.ts +658 -0
  12. package/libs/es2015/promise/index.d.ts +72 -0
  13. package/libs/es2015/proxy/index.d.ts +129 -0
  14. package/libs/es2015/reflect/index.d.ts +143 -0
  15. package/libs/es2015/symbol/index.d.ts +28 -0
  16. package/libs/es2015/symbol-wellknown/index.d.ts +329 -0
  17. package/libs/es2016/array-include/index.d.ts +113 -0
  18. package/libs/es2016/full/index.d.ts +5 -0
  19. package/libs/es2016/index.d.ts +3 -0
  20. package/libs/es2016/intl/index.d.ts +13 -0
  21. package/libs/es2017/arraybuffer/index.d.ts +3 -0
  22. package/libs/es2017/date/index.d.ts +21 -0
  23. package/libs/es2017/full/index.d.ts +5 -0
  24. package/libs/es2017/index.d.ts +8 -0
  25. package/libs/es2017/intl/index.d.ts +26 -0
  26. package/libs/es2017/object/index.d.ts +113 -0
  27. package/libs/es2017/sharedmemory/index.d.ts +246 -0
  28. package/libs/es2017/string/index.d.ts +27 -0
  29. package/libs/es2017/typedarrays/index.d.ts +35 -0
  30. package/libs/es2018/asyncgenerator/index.d.ts +67 -0
  31. package/libs/es2018/asynciterable/index.d.ts +47 -0
  32. package/libs/es2018/full/index.d.ts +6 -0
  33. package/libs/es2018/index.d.ts +6 -0
  34. package/libs/es2018/intl/index.d.ts +90 -0
  35. package/libs/es2018/promise/index.d.ts +12 -0
  36. package/libs/es2018/regexp/index.d.ts +19 -0
  37. package/libs/es2019/array/index.d.ts +92 -0
  38. package/libs/es2019/full/index.d.ts +6 -0
  39. package/libs/es2019/index.d.ts +6 -0
  40. package/libs/es2019/intl/index.d.ts +5 -0
  41. package/libs/es2019/object/index.d.ts +142 -0
  42. package/libs/es2019/string/index.d.ts +19 -0
  43. package/libs/es2019/symbol/index.d.ts +6 -0
  44. package/libs/es2020/bigint/index.d.ts +952 -0
  45. package/libs/es2020/date/index.d.ts +33 -0
  46. package/libs/es2020/full/index.d.ts +6 -0
  47. package/libs/es2020/index.d.ts +9 -0
  48. package/libs/es2020/intl/index.d.ts +492 -0
  49. package/libs/es2020/number/index.d.ts +13 -0
  50. package/libs/es2020/promise/index.d.ts +35 -0
  51. package/libs/es2020/sharedmemory/index.d.ts +144 -0
  52. package/libs/es2020/string/index.d.ts +30 -0
  53. package/libs/es2020/symbol-wellknown/index.d.ts +27 -0
  54. package/libs/es2021/full/index.d.ts +6 -0
  55. package/libs/es2021/index.d.ts +5 -0
  56. package/libs/es2021/intl/index.d.ts +159 -0
  57. package/libs/es2021/promise/index.d.ts +32 -0
  58. package/libs/es2021/string/index.d.ts +18 -0
  59. package/libs/es2021/weakref/index.d.ts +60 -0
  60. package/libs/es2022/array/index.d.ts +103 -0
  61. package/libs/es2022/error/index.d.ts +57 -0
  62. package/libs/es2022/full/index.d.ts +6 -0
  63. package/libs/es2022/index.d.ts +7 -0
  64. package/libs/es2022/intl/index.d.ts +142 -0
  65. package/libs/es2022/object/index.d.ts +40 -0
  66. package/libs/es2022/regexp/index.d.ts +23 -0
  67. package/libs/es2022/string/index.d.ts +7 -0
  68. package/libs/es2023/array/index.d.ts +913 -0
  69. package/libs/es2023/collection/index.d.ts +3 -0
  70. package/libs/es2023/full/index.d.ts +6 -0
  71. package/libs/es2023/index.d.ts +4 -0
  72. package/libs/es2023/intl/index.d.ts +112 -0
  73. package/libs/es2024/arraybuffer/index.d.ts +50 -0
  74. package/libs/es2024/collection/index.d.ts +11 -0
  75. package/libs/es2024/full/index.d.ts +6 -0
  76. package/libs/es2024/index.d.ts +8 -0
  77. package/libs/es2024/object/index.d.ts +11 -0
  78. package/libs/es2024/promise/index.d.ts +17 -0
  79. package/libs/es2024/regexp/index.d.ts +7 -0
  80. package/libs/es2024/sharedmemory/index.d.ts +67 -0
  81. package/libs/es2024/string/index.d.ts +11 -0
  82. package/libs/es2025/collection/index.d.ts +78 -0
  83. package/libs/es2025/float16/index.d.ts +503 -0
  84. package/libs/es2025/full/index.d.ts +6 -0
  85. package/libs/es2025/index.d.ts +7 -0
  86. package/libs/es2025/intl/index.d.ts +221 -0
  87. package/libs/es2025/iterator/index.d.ts +170 -0
  88. package/libs/es2025/promise/index.d.ts +19 -0
  89. package/libs/es2025/regexp/index.d.ts +14 -0
  90. package/libs/es5/index.d.ts +5844 -0
  91. package/libs/es6/index.d.ts +5 -0
  92. package/libs/esnext/array/index.d.ts +26 -0
  93. package/libs/esnext/collection/index.d.ts +31 -0
  94. package/libs/esnext/date/index.d.ts +5 -0
  95. package/libs/esnext/decorators/index.d.ts +10 -0
  96. package/libs/esnext/disposable/index.d.ts +173 -0
  97. package/libs/esnext/error/index.d.ts +6 -0
  98. package/libs/esnext/full/index.d.ts +6 -0
  99. package/libs/esnext/index.d.ts +11 -0
  100. package/libs/esnext/intl/index.d.ts +105 -0
  101. package/libs/esnext/sharedmemory/index.d.ts +7 -0
  102. package/libs/esnext/temporal/index.d.ts +684 -0
  103. package/libs/esnext/typedarrays/index.d.ts +78 -0
  104. package/libs/scripthost/index.d.ts +308 -0
  105. package/libs/webworker/asynciterable/index.d.ts +2 -0
  106. package/libs/webworker/importscripts/index.d.ts +5 -0
  107. package/libs/webworker/index.d.ts +18819 -0
  108. package/libs/webworker/iterable/index.d.ts +2 -0
  109. package/package.json +23 -0
@@ -0,0 +1,221 @@
1
+ /// <reference lib="es2018.intl" />
2
+
3
+ declare namespace Intl {
4
+ /**
5
+ * The locale matching algorithm to use.
6
+ *
7
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).
8
+ */
9
+ type DurationFormatLocaleMatcher = 'lookup' | 'best fit';
10
+
11
+ /**
12
+ * The style of the formatted duration.
13
+ *
14
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat#style).
15
+ */
16
+ type DurationFormatStyle = 'long' | 'short' | 'narrow' | 'digital';
17
+
18
+ /**
19
+ * Whether to always display a unit, or only if it is non-zero.
20
+ *
21
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat#display).
22
+ */
23
+ type DurationFormatDisplayOption = 'always' | 'auto';
24
+
25
+ /**
26
+ * Value of the `unit` property in duration objects
27
+ *
28
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/format#duration).
29
+ */
30
+ type DurationFormatUnit =
31
+ | 'years'
32
+ | 'months'
33
+ | 'weeks'
34
+ | 'days'
35
+ | 'hours'
36
+ | 'minutes'
37
+ | 'seconds'
38
+ | 'milliseconds'
39
+ | 'microseconds'
40
+ | 'nanoseconds';
41
+
42
+ type DurationFormatUnitSingular =
43
+ | 'year'
44
+ | 'month'
45
+ | 'week'
46
+ | 'day'
47
+ | 'hour'
48
+ | 'minute'
49
+ | 'second'
50
+ | 'millisecond'
51
+ | 'microsecond'
52
+ | 'nanosecond';
53
+
54
+ /**
55
+ * An object representing the relative time format in parts
56
+ * that can be used for custom locale-aware formatting.
57
+ *
58
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/formatToParts).
59
+ */
60
+ type DurationFormatPart =
61
+ | {
62
+ readonly type: 'literal';
63
+ readonly value: string;
64
+ readonly unit?: DurationFormatUnitSingular;
65
+ }
66
+ | {
67
+ readonly type: Exclude<NumberFormatPartTypes, 'literal'>;
68
+ readonly value: string;
69
+ readonly unit: DurationFormatUnitSingular;
70
+ };
71
+
72
+ /**
73
+ * An object with some or all properties of the `Intl.DurationFormat` constructor `options` parameter.
74
+ *
75
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat#parameters)
76
+ */
77
+ interface DurationFormatOptions {
78
+ readonly localeMatcher?: DurationFormatLocaleMatcher | undefined;
79
+ readonly numberingSystem?: string | undefined;
80
+ readonly style?: DurationFormatStyle | undefined;
81
+ readonly years?: 'long' | 'short' | 'narrow' | undefined;
82
+ readonly yearsDisplay?: DurationFormatDisplayOption | undefined;
83
+ readonly months?: 'long' | 'short' | 'narrow' | undefined;
84
+ readonly monthsDisplay?: DurationFormatDisplayOption | undefined;
85
+ readonly weeks?: 'long' | 'short' | 'narrow' | undefined;
86
+ readonly weeksDisplay?: DurationFormatDisplayOption | undefined;
87
+ readonly days?: 'long' | 'short' | 'narrow' | undefined;
88
+ readonly daysDisplay?: DurationFormatDisplayOption | undefined;
89
+ readonly hours?:
90
+ | 'long'
91
+ | 'short'
92
+ | 'narrow'
93
+ | 'numeric'
94
+ | '2-digit'
95
+ | undefined;
96
+ readonly hoursDisplay?: DurationFormatDisplayOption | undefined;
97
+ readonly minutes?:
98
+ | 'long'
99
+ | 'short'
100
+ | 'narrow'
101
+ | 'numeric'
102
+ | '2-digit'
103
+ | undefined;
104
+ readonly minutesDisplay?: DurationFormatDisplayOption | undefined;
105
+ readonly seconds?:
106
+ | 'long'
107
+ | 'short'
108
+ | 'narrow'
109
+ | 'numeric'
110
+ | '2-digit'
111
+ | undefined;
112
+ readonly secondsDisplay?: DurationFormatDisplayOption | undefined;
113
+ readonly milliseconds?: 'long' | 'short' | 'narrow' | 'numeric' | undefined;
114
+ readonly millisecondsDisplay?: DurationFormatDisplayOption | undefined;
115
+ readonly microseconds?: 'long' | 'short' | 'narrow' | 'numeric' | undefined;
116
+ readonly microsecondsDisplay?: DurationFormatDisplayOption | undefined;
117
+ readonly nanoseconds?: 'long' | 'short' | 'narrow' | 'numeric' | undefined;
118
+ readonly nanosecondsDisplay?: DurationFormatDisplayOption | undefined;
119
+ readonly fractionalDigits?:
120
+ | 0
121
+ | 1
122
+ | 2
123
+ | 3
124
+ | 4
125
+ | 5
126
+ | 6
127
+ | 7
128
+ | 8
129
+ | 9
130
+ | undefined;
131
+ }
132
+
133
+ /**
134
+ * The Intl.DurationFormat object enables language-sensitive duration formatting.
135
+ *
136
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat)
137
+ */
138
+ interface DurationFormat {
139
+ /**
140
+ * @param duration The duration object to be formatted. It should include some or all of the following properties: months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds.
141
+ *
142
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/format).
143
+ */
144
+ format(duration: Partial<Record<DurationFormatUnit, number>>): string;
145
+ /**
146
+ * @param duration The duration object to be formatted. It should include some or all of the following properties: months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds.
147
+ *
148
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/formatToParts).
149
+ */
150
+ formatToParts(
151
+ duration: Partial<Record<DurationFormatUnit, number>>,
152
+ ): DurationFormatPart[];
153
+ /**
154
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/resolvedOptions).
155
+ */
156
+ resolvedOptions(): ResolvedDurationFormatOptions;
157
+ }
158
+
159
+ interface ResolvedDurationFormatOptions {
160
+ readonly locale: UnicodeBCP47LocaleIdentifier;
161
+ readonly numberingSystem: string;
162
+ readonly style: DurationFormatStyle;
163
+ readonly years: 'long' | 'short' | 'narrow';
164
+ readonly yearsDisplay: DurationFormatDisplayOption;
165
+ readonly months: 'long' | 'short' | 'narrow';
166
+ readonly monthsDisplay: DurationFormatDisplayOption;
167
+ readonly weeks: 'long' | 'short' | 'narrow';
168
+ readonly weeksDisplay: DurationFormatDisplayOption;
169
+ readonly days: 'long' | 'short' | 'narrow';
170
+ readonly daysDisplay: DurationFormatDisplayOption;
171
+ readonly hours: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit';
172
+ readonly hoursDisplay: DurationFormatDisplayOption;
173
+ readonly minutes: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit';
174
+ readonly minutesDisplay: DurationFormatDisplayOption;
175
+ readonly seconds: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit';
176
+ readonly secondsDisplay: DurationFormatDisplayOption;
177
+ readonly milliseconds: 'long' | 'short' | 'narrow' | 'numeric';
178
+ readonly millisecondsDisplay: DurationFormatDisplayOption;
179
+ readonly microseconds: 'long' | 'short' | 'narrow' | 'numeric';
180
+ readonly microsecondsDisplay: DurationFormatDisplayOption;
181
+ readonly nanoseconds: 'long' | 'short' | 'narrow' | 'numeric';
182
+ readonly nanosecondsDisplay: DurationFormatDisplayOption;
183
+ readonly fractionalDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
184
+ }
185
+
186
+ const DurationFormat: {
187
+ readonly prototype: DurationFormat;
188
+
189
+ /**
190
+ * @param locales A string with a BCP 47 language tag, or an array of such strings.
191
+ * For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)
192
+ * page.
193
+ *
194
+ * @param options An object for setting up a duration format.
195
+ *
196
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat).
197
+ */
198
+ new (
199
+ locales?: LocalesArgument,
200
+ options?: DurationFormatOptions,
201
+ ): DurationFormat;
202
+
203
+ /**
204
+ * Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale.
205
+ *
206
+ * @param locales A string with a BCP 47 language tag, or an array of such strings.
207
+ * For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)
208
+ * page.
209
+ *
210
+ * @param options An object with a locale matcher.
211
+ *
212
+ * @returns An array of strings representing a subset of the given locale tags that are supported in display names without having to fall back to the runtime's default locale.
213
+ *
214
+ * [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/supportedLocalesOf).
215
+ */
216
+ supportedLocalesOf(
217
+ locales?: LocalesArgument,
218
+ options?: { readonly localeMatcher?: DurationFormatLocaleMatcher },
219
+ ): UnicodeBCP47LocaleIdentifier[];
220
+ };
221
+ }
@@ -0,0 +1,170 @@
1
+ /// <reference lib="es2015.iterable" />
2
+
3
+ // NOTE: This is specified as what is essentially an unreachable module. All actual global declarations can be found
4
+ // in the `declare global` section, below. This is necessary as there is currently no way to declare an `abstract`
5
+ // member without declaring a `class`, but declaring `class Iterator<T>` globally would conflict with TypeScript's
6
+ // general purpose `Iterator<T>` interface.
7
+ export {};
8
+
9
+ // Abstract type that allows us to mark `next` as `abstract`
10
+ declare abstract class Iterator<T, TResult = undefined, TNext = unknown> {
11
+ // eslint-disable-line @typescript-eslint/no-unsafe-declaration-merging
12
+ abstract next(value?: TNext): IteratorResult<T, TResult>;
13
+ }
14
+
15
+ // Merge all members of `IteratorObject<T>` into `Iterator<T>`
16
+ interface Iterator<T, TResult, TNext> extends globalThis.IteratorObject<
17
+ T,
18
+ TResult,
19
+ TNext
20
+ > {}
21
+
22
+ // Capture the `Iterator` constructor in a type we can use in the `extends` clause of `IteratorConstructor`.
23
+ type IteratorObjectConstructor = typeof Iterator;
24
+
25
+ declare global {
26
+ // Global `IteratorObject<T, TReturn, TNext>` interface that can be augmented by polyfills
27
+ interface IteratorObject<T, TReturn, TNext> {
28
+ /**
29
+ * Returns this iterator.
30
+ */
31
+ [Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
32
+
33
+ /**
34
+ * Creates an iterator whose values are the result of applying the callback to the values from this iterator.
35
+ * @param callbackfn A function that accepts up to two arguments to be used to transform values from the underlying iterator.
36
+ */
37
+ map<U>(
38
+ callbackfn: (value: T, index: number) => U,
39
+ ): IteratorObject<U, undefined, unknown>;
40
+
41
+ /**
42
+ * Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
43
+ * @param predicate A function that accepts up to two arguments to be used to test values from the underlying iterator.
44
+ */
45
+ filter<S extends T>(
46
+ predicate: (value: T, index: number) => value is S,
47
+ ): IteratorObject<S, undefined, unknown>;
48
+
49
+ /**
50
+ * Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
51
+ * @param predicate A function that accepts up to two arguments to be used to test values from the underlying iterator.
52
+ */
53
+ filter(
54
+ predicate: (value: T, index: number) => unknown,
55
+ ): IteratorObject<T, undefined, unknown>;
56
+
57
+ /**
58
+ * Creates an iterator whose values are the values from this iterator, stopping once the provided limit is reached.
59
+ * @param limit The maximum number of values to yield.
60
+ */
61
+ take(limit: number): IteratorObject<T, undefined, unknown>;
62
+
63
+ /**
64
+ * Creates an iterator whose values are the values from this iterator after skipping the provided count.
65
+ * @param count The number of values to drop.
66
+ */
67
+ drop(count: number): IteratorObject<T, undefined, unknown>;
68
+
69
+ /**
70
+ * Creates an iterator whose values are the result of applying the callback to the values from this iterator and then flattening the resulting iterators or iterables.
71
+ * @param callback A function that accepts up to two arguments to be used to transform values from the underlying iterator into new iterators or iterables to be flattened into the result.
72
+ */
73
+ flatMap<U>(
74
+ callback: (
75
+ value: T,
76
+ index: number,
77
+ ) => Iterator<U, unknown, undefined> | Iterable<U, unknown, undefined>,
78
+ ): IteratorObject<U, undefined, unknown>;
79
+
80
+ /**
81
+ * Calls the specified callback function for all the elements in this iterator. 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.
82
+ * @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the iterator.
83
+ * @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 a value from the iterator.
84
+ */
85
+ reduce(
86
+ callbackfn: (
87
+ previousValue: T,
88
+ currentValue: T,
89
+ currentIndex: number,
90
+ ) => T,
91
+ ): T;
92
+ reduce(
93
+ callbackfn: (
94
+ previousValue: T,
95
+ currentValue: T,
96
+ currentIndex: number,
97
+ ) => T,
98
+ initialValue: T,
99
+ ): T;
100
+
101
+ /**
102
+ * Calls the specified callback function for all the elements in this iterator. 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.
103
+ * @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the iterator.
104
+ * @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 a value from the iterator.
105
+ */
106
+ reduce<U>(
107
+ callbackfn: (
108
+ previousValue: U,
109
+ currentValue: T,
110
+ currentIndex: number,
111
+ ) => U,
112
+ initialValue: U,
113
+ ): U;
114
+
115
+ /**
116
+ * Creates a new array from the values yielded by this iterator.
117
+ */
118
+ toArray(): T[];
119
+
120
+ /**
121
+ * Performs the specified action for each element in the iterator.
122
+ * @param callbackfn A function that accepts up to two arguments. forEach calls the callbackfn function one time for each element in the iterator.
123
+ */
124
+ forEach(callbackfn: (value: T, index: number) => void): void;
125
+
126
+ /**
127
+ * Determines whether the specified callback function returns true for any element of this iterator.
128
+ * @param predicate A function that accepts up to two arguments. The some method calls
129
+ * the predicate function for each element in this iterator until the predicate returns a value
130
+ * true, or until the end of the iterator.
131
+ */
132
+ some(predicate: (value: T, index: number) => unknown): boolean;
133
+
134
+ /**
135
+ * Determines whether all the members of this iterator satisfy the specified test.
136
+ * @param predicate A function that accepts up to two arguments. The every method calls
137
+ * the predicate function for each element in this iterator until the predicate returns
138
+ * false, or until the end of this iterator.
139
+ */
140
+ every(predicate: (value: T, index: number) => unknown): boolean;
141
+
142
+ /**
143
+ * Returns the value of the first element in this iterator where predicate is true, and undefined
144
+ * otherwise.
145
+ * @param predicate find calls predicate once for each element of this iterator, in
146
+ * order, until it finds one where predicate returns true. If such an element is found, find
147
+ * immediately returns that element value. Otherwise, find returns undefined.
148
+ */
149
+ find<S extends T>(
150
+ predicate: (value: T, index: number) => value is S,
151
+ ): S | undefined;
152
+ find(predicate: (value: T, index: number) => unknown): T | undefined;
153
+
154
+ readonly [Symbol.toStringTag]: string;
155
+ }
156
+
157
+ // Global `IteratorConstructor` interface that can be augmented by polyfills
158
+ interface IteratorConstructor extends IteratorObjectConstructor {
159
+ /**
160
+ * Creates a native iterator from an iterator or iterable object.
161
+ * Returns its input if the input already inherits from the built-in Iterator class.
162
+ * @param value An iterator or iterable object to convert a native iterator.
163
+ */
164
+ from<T>(
165
+ value: Iterator<T, unknown, undefined> | Iterable<T, unknown, undefined>,
166
+ ): IteratorObject<T, undefined, unknown>;
167
+ }
168
+
169
+ const Iterator: IteratorConstructor;
170
+ }
@@ -0,0 +1,19 @@
1
+ interface PromiseConstructor {
2
+ /**
3
+ * Takes a callback of any kind (returns or throws, synchronously or asynchronously) and wraps its result
4
+ * in a Promise.
5
+ *
6
+ * @param callbackFn A function that is called synchronously. It can do anything: either return
7
+ * a value, throw an error, or return a promise.
8
+ * @param args Additional arguments, that will be passed to the callback.
9
+ *
10
+ * @returns A Promise that is:
11
+ * - Already fulfilled, if the callback synchronously returns a value.
12
+ * - Already rejected, if the callback synchronously throws an error.
13
+ * - Asynchronously fulfilled or rejected, if the callback returns a promise.
14
+ */
15
+ try<T, U extends readonly unknown[]>(
16
+ callbackFn: (...args: U) => T | PromiseLike<T>,
17
+ ...args: U
18
+ ): Promise<Awaited<T>>;
19
+ }
@@ -0,0 +1,14 @@
1
+ interface RegExpConstructor {
2
+ /**
3
+ * Escapes any RegExp syntax characters in the input string, returning a
4
+ * new string that can be safely interpolated into a RegExp as a literal
5
+ * string to match.
6
+ * @example
7
+ * ```ts
8
+ * const regExp = new RegExp(RegExp.escape("foo.bar"));
9
+ * regExp.test("foo.bar"); // true
10
+ * regExp.test("foo!bar"); // false
11
+ * ```
12
+ */
13
+ escape(string: string): string;
14
+ }