strict-ts-lib-v5.0 0.4.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.
- package/README.md +28 -0
- package/libs/decorators/index.d.ts +344 -0
- package/libs/decorators/legacy/index.d.ts +19 -0
- package/libs/dom/index.d.ts +25408 -0
- package/libs/dom/iterable/index.d.ts +630 -0
- package/libs/es2015/collection/index.d.ts +148 -0
- package/libs/es2015/core/index.d.ts +574 -0
- package/libs/es2015/generator/index.d.ts +65 -0
- package/libs/es2015/index.d.ts +12 -0
- package/libs/es2015/iterable/index.d.ts +522 -0
- package/libs/es2015/promise/index.d.ts +74 -0
- package/libs/es2015/proxy/index.d.ts +131 -0
- package/libs/es2015/reflect/index.d.ts +145 -0
- package/libs/es2015/symbol/index.d.ts +30 -0
- package/libs/es2015/symbol-wellknown/index.d.ts +331 -0
- package/libs/es2016/array-include/index.d.ts +115 -0
- package/libs/es2016/full/index.d.ts +7 -0
- package/libs/es2016/index.d.ts +4 -0
- package/libs/es2017/full/index.d.ts +7 -0
- package/libs/es2017/index.d.ts +8 -0
- package/libs/es2017/intl/index.d.ts +28 -0
- package/libs/es2017/object/index.d.ts +115 -0
- package/libs/es2017/sharedmemory/index.d.ts +244 -0
- package/libs/es2017/string/index.d.ts +29 -0
- package/libs/es2017/typedarrays/index.d.ts +37 -0
- package/libs/es2018/asyncgenerator/index.d.ts +69 -0
- package/libs/es2018/asynciterable/index.d.ts +31 -0
- package/libs/es2018/full/index.d.ts +7 -0
- package/libs/es2018/index.d.ts +8 -0
- package/libs/es2018/intl/index.d.ts +102 -0
- package/libs/es2018/promise/index.d.ts +14 -0
- package/libs/es2018/regexp/index.d.ts +21 -0
- package/libs/es2019/array/index.d.ts +94 -0
- package/libs/es2019/full/index.d.ts +7 -0
- package/libs/es2019/index.d.ts +8 -0
- package/libs/es2019/intl/index.d.ts +7 -0
- package/libs/es2019/object/index.d.ts +143 -0
- package/libs/es2019/string/index.d.ts +21 -0
- package/libs/es2019/symbol/index.d.ts +8 -0
- package/libs/es2020/bigint/index.d.ts +833 -0
- package/libs/es2020/date/index.d.ts +35 -0
- package/libs/es2020/full/index.d.ts +7 -0
- package/libs/es2020/index.d.ts +11 -0
- package/libs/es2020/intl/index.d.ts +433 -0
- package/libs/es2020/number/index.d.ts +15 -0
- package/libs/es2020/promise/index.d.ts +37 -0
- package/libs/es2020/sharedmemory/index.d.ts +119 -0
- package/libs/es2020/string/index.d.ts +12 -0
- package/libs/es2020/symbol-wellknown/index.d.ts +21 -0
- package/libs/es2021/full/index.d.ts +7 -0
- package/libs/es2021/index.d.ts +7 -0
- package/libs/es2021/intl/index.d.ts +164 -0
- package/libs/es2021/promise/index.d.ts +34 -0
- package/libs/es2021/string/index.d.ts +20 -0
- package/libs/es2021/weakref/index.d.ts +57 -0
- package/libs/es2022/array/index.d.ts +105 -0
- package/libs/es2022/error/index.d.ts +57 -0
- package/libs/es2022/full/index.d.ts +7 -0
- package/libs/es2022/index.d.ts +10 -0
- package/libs/es2022/intl/index.d.ts +98 -0
- package/libs/es2022/object/index.d.ts +41 -0
- package/libs/es2022/regexp/index.d.ts +23 -0
- package/libs/es2022/sharedmemory/index.d.ts +37 -0
- package/libs/es2022/string/index.d.ts +9 -0
- package/libs/es2023/array/index.d.ts +495 -0
- package/libs/es2023/full/index.d.ts +7 -0
- package/libs/es2023/index.d.ts +4 -0
- package/libs/es5/index.d.ts +5709 -0
- package/libs/es6/index.d.ts +7 -0
- package/libs/esnext/full/index.d.ts +7 -0
- package/libs/esnext/index.d.ts +4 -0
- package/libs/esnext/intl/index.d.ts +15 -0
- package/libs/scripthost/index.d.ts +310 -0
- package/libs/webworker/importscripts/index.d.ts +7 -0
- package/libs/webworker/index.d.ts +8426 -0
- package/libs/webworker/iterable/index.d.ts +439 -0
- package/package.json +23 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/// <reference lib="es2020.intl" />
|
|
4
|
+
|
|
5
|
+
interface Date {
|
|
6
|
+
/**
|
|
7
|
+
* Converts a date and time to a string by using the current or specified locale.
|
|
8
|
+
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
|
9
|
+
* @param options An object that contains one or more properties that specify comparison options.
|
|
10
|
+
*/
|
|
11
|
+
toLocaleString(
|
|
12
|
+
locales?: Intl.LocalesArgument,
|
|
13
|
+
options?: Intl.DateTimeFormatOptions,
|
|
14
|
+
): string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Converts a date to a string by using the current or specified locale.
|
|
18
|
+
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
|
19
|
+
* @param options An object that contains one or more properties that specify comparison options.
|
|
20
|
+
*/
|
|
21
|
+
toLocaleDateString(
|
|
22
|
+
locales?: Intl.LocalesArgument,
|
|
23
|
+
options?: Intl.DateTimeFormatOptions,
|
|
24
|
+
): string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Converts a time to a string by using the current or specified locale.
|
|
28
|
+
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
|
29
|
+
* @param options An object that contains one or more properties that specify comparison options.
|
|
30
|
+
*/
|
|
31
|
+
toLocaleTimeString(
|
|
32
|
+
locales?: Intl.LocalesArgument,
|
|
33
|
+
options?: Intl.DateTimeFormatOptions,
|
|
34
|
+
): string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/// <reference lib="es2019" />
|
|
4
|
+
/// <reference lib="es2020.bigint" />
|
|
5
|
+
/// <reference lib="es2020.date" />
|
|
6
|
+
/// <reference lib="es2020.number" />
|
|
7
|
+
/// <reference lib="es2020.promise" />
|
|
8
|
+
/// <reference lib="es2020.sharedmemory" />
|
|
9
|
+
/// <reference lib="es2020.string" />
|
|
10
|
+
/// <reference lib="es2020.symbol.wellknown" />
|
|
11
|
+
/// <reference lib="es2020.intl" />
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/// <reference lib="es2018.intl" />
|
|
4
|
+
declare namespace Intl {
|
|
5
|
+
/**
|
|
6
|
+
* [Unicode BCP 47 Locale Identifiers](https://unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers) definition.
|
|
7
|
+
*
|
|
8
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
|
|
9
|
+
*/
|
|
10
|
+
type UnicodeBCP47LocaleIdentifier = string;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Unit to use in the relative time internationalized message.
|
|
14
|
+
*
|
|
15
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/format#Parameters).
|
|
16
|
+
*/
|
|
17
|
+
type RelativeTimeFormatUnit =
|
|
18
|
+
| 'year'
|
|
19
|
+
| 'years'
|
|
20
|
+
| 'quarter'
|
|
21
|
+
| 'quarters'
|
|
22
|
+
| 'month'
|
|
23
|
+
| 'months'
|
|
24
|
+
| 'week'
|
|
25
|
+
| 'weeks'
|
|
26
|
+
| 'day'
|
|
27
|
+
| 'days'
|
|
28
|
+
| 'hour'
|
|
29
|
+
| 'hours'
|
|
30
|
+
| 'minute'
|
|
31
|
+
| 'minutes'
|
|
32
|
+
| 'second'
|
|
33
|
+
| 'seconds';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Value of the `unit` property in objects returned by
|
|
37
|
+
* `Intl.RelativeTimeFormat.prototype.formatToParts()`. `formatToParts` and
|
|
38
|
+
* `format` methods accept either singular or plural unit names as input,
|
|
39
|
+
* but `formatToParts` only outputs singular (e.g. "day") not plural (e.g.
|
|
40
|
+
* "days").
|
|
41
|
+
*
|
|
42
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).
|
|
43
|
+
*/
|
|
44
|
+
type RelativeTimeFormatUnitSingular =
|
|
45
|
+
| 'year'
|
|
46
|
+
| 'quarter'
|
|
47
|
+
| 'month'
|
|
48
|
+
| 'week'
|
|
49
|
+
| 'day'
|
|
50
|
+
| 'hour'
|
|
51
|
+
| 'minute'
|
|
52
|
+
| 'second';
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The locale matching algorithm to use.
|
|
56
|
+
*
|
|
57
|
+
* [MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation).
|
|
58
|
+
*/
|
|
59
|
+
type RelativeTimeFormatLocaleMatcher = 'lookup' | 'best fit';
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The format of output message.
|
|
63
|
+
*
|
|
64
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).
|
|
65
|
+
*/
|
|
66
|
+
type RelativeTimeFormatNumeric = 'always' | 'auto';
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The length of the internationalized message.
|
|
70
|
+
*
|
|
71
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).
|
|
72
|
+
*/
|
|
73
|
+
type RelativeTimeFormatStyle = 'long' | 'short' | 'narrow';
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* [BCP 47 language tag](http://tools.ietf.org/html/rfc5646) definition.
|
|
77
|
+
*
|
|
78
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
|
|
79
|
+
*/
|
|
80
|
+
type BCP47LanguageTag = string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The locale(s) to use
|
|
84
|
+
*
|
|
85
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
|
|
86
|
+
*/
|
|
87
|
+
type LocalesArgument =
|
|
88
|
+
| UnicodeBCP47LocaleIdentifier
|
|
89
|
+
| Locale
|
|
90
|
+
| readonly (UnicodeBCP47LocaleIdentifier | Locale)[]
|
|
91
|
+
| undefined;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* An object with some or all of properties of `options` parameter
|
|
95
|
+
* of `Intl.RelativeTimeFormat` constructor.
|
|
96
|
+
*
|
|
97
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters).
|
|
98
|
+
*/
|
|
99
|
+
interface RelativeTimeFormatOptions {
|
|
100
|
+
/** The locale matching algorithm to use. For information about this option, see [Intl page](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation). */
|
|
101
|
+
readonly localeMatcher?: RelativeTimeFormatLocaleMatcher;
|
|
102
|
+
/** The format of output message. */
|
|
103
|
+
readonly numeric?: RelativeTimeFormatNumeric;
|
|
104
|
+
/** The length of the internationalized message. */
|
|
105
|
+
readonly style?: RelativeTimeFormatStyle;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* An object with properties reflecting the locale
|
|
110
|
+
* and formatting options computed during initialization
|
|
111
|
+
* of the `Intl.RelativeTimeFormat` object
|
|
112
|
+
*
|
|
113
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions#Description).
|
|
114
|
+
*/
|
|
115
|
+
interface ResolvedRelativeTimeFormatOptions {
|
|
116
|
+
readonly locale: UnicodeBCP47LocaleIdentifier;
|
|
117
|
+
readonly style: RelativeTimeFormatStyle;
|
|
118
|
+
readonly numeric: RelativeTimeFormatNumeric;
|
|
119
|
+
readonly numberingSystem: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* An object representing the relative time format in parts
|
|
124
|
+
* that can be used for custom locale-aware formatting.
|
|
125
|
+
*
|
|
126
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts#Using_formatToParts).
|
|
127
|
+
*/
|
|
128
|
+
type RelativeTimeFormatPart =
|
|
129
|
+
| {
|
|
130
|
+
readonly type: 'literal';
|
|
131
|
+
readonly value: string;
|
|
132
|
+
}
|
|
133
|
+
| {
|
|
134
|
+
readonly type: Exclude<NumberFormatPartTypes, 'literal'>;
|
|
135
|
+
readonly value: string;
|
|
136
|
+
readonly unit: RelativeTimeFormatUnitSingular;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
interface RelativeTimeFormat {
|
|
140
|
+
/**
|
|
141
|
+
* Formats a value and a unit according to the locale
|
|
142
|
+
* and formatting options of the given
|
|
143
|
+
* [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat)
|
|
144
|
+
* object.
|
|
145
|
+
*
|
|
146
|
+
* While this method automatically provides the correct plural forms,
|
|
147
|
+
* the grammatical form is otherwise as neutral as possible.
|
|
148
|
+
*
|
|
149
|
+
* It is the caller's responsibility to handle cut-off logic
|
|
150
|
+
* such as deciding between displaying "in 7 days" or "in 1 week".
|
|
151
|
+
* This API does not support relative dates involving compound units.
|
|
152
|
+
* e.g "in 5 days and 4 hours".
|
|
153
|
+
*
|
|
154
|
+
* @param value - Numeric value to use in the internationalized relative time message
|
|
155
|
+
*
|
|
156
|
+
* @param unit - [Unit](https://tc39.es/ecma402/#sec-singularrelativetimeunit) to use in the relative time internationalized message.
|
|
157
|
+
*
|
|
158
|
+
* @throws `RangeError` if `unit` was given something other than `unit` possible values
|
|
159
|
+
*
|
|
160
|
+
* @returns {string} Internationalized relative time message as string
|
|
161
|
+
*
|
|
162
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/format).
|
|
163
|
+
*/
|
|
164
|
+
format(value: number, unit: RelativeTimeFormatUnit): string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Returns an array of objects representing the relative time format in parts that can be used for custom locale-aware formatting.
|
|
168
|
+
*
|
|
169
|
+
* @param value - Numeric value to use in the internationalized relative time message
|
|
170
|
+
*
|
|
171
|
+
* @param unit - [Unit](https://tc39.es/ecma402/#sec-singularrelativetimeunit) to use in the relative time internationalized message.
|
|
172
|
+
*
|
|
173
|
+
* @throws `RangeError` if `unit` was given something other than `unit` possible values
|
|
174
|
+
*
|
|
175
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/formatToParts).
|
|
176
|
+
*/
|
|
177
|
+
formatToParts(
|
|
178
|
+
value: number,
|
|
179
|
+
unit: RelativeTimeFormatUnit,
|
|
180
|
+
): RelativeTimeFormatPart[];
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Provides access to the locale and options computed during initialization of this `Intl.RelativeTimeFormat` object.
|
|
184
|
+
*
|
|
185
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/resolvedOptions).
|
|
186
|
+
*/
|
|
187
|
+
resolvedOptions(): ResolvedRelativeTimeFormatOptions;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* The [`Intl.RelativeTimeFormat`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat)
|
|
192
|
+
* object is a constructor for objects that enable language-sensitive relative time formatting.
|
|
193
|
+
*
|
|
194
|
+
* [Compatibility](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat#Browser_compatibility).
|
|
195
|
+
*/
|
|
196
|
+
const RelativeTimeFormat: {
|
|
197
|
+
/**
|
|
198
|
+
* Creates [Intl.RelativeTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat) objects
|
|
199
|
+
*
|
|
200
|
+
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
|
|
201
|
+
* For the general form and interpretation of the locales argument,
|
|
202
|
+
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
|
|
203
|
+
*
|
|
204
|
+
* @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters)
|
|
205
|
+
* with some or all of options of `RelativeTimeFormatOptions`.
|
|
206
|
+
*
|
|
207
|
+
* @returns [Intl.RelativeTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat) object.
|
|
208
|
+
*
|
|
209
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat).
|
|
210
|
+
*/
|
|
211
|
+
new (
|
|
212
|
+
locales?:
|
|
213
|
+
| UnicodeBCP47LocaleIdentifier
|
|
214
|
+
| readonly UnicodeBCP47LocaleIdentifier[],
|
|
215
|
+
options?: RelativeTimeFormatOptions,
|
|
216
|
+
): RelativeTimeFormat;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Returns an array containing those of the provided locales
|
|
220
|
+
* that are supported in date and time formatting
|
|
221
|
+
* without having to fall back to the runtime's default locale.
|
|
222
|
+
*
|
|
223
|
+
* @param locales - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646), or an array of such strings.
|
|
224
|
+
* For the general form and interpretation of the locales argument,
|
|
225
|
+
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
|
|
226
|
+
*
|
|
227
|
+
* @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat#Parameters)
|
|
228
|
+
* with some or all of options of the formatting.
|
|
229
|
+
*
|
|
230
|
+
* @returns An array containing those of the provided locales
|
|
231
|
+
* that are supported in date and time formatting
|
|
232
|
+
* without having to fall back to the runtime's default locale.
|
|
233
|
+
*
|
|
234
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/supportedLocalesOf).
|
|
235
|
+
*/
|
|
236
|
+
supportedLocalesOf(
|
|
237
|
+
locales?:
|
|
238
|
+
| UnicodeBCP47LocaleIdentifier
|
|
239
|
+
| readonly UnicodeBCP47LocaleIdentifier[],
|
|
240
|
+
options?: RelativeTimeFormatOptions,
|
|
241
|
+
): UnicodeBCP47LocaleIdentifier[];
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
interface NumberFormatOptions {
|
|
245
|
+
readonly compactDisplay?: 'short' | 'long' | undefined;
|
|
246
|
+
readonly notation?:
|
|
247
|
+
| 'standard'
|
|
248
|
+
| 'scientific'
|
|
249
|
+
| 'engineering'
|
|
250
|
+
| 'compact'
|
|
251
|
+
| undefined;
|
|
252
|
+
readonly signDisplay?:
|
|
253
|
+
| 'auto'
|
|
254
|
+
| 'never'
|
|
255
|
+
| 'always'
|
|
256
|
+
| 'exceptZero'
|
|
257
|
+
| undefined;
|
|
258
|
+
readonly unit?: string | undefined;
|
|
259
|
+
readonly unitDisplay?: 'short' | 'long' | 'narrow' | undefined;
|
|
260
|
+
readonly currencyDisplay?: string | undefined;
|
|
261
|
+
readonly currencySign?: string | undefined;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
interface ResolvedNumberFormatOptions {
|
|
265
|
+
readonly compactDisplay?: 'short' | 'long';
|
|
266
|
+
readonly notation?: 'standard' | 'scientific' | 'engineering' | 'compact';
|
|
267
|
+
readonly signDisplay?: 'auto' | 'never' | 'always' | 'exceptZero';
|
|
268
|
+
readonly unit?: string;
|
|
269
|
+
readonly unitDisplay?: 'short' | 'long' | 'narrow';
|
|
270
|
+
readonly currencyDisplay?: string;
|
|
271
|
+
readonly currencySign?: string;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
interface DateTimeFormatOptions {
|
|
275
|
+
readonly calendar?: string | undefined;
|
|
276
|
+
readonly dayPeriod?: 'narrow' | 'short' | 'long' | undefined;
|
|
277
|
+
readonly numberingSystem?: string | undefined;
|
|
278
|
+
|
|
279
|
+
readonly dateStyle?: 'full' | 'long' | 'medium' | 'short' | undefined;
|
|
280
|
+
readonly timeStyle?: 'full' | 'long' | 'medium' | 'short' | undefined;
|
|
281
|
+
readonly hourCycle?: 'h11' | 'h12' | 'h23' | 'h24' | undefined;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
type LocaleHourCycleKey = 'h12' | 'h23' | 'h11' | 'h24';
|
|
285
|
+
type LocaleCollationCaseFirst = 'upper' | 'lower' | 'false';
|
|
286
|
+
|
|
287
|
+
interface LocaleOptions {
|
|
288
|
+
/** A string containing the language, and the script and region if available. */
|
|
289
|
+
readonly baseName?: string;
|
|
290
|
+
/** The part of the Locale that indicates the locale's calendar era. */
|
|
291
|
+
readonly calendar?: string;
|
|
292
|
+
/** Flag that defines whether case is taken into account for the locale's collation rules. */
|
|
293
|
+
readonly caseFirst?: LocaleCollationCaseFirst;
|
|
294
|
+
/** The collation type used for sorting */
|
|
295
|
+
readonly collation?: string;
|
|
296
|
+
/** The time keeping format convention used by the locale. */
|
|
297
|
+
readonly hourCycle?: LocaleHourCycleKey;
|
|
298
|
+
/** The primary language subtag associated with the locale. */
|
|
299
|
+
readonly language?: string;
|
|
300
|
+
/** The numeral system used by the locale. */
|
|
301
|
+
readonly numberingSystem?: string;
|
|
302
|
+
/** Flag that defines whether the locale has special collation handling for numeric characters. */
|
|
303
|
+
readonly numeric?: boolean;
|
|
304
|
+
/** The region of the world (usually a country) associated with the locale. Possible values are region codes as defined by ISO 3166-1. */
|
|
305
|
+
readonly region?: string;
|
|
306
|
+
/** The script used for writing the particular language used in the locale. Possible values are script codes as defined by ISO 15924. */
|
|
307
|
+
readonly script?: string;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
interface Locale extends LocaleOptions {
|
|
311
|
+
/** A string containing the language, and the script and region if available. */
|
|
312
|
+
readonly baseName: string;
|
|
313
|
+
/** The primary language subtag associated with the locale. */
|
|
314
|
+
readonly language: string;
|
|
315
|
+
/** Gets the most likely values for the language, script, and region of the locale based on existing values. */
|
|
316
|
+
maximize(): Locale;
|
|
317
|
+
/** Attempts to remove information about the locale that would be added by calling `Locale.maximize()`. */
|
|
318
|
+
minimize(): Locale;
|
|
319
|
+
/** Returns the locale's full locale identifier string. */
|
|
320
|
+
toString(): BCP47LanguageTag;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Constructor creates [Intl.Locale](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale)
|
|
325
|
+
* objects
|
|
326
|
+
*
|
|
327
|
+
* @param tag - A string with a [BCP 47 language tag](http://tools.ietf.org/html/rfc5646).
|
|
328
|
+
* For the general form and interpretation of the locales argument,
|
|
329
|
+
* see the [`Intl` page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
|
|
330
|
+
*
|
|
331
|
+
* @param options - An [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/Locale#Parameters) with some or all of options of the locale.
|
|
332
|
+
*
|
|
333
|
+
* @returns [Intl.Locale](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale) object.
|
|
334
|
+
*
|
|
335
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale).
|
|
336
|
+
*/
|
|
337
|
+
const Locale: {
|
|
338
|
+
new (tag: BCP47LanguageTag | Locale, options?: LocaleOptions): Locale;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
type DisplayNamesFallback = 'code' | 'none';
|
|
342
|
+
|
|
343
|
+
type DisplayNamesType =
|
|
344
|
+
| 'language'
|
|
345
|
+
| 'region'
|
|
346
|
+
| 'script'
|
|
347
|
+
| 'calendar'
|
|
348
|
+
| 'dateTimeField'
|
|
349
|
+
| 'currency';
|
|
350
|
+
|
|
351
|
+
type DisplayNamesLanguageDisplay = 'dialect' | 'standard';
|
|
352
|
+
|
|
353
|
+
interface DisplayNamesOptions {
|
|
354
|
+
readonly localeMatcher?: RelativeTimeFormatLocaleMatcher;
|
|
355
|
+
readonly style?: RelativeTimeFormatStyle;
|
|
356
|
+
readonly type: DisplayNamesType;
|
|
357
|
+
readonly languageDisplay?: DisplayNamesLanguageDisplay;
|
|
358
|
+
readonly fallback?: DisplayNamesFallback;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
interface ResolvedDisplayNamesOptions {
|
|
362
|
+
readonly locale: UnicodeBCP47LocaleIdentifier;
|
|
363
|
+
readonly style: RelativeTimeFormatStyle;
|
|
364
|
+
readonly type: DisplayNamesType;
|
|
365
|
+
readonly fallback: DisplayNamesFallback;
|
|
366
|
+
readonly languageDisplay?: DisplayNamesLanguageDisplay;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
interface DisplayNames {
|
|
370
|
+
/**
|
|
371
|
+
* Receives a code and returns a string based on the locale and options provided when instantiating
|
|
372
|
+
* [`Intl.DisplayNames()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
|
|
373
|
+
*
|
|
374
|
+
* @param code The `code` to provide depends on the `type` passed to display name during creation:
|
|
375
|
+
* - If the type is `"region"`, code should be either an [ISO-3166 two letters region code](https://www.iso.org/iso-3166-country-codes.html),
|
|
376
|
+
* or a [three digits UN M49 Geographic Regions](https://unstats.un.org/unsd/methodology/m49/).
|
|
377
|
+
* - If the type is `"script"`, code should be an [ISO-15924 four letters script code](https://unicode.org/iso15924/iso15924-codes.html).
|
|
378
|
+
* - If the type is `"language"`, code should be a `languageCode` ["-" `scriptCode`] ["-" `regionCode` ] *("-" `variant` )
|
|
379
|
+
* subsequence of the unicode_language_id grammar in [UTS 35's Unicode Language and Locale Identifiers grammar](https://unicode.org/reports/tr35/#Unicode_language_identifier).
|
|
380
|
+
* `languageCode` is either a two letters ISO 639-1 language code or a three letters ISO 639-2 language code.
|
|
381
|
+
* - If the type is `"currency"`, code should be a [3-letter ISO 4217 currency code](https://www.iso.org/iso-4217-currency-codes.html).
|
|
382
|
+
*
|
|
383
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/of).
|
|
384
|
+
*/
|
|
385
|
+
of(code: string): string | undefined;
|
|
386
|
+
/**
|
|
387
|
+
* Returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current
|
|
388
|
+
* [`Intl/DisplayNames`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames) object.
|
|
389
|
+
*
|
|
390
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/resolvedOptions).
|
|
391
|
+
*/
|
|
392
|
+
resolvedOptions(): ResolvedDisplayNamesOptions;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* The [`Intl.DisplayNames()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames)
|
|
397
|
+
* object enables the consistent translation of language, region and script display names.
|
|
398
|
+
*
|
|
399
|
+
* [Compatibility](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames#browser_compatibility).
|
|
400
|
+
*/
|
|
401
|
+
const DisplayNames: {
|
|
402
|
+
readonly prototype: DisplayNames;
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* @param locales A string with a BCP 47 language tag, or an array of such strings.
|
|
406
|
+
* For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)
|
|
407
|
+
* page.
|
|
408
|
+
*
|
|
409
|
+
* @param options An object for setting up a display name.
|
|
410
|
+
*
|
|
411
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames).
|
|
412
|
+
*/
|
|
413
|
+
new (locales: LocalesArgument, options: DisplayNamesOptions): DisplayNames;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* 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.
|
|
417
|
+
*
|
|
418
|
+
* @param locales A string with a BCP 47 language tag, or an array of such strings.
|
|
419
|
+
* For the general form and interpretation of the `locales` argument, see the [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)
|
|
420
|
+
* page.
|
|
421
|
+
*
|
|
422
|
+
* @param options An object with a locale matcher.
|
|
423
|
+
*
|
|
424
|
+
* @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.
|
|
425
|
+
*
|
|
426
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/supportedLocalesOf).
|
|
427
|
+
*/
|
|
428
|
+
supportedLocalesOf(
|
|
429
|
+
locales?: LocalesArgument,
|
|
430
|
+
options?: { readonly localeMatcher?: RelativeTimeFormatLocaleMatcher },
|
|
431
|
+
): BCP47LanguageTag[];
|
|
432
|
+
};
|
|
433
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/// <reference lib="es2020.intl" />
|
|
4
|
+
|
|
5
|
+
interface Number {
|
|
6
|
+
/**
|
|
7
|
+
* Converts a number to a string by using the current or specified locale.
|
|
8
|
+
* @param locales A locale string, array of locale strings, Intl.Locale object, or array of Intl.Locale objects that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used.
|
|
9
|
+
* @param options An object that contains one or more properties that specify comparison options.
|
|
10
|
+
*/
|
|
11
|
+
toLocaleString(
|
|
12
|
+
locales?: Intl.LocalesArgument,
|
|
13
|
+
options?: Intl.NumberFormatOptions,
|
|
14
|
+
): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
interface PromiseFulfilledResult<T> {
|
|
4
|
+
readonly status: 'fulfilled';
|
|
5
|
+
readonly value: T;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface PromiseRejectedResult {
|
|
9
|
+
readonly status: 'rejected';
|
|
10
|
+
readonly reason: unknown;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type PromiseSettledResult<T> =
|
|
14
|
+
| PromiseFulfilledResult<T>
|
|
15
|
+
| PromiseRejectedResult;
|
|
16
|
+
|
|
17
|
+
interface PromiseConstructor {
|
|
18
|
+
/**
|
|
19
|
+
* Creates a Promise that is resolved with an array of results when all
|
|
20
|
+
* of the provided Promises resolve or reject.
|
|
21
|
+
* @param values An array of Promises.
|
|
22
|
+
* @returns A new Promise.
|
|
23
|
+
*/
|
|
24
|
+
allSettled<T extends readonly unknown[] | readonly []>(
|
|
25
|
+
values: T,
|
|
26
|
+
): Promise<{ -readonly [P in keyof T]: PromiseSettledResult<Awaited<T[P]>> }>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Creates a Promise that is resolved with an array of results when all
|
|
30
|
+
* of the provided Promises resolve or reject.
|
|
31
|
+
* @param values An array of Promises.
|
|
32
|
+
* @returns A new Promise.
|
|
33
|
+
*/
|
|
34
|
+
allSettled<T>(
|
|
35
|
+
values: Iterable<T | PromiseLike<T>>,
|
|
36
|
+
): Promise<PromiseSettledResult<Awaited<T>>[]>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
interface Atomics {
|
|
4
|
+
/**
|
|
5
|
+
* Adds a value to the value at the given position in the array, returning the original value.
|
|
6
|
+
* Until this atomic operation completes, any other read or write operation against the array
|
|
7
|
+
* will block.
|
|
8
|
+
*/
|
|
9
|
+
add(
|
|
10
|
+
typedArray: BigInt64Array | BigUint64Array,
|
|
11
|
+
index: number,
|
|
12
|
+
value: bigint,
|
|
13
|
+
): bigint;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Stores the bitwise AND of a value with the value at the given position in the array,
|
|
17
|
+
* returning the original value. Until this atomic operation completes, any other read or
|
|
18
|
+
* write operation against the array will block.
|
|
19
|
+
*/
|
|
20
|
+
and(
|
|
21
|
+
typedArray: BigInt64Array | BigUint64Array,
|
|
22
|
+
index: number,
|
|
23
|
+
value: bigint,
|
|
24
|
+
): bigint;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Replaces the value at the given position in the array if the original value equals the given
|
|
28
|
+
* expected value, returning the original value. Until this atomic operation completes, any
|
|
29
|
+
* other read or write operation against the array will block.
|
|
30
|
+
*/
|
|
31
|
+
compareExchange(
|
|
32
|
+
typedArray: BigInt64Array | BigUint64Array,
|
|
33
|
+
index: number,
|
|
34
|
+
expectedValue: bigint,
|
|
35
|
+
replacementValue: bigint,
|
|
36
|
+
): bigint;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Replaces the value at the given position in the array, returning the original value. Until
|
|
40
|
+
* this atomic operation completes, any other read or write operation against the array will
|
|
41
|
+
* block.
|
|
42
|
+
*/
|
|
43
|
+
exchange(
|
|
44
|
+
typedArray: BigInt64Array | BigUint64Array,
|
|
45
|
+
index: number,
|
|
46
|
+
value: bigint,
|
|
47
|
+
): bigint;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Returns the value at the given position in the array. Until this atomic operation completes,
|
|
51
|
+
* any other read or write operation against the array will block.
|
|
52
|
+
*/
|
|
53
|
+
load(typedArray: BigInt64Array | BigUint64Array, index: number): bigint;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Stores the bitwise OR of a value with the value at the given position in the array,
|
|
57
|
+
* returning the original value. Until this atomic operation completes, any other read or write
|
|
58
|
+
* operation against the array will block.
|
|
59
|
+
*/
|
|
60
|
+
or(
|
|
61
|
+
typedArray: BigInt64Array | BigUint64Array,
|
|
62
|
+
index: number,
|
|
63
|
+
value: bigint,
|
|
64
|
+
): bigint;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Stores a value at the given position in the array, returning the new value. Until this
|
|
68
|
+
* atomic operation completes, any other read or write operation against the array will block.
|
|
69
|
+
*/
|
|
70
|
+
store(
|
|
71
|
+
typedArray: BigInt64Array | BigUint64Array,
|
|
72
|
+
index: number,
|
|
73
|
+
value: bigint,
|
|
74
|
+
): bigint;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Subtracts a value from the value at the given position in the array, returning the original
|
|
78
|
+
* value. Until this atomic operation completes, any other read or write operation against the
|
|
79
|
+
* array will block.
|
|
80
|
+
*/
|
|
81
|
+
sub(
|
|
82
|
+
typedArray: BigInt64Array | BigUint64Array,
|
|
83
|
+
index: number,
|
|
84
|
+
value: bigint,
|
|
85
|
+
): bigint;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* If the value at the given position in the array is equal to the provided value, the current
|
|
89
|
+
* agent is put to sleep causing execution to suspend until the timeout expires (returning
|
|
90
|
+
* `"timed-out"`) or until the agent is awoken (returning `"ok"`); otherwise, returns
|
|
91
|
+
* `"not-equal"`.
|
|
92
|
+
*/
|
|
93
|
+
wait(
|
|
94
|
+
typedArray: BigInt64Array,
|
|
95
|
+
index: number,
|
|
96
|
+
value: bigint,
|
|
97
|
+
timeout?: number,
|
|
98
|
+
): 'ok' | 'not-equal' | 'timed-out';
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Wakes up sleeping agents that are waiting on the given index of the array, returning the
|
|
102
|
+
* number of agents that were awoken.
|
|
103
|
+
* @param typedArray A shared BigInt64Array.
|
|
104
|
+
* @param index The position in the typedArray to wake up on.
|
|
105
|
+
* @param count The number of sleeping agents to notify. Defaults to +Infinity.
|
|
106
|
+
*/
|
|
107
|
+
notify(typedArray: BigInt64Array, index: number, count?: number): number;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Stores the bitwise XOR of a value with the value at the given position in the array,
|
|
111
|
+
* returning the original value. Until this atomic operation completes, any other read or write
|
|
112
|
+
* operation against the array will block.
|
|
113
|
+
*/
|
|
114
|
+
xor(
|
|
115
|
+
typedArray: BigInt64Array | BigUint64Array,
|
|
116
|
+
index: number,
|
|
117
|
+
value: bigint,
|
|
118
|
+
): bigint;
|
|
119
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference no-default-lib="true"/>
|
|
2
|
+
|
|
3
|
+
/// <reference lib="es2015.iterable" />
|
|
4
|
+
|
|
5
|
+
interface String {
|
|
6
|
+
/**
|
|
7
|
+
* Matches a string with a regular expression, and returns an iterable of matches
|
|
8
|
+
* containing the results of that search.
|
|
9
|
+
* @param regexp A variable name or string literal containing the regular expression pattern and flags.
|
|
10
|
+
*/
|
|
11
|
+
matchAll(regexp: RegExp): IterableIterator<RegExpMatchArray>;
|
|
12
|
+
}
|