strict-ts-lib-v6.0 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/libs/es2015/core/index.d.ts +2 -2
- package/libs/es2018/intl/index.d.ts +21 -12
- package/libs/es2020/bigint/index.d.ts +29 -8
- package/libs/es5/index.d.ts +32 -19
- package/libs-branded/es2015/core/index.d.ts +2 -2
- package/libs-branded/es2018/intl/index.d.ts +21 -12
- package/libs-branded/es2020/bigint/index.d.ts +29 -8
- package/libs-branded/es5/index.d.ts +32 -19
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# strict-ts-lib-v6.0
|
|
2
2
|
|
|
3
|
+
## 0.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 68452d4: Allow `0` as `toExponential`'s `fractionDigits`: the parameter type becomes `UintRangeInclusive<0, 100>`. ECMA-262 accepts 0–100 — `(1).toExponential(0)` is legal and returns `'1e+0'` — so the previous lower bound of 1 rejected a valid call.
|
|
8
|
+
|
|
9
|
+
## 0.6.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- c5853e4: Spell numeric argument ranges with `UintRangeInclusive` instead of `UintRange`: `toFixed(fractionDigits?: UintRangeInclusive<0, 100>)` now names its bounds the way the docs do ("0 – 100, inclusive") rather than with an exclusive upper bound (`UintRange<0, 101>`). Applied to every converted range — `toString` radix, `toPrecision`, JSON `space`, `BigInt.asIntN/asUintN` bits, and the `Intl` digit options. The expanded literal-union types are unchanged; this is purely a notation change in the emitted declarations.
|
|
14
|
+
|
|
3
15
|
## 0.6.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -100,7 +100,7 @@ interface Math {
|
|
|
100
100
|
* Returns the number of leading zero bits in the 32-bit binary representation of a number.
|
|
101
101
|
* @param x A numeric expression.
|
|
102
102
|
*/
|
|
103
|
-
clz32(x: number): import('ts-type-forge').
|
|
103
|
+
clz32(x: number): import('ts-type-forge').UintRangeInclusive<0, 32>;
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* Returns the result of 32-bit multiplication of two numbers.
|
|
@@ -273,7 +273,7 @@ interface NumberConstructor {
|
|
|
273
273
|
*/
|
|
274
274
|
parseInt(
|
|
275
275
|
string: string,
|
|
276
|
-
radix?: import('ts-type-forge').
|
|
276
|
+
radix?: import('ts-type-forge').UintRangeInclusive<2, 36>,
|
|
277
277
|
): number;
|
|
278
278
|
}
|
|
279
279
|
|
|
@@ -7,19 +7,19 @@ declare namespace Intl {
|
|
|
7
7
|
readonly localeMatcher?: 'lookup' | 'best fit' | undefined;
|
|
8
8
|
readonly type?: PluralRuleType | undefined;
|
|
9
9
|
readonly minimumIntegerDigits?:
|
|
10
|
-
| import('ts-type-forge').
|
|
10
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
11
11
|
| undefined;
|
|
12
12
|
readonly minimumFractionDigits?:
|
|
13
|
-
| import('ts-type-forge').
|
|
13
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
14
14
|
| undefined;
|
|
15
15
|
readonly maximumFractionDigits?:
|
|
16
|
-
| import('ts-type-forge').
|
|
16
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
17
17
|
| undefined;
|
|
18
18
|
readonly minimumSignificantDigits?:
|
|
19
|
-
| import('ts-type-forge').
|
|
19
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
20
20
|
| undefined;
|
|
21
21
|
readonly maximumSignificantDigits?:
|
|
22
|
-
| import('ts-type-forge').
|
|
22
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
23
23
|
| undefined;
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -27,16 +27,25 @@ declare namespace Intl {
|
|
|
27
27
|
readonly locale: string;
|
|
28
28
|
readonly pluralCategories: readonly LDMLPluralRule[];
|
|
29
29
|
readonly type: PluralRuleType;
|
|
30
|
-
readonly minimumIntegerDigits: import('ts-type-forge').
|
|
31
|
-
readonly minimumFractionDigits: import('ts-type-forge').UintRange<0, 21>;
|
|
32
|
-
readonly maximumFractionDigits: import('ts-type-forge').UintRange<0, 21>;
|
|
33
|
-
readonly minimumSignificantDigits?: import('ts-type-forge').UintRange<
|
|
30
|
+
readonly minimumIntegerDigits: import('ts-type-forge').UintRangeInclusive<
|
|
34
31
|
1,
|
|
35
|
-
|
|
32
|
+
21
|
|
36
33
|
>;
|
|
37
|
-
readonly
|
|
34
|
+
readonly minimumFractionDigits: import('ts-type-forge').UintRangeInclusive<
|
|
35
|
+
0,
|
|
36
|
+
20
|
|
37
|
+
>;
|
|
38
|
+
readonly maximumFractionDigits: import('ts-type-forge').UintRangeInclusive<
|
|
39
|
+
0,
|
|
40
|
+
20
|
|
41
|
+
>;
|
|
42
|
+
readonly minimumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
43
|
+
1,
|
|
44
|
+
21
|
|
45
|
+
>;
|
|
46
|
+
readonly maximumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
38
47
|
1,
|
|
39
|
-
|
|
48
|
+
21
|
|
40
49
|
>;
|
|
41
50
|
}
|
|
42
51
|
|
|
@@ -45,27 +45,42 @@ interface BigIntToLocaleStringOptions {
|
|
|
45
45
|
/**
|
|
46
46
|
* The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1.
|
|
47
47
|
*/
|
|
48
|
-
readonly minimumIntegerDigits?: import('ts-type-forge').
|
|
48
|
+
readonly minimumIntegerDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
49
|
+
1,
|
|
50
|
+
21
|
|
51
|
+
>;
|
|
49
52
|
|
|
50
53
|
/**
|
|
51
54
|
* The minimum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number and percent formatting is 0; the default for currency formatting is the number of minor unit digits provided by the {@link http://www.currency-iso.org/en/home/tables/table-a1.html ISO 4217 currency codes list} (2 if the list doesn't provide that information).
|
|
52
55
|
*/
|
|
53
|
-
readonly minimumFractionDigits?: import('ts-type-forge').
|
|
56
|
+
readonly minimumFractionDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
57
|
+
0,
|
|
58
|
+
20
|
|
59
|
+
>;
|
|
54
60
|
|
|
55
61
|
/**
|
|
56
62
|
* The maximum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number formatting is the larger of minimumFractionDigits and 3; the default for currency formatting is the larger of minimumFractionDigits and the number of minor unit digits provided by the {@link http://www.currency-iso.org/en/home/tables/table-a1.html ISO 4217 currency codes list} (2 if the list doesn't provide that information); the default for percent formatting is the larger of minimumFractionDigits and 0.
|
|
57
63
|
*/
|
|
58
|
-
readonly maximumFractionDigits?: import('ts-type-forge').
|
|
64
|
+
readonly maximumFractionDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
65
|
+
0,
|
|
66
|
+
20
|
|
67
|
+
>;
|
|
59
68
|
|
|
60
69
|
/**
|
|
61
70
|
* The minimum number of significant digits to use. Possible values are from 1 to 21; the default is 1.
|
|
62
71
|
*/
|
|
63
|
-
readonly minimumSignificantDigits?: import('ts-type-forge').
|
|
72
|
+
readonly minimumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
73
|
+
1,
|
|
74
|
+
21
|
|
75
|
+
>;
|
|
64
76
|
|
|
65
77
|
/**
|
|
66
78
|
* The maximum number of significant digits to use. Possible values are from 1 to 21; the default is 21.
|
|
67
79
|
*/
|
|
68
|
-
readonly maximumSignificantDigits?: import('ts-type-forge').
|
|
80
|
+
readonly maximumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
81
|
+
1,
|
|
82
|
+
21
|
|
83
|
+
>;
|
|
69
84
|
|
|
70
85
|
/**
|
|
71
86
|
* The formatting that should be displayed for the number, the defaults is "standard"
|
|
@@ -91,7 +106,7 @@ interface BigInt {
|
|
|
91
106
|
* Returns a string representation of an object.
|
|
92
107
|
* @param radix Specifies a radix for converting numeric values to strings.
|
|
93
108
|
*/
|
|
94
|
-
toString(radix?: import('ts-type-forge').
|
|
109
|
+
toString(radix?: import('ts-type-forge').UintRangeInclusive<2, 36>): string;
|
|
95
110
|
|
|
96
111
|
/** Returns a string representation appropriate to the host environment's current locale. */
|
|
97
112
|
toLocaleString(
|
|
@@ -115,14 +130,20 @@ interface BigIntConstructor {
|
|
|
115
130
|
* @param bits The number of low bits to use
|
|
116
131
|
* @param int The BigInt whose bits to extract
|
|
117
132
|
*/
|
|
118
|
-
asIntN(
|
|
133
|
+
asIntN(
|
|
134
|
+
bits: import('ts-type-forge').UintRangeInclusive<0, 64>,
|
|
135
|
+
int: bigint,
|
|
136
|
+
): bigint;
|
|
119
137
|
/**
|
|
120
138
|
* Interprets the low bits of a BigInt as an unsigned integer.
|
|
121
139
|
* All higher bits are discarded.
|
|
122
140
|
* @param bits The number of low bits to use
|
|
123
141
|
* @param int The BigInt whose bits to extract
|
|
124
142
|
*/
|
|
125
|
-
asUintN(
|
|
143
|
+
asUintN(
|
|
144
|
+
bits: import('ts-type-forge').UintRangeInclusive<0, 64>,
|
|
145
|
+
int: bigint,
|
|
146
|
+
): bigint;
|
|
126
147
|
}
|
|
127
148
|
|
|
128
149
|
declare const BigInt: BigIntConstructor;
|
package/libs/es5/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare function eval(x: string): unknown;
|
|
|
24
24
|
*/
|
|
25
25
|
declare function parseInt(
|
|
26
26
|
string: string,
|
|
27
|
-
radix?: import('ts-type-forge').
|
|
27
|
+
radix?: import('ts-type-forge').UintRangeInclusive<2, 36>,
|
|
28
28
|
): number;
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -630,27 +630,31 @@ interface Number {
|
|
|
630
630
|
* Returns a string representation of an object.
|
|
631
631
|
* @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.
|
|
632
632
|
*/
|
|
633
|
-
toString(radix?: import('ts-type-forge').
|
|
633
|
+
toString(radix?: import('ts-type-forge').UintRangeInclusive<2, 36>): string;
|
|
634
634
|
|
|
635
635
|
/**
|
|
636
636
|
* Returns a string representing a number in fixed-point notation.
|
|
637
637
|
* @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
|
|
638
638
|
*/
|
|
639
|
-
toFixed(
|
|
639
|
+
toFixed(
|
|
640
|
+
fractionDigits?: import('ts-type-forge').UintRangeInclusive<0, 100>,
|
|
641
|
+
): string;
|
|
640
642
|
|
|
641
643
|
/**
|
|
642
644
|
* Returns a string containing a number represented in exponential notation.
|
|
643
645
|
* @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
|
|
644
646
|
*/
|
|
645
647
|
toExponential(
|
|
646
|
-
fractionDigits?: import('ts-type-forge').
|
|
648
|
+
fractionDigits?: import('ts-type-forge').UintRangeInclusive<0, 100>,
|
|
647
649
|
): string;
|
|
648
650
|
|
|
649
651
|
/**
|
|
650
652
|
* Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.
|
|
651
653
|
* @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
|
|
652
654
|
*/
|
|
653
|
-
toPrecision(
|
|
655
|
+
toPrecision(
|
|
656
|
+
precision?: import('ts-type-forge').UintRangeInclusive<1, 100>,
|
|
657
|
+
): string;
|
|
654
658
|
|
|
655
659
|
/** Returns the primitive value of the specified object. */
|
|
656
660
|
valueOf(): number;
|
|
@@ -1256,7 +1260,7 @@ interface JSON {
|
|
|
1256
1260
|
stringify(
|
|
1257
1261
|
value: unknown,
|
|
1258
1262
|
replacer?: (this: unknown, key: string, value: unknown) => unknown,
|
|
1259
|
-
space?: string | import('ts-type-forge').
|
|
1263
|
+
space?: string | import('ts-type-forge').UintRangeInclusive<1, 10>,
|
|
1260
1264
|
): string;
|
|
1261
1265
|
/**
|
|
1262
1266
|
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
|
@@ -1268,7 +1272,7 @@ interface JSON {
|
|
|
1268
1272
|
stringify(
|
|
1269
1273
|
value: unknown,
|
|
1270
1274
|
replacer?: readonly (number | string)[] | null,
|
|
1271
|
-
space?: string | import('ts-type-forge').
|
|
1275
|
+
space?: string | import('ts-type-forge').UintRangeInclusive<1, 10>,
|
|
1272
1276
|
): string;
|
|
1273
1277
|
}
|
|
1274
1278
|
|
|
@@ -5651,19 +5655,19 @@ declare namespace Intl {
|
|
|
5651
5655
|
readonly currencyDisplay?: NumberFormatOptionsCurrencyDisplay | undefined;
|
|
5652
5656
|
readonly useGrouping?: NumberFormatOptionsUseGrouping | undefined;
|
|
5653
5657
|
readonly minimumIntegerDigits?:
|
|
5654
|
-
| import('ts-type-forge').
|
|
5658
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
5655
5659
|
| undefined;
|
|
5656
5660
|
readonly minimumFractionDigits?:
|
|
5657
|
-
| import('ts-type-forge').
|
|
5661
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
5658
5662
|
| undefined;
|
|
5659
5663
|
readonly maximumFractionDigits?:
|
|
5660
|
-
| import('ts-type-forge').
|
|
5664
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
5661
5665
|
| undefined;
|
|
5662
5666
|
readonly minimumSignificantDigits?:
|
|
5663
|
-
| import('ts-type-forge').
|
|
5667
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
5664
5668
|
| undefined;
|
|
5665
5669
|
readonly maximumSignificantDigits?:
|
|
5666
|
-
| import('ts-type-forge').
|
|
5670
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
5667
5671
|
| undefined;
|
|
5668
5672
|
}
|
|
5669
5673
|
|
|
@@ -5673,16 +5677,25 @@ declare namespace Intl {
|
|
|
5673
5677
|
readonly style: NumberFormatOptionsStyle;
|
|
5674
5678
|
readonly currency?: string;
|
|
5675
5679
|
readonly currencyDisplay?: NumberFormatOptionsCurrencyDisplay;
|
|
5676
|
-
readonly minimumIntegerDigits: import('ts-type-forge').
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
+
readonly minimumIntegerDigits: import('ts-type-forge').UintRangeInclusive<
|
|
5681
|
+
1,
|
|
5682
|
+
21
|
|
5683
|
+
>;
|
|
5684
|
+
readonly minimumFractionDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
5685
|
+
0,
|
|
5686
|
+
20
|
|
5687
|
+
>;
|
|
5688
|
+
readonly maximumFractionDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
5689
|
+
0,
|
|
5690
|
+
20
|
|
5691
|
+
>;
|
|
5692
|
+
readonly minimumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
5680
5693
|
1,
|
|
5681
|
-
|
|
5694
|
+
21
|
|
5682
5695
|
>;
|
|
5683
|
-
readonly maximumSignificantDigits?: import('ts-type-forge').
|
|
5696
|
+
readonly maximumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
5684
5697
|
1,
|
|
5685
|
-
|
|
5698
|
+
21
|
|
5686
5699
|
>;
|
|
5687
5700
|
readonly useGrouping: ResolvedNumberFormatOptionsUseGrouping;
|
|
5688
5701
|
}
|
|
@@ -120,7 +120,7 @@ interface Math {
|
|
|
120
120
|
* Returns the number of leading zero bits in the 32-bit binary representation of a number.
|
|
121
121
|
* @param x A numeric expression.
|
|
122
122
|
*/
|
|
123
|
-
clz32(x: number): import('ts-type-forge').
|
|
123
|
+
clz32(x: number): import('ts-type-forge').UintRangeInclusive<0, 32>;
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
126
|
* Returns the result of 32-bit multiplication of two numbers.
|
|
@@ -313,7 +313,7 @@ interface NumberConstructor {
|
|
|
313
313
|
*/
|
|
314
314
|
parseInt(
|
|
315
315
|
string: string,
|
|
316
|
-
radix?: import('ts-type-forge').
|
|
316
|
+
radix?: import('ts-type-forge').UintRangeInclusive<2, 36>,
|
|
317
317
|
): import('ts-type-forge').Int | import('ts-type-forge').NaNType;
|
|
318
318
|
}
|
|
319
319
|
|
|
@@ -7,19 +7,19 @@ declare namespace Intl {
|
|
|
7
7
|
readonly localeMatcher?: 'lookup' | 'best fit' | undefined;
|
|
8
8
|
readonly type?: PluralRuleType | undefined;
|
|
9
9
|
readonly minimumIntegerDigits?:
|
|
10
|
-
| import('ts-type-forge').
|
|
10
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
11
11
|
| undefined;
|
|
12
12
|
readonly minimumFractionDigits?:
|
|
13
|
-
| import('ts-type-forge').
|
|
13
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
14
14
|
| undefined;
|
|
15
15
|
readonly maximumFractionDigits?:
|
|
16
|
-
| import('ts-type-forge').
|
|
16
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
17
17
|
| undefined;
|
|
18
18
|
readonly minimumSignificantDigits?:
|
|
19
|
-
| import('ts-type-forge').
|
|
19
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
20
20
|
| undefined;
|
|
21
21
|
readonly maximumSignificantDigits?:
|
|
22
|
-
| import('ts-type-forge').
|
|
22
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
23
23
|
| undefined;
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -27,16 +27,25 @@ declare namespace Intl {
|
|
|
27
27
|
readonly locale: string;
|
|
28
28
|
readonly pluralCategories: readonly LDMLPluralRule[];
|
|
29
29
|
readonly type: PluralRuleType;
|
|
30
|
-
readonly minimumIntegerDigits: import('ts-type-forge').
|
|
31
|
-
readonly minimumFractionDigits: import('ts-type-forge').UintRange<0, 21>;
|
|
32
|
-
readonly maximumFractionDigits: import('ts-type-forge').UintRange<0, 21>;
|
|
33
|
-
readonly minimumSignificantDigits?: import('ts-type-forge').UintRange<
|
|
30
|
+
readonly minimumIntegerDigits: import('ts-type-forge').UintRangeInclusive<
|
|
34
31
|
1,
|
|
35
|
-
|
|
32
|
+
21
|
|
36
33
|
>;
|
|
37
|
-
readonly
|
|
34
|
+
readonly minimumFractionDigits: import('ts-type-forge').UintRangeInclusive<
|
|
35
|
+
0,
|
|
36
|
+
20
|
|
37
|
+
>;
|
|
38
|
+
readonly maximumFractionDigits: import('ts-type-forge').UintRangeInclusive<
|
|
39
|
+
0,
|
|
40
|
+
20
|
|
41
|
+
>;
|
|
42
|
+
readonly minimumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
43
|
+
1,
|
|
44
|
+
21
|
|
45
|
+
>;
|
|
46
|
+
readonly maximumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
38
47
|
1,
|
|
39
|
-
|
|
48
|
+
21
|
|
40
49
|
>;
|
|
41
50
|
}
|
|
42
51
|
|
|
@@ -45,27 +45,42 @@ interface BigIntToLocaleStringOptions {
|
|
|
45
45
|
/**
|
|
46
46
|
* The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1.
|
|
47
47
|
*/
|
|
48
|
-
readonly minimumIntegerDigits?: import('ts-type-forge').
|
|
48
|
+
readonly minimumIntegerDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
49
|
+
1,
|
|
50
|
+
21
|
|
51
|
+
>;
|
|
49
52
|
|
|
50
53
|
/**
|
|
51
54
|
* The minimum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number and percent formatting is 0; the default for currency formatting is the number of minor unit digits provided by the {@link http://www.currency-iso.org/en/home/tables/table-a1.html ISO 4217 currency codes list} (2 if the list doesn't provide that information).
|
|
52
55
|
*/
|
|
53
|
-
readonly minimumFractionDigits?: import('ts-type-forge').
|
|
56
|
+
readonly minimumFractionDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
57
|
+
0,
|
|
58
|
+
20
|
|
59
|
+
>;
|
|
54
60
|
|
|
55
61
|
/**
|
|
56
62
|
* The maximum number of fraction digits to use. Possible values are from 0 to 20; the default for plain number formatting is the larger of minimumFractionDigits and 3; the default for currency formatting is the larger of minimumFractionDigits and the number of minor unit digits provided by the {@link http://www.currency-iso.org/en/home/tables/table-a1.html ISO 4217 currency codes list} (2 if the list doesn't provide that information); the default for percent formatting is the larger of minimumFractionDigits and 0.
|
|
57
63
|
*/
|
|
58
|
-
readonly maximumFractionDigits?: import('ts-type-forge').
|
|
64
|
+
readonly maximumFractionDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
65
|
+
0,
|
|
66
|
+
20
|
|
67
|
+
>;
|
|
59
68
|
|
|
60
69
|
/**
|
|
61
70
|
* The minimum number of significant digits to use. Possible values are from 1 to 21; the default is 1.
|
|
62
71
|
*/
|
|
63
|
-
readonly minimumSignificantDigits?: import('ts-type-forge').
|
|
72
|
+
readonly minimumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
73
|
+
1,
|
|
74
|
+
21
|
|
75
|
+
>;
|
|
64
76
|
|
|
65
77
|
/**
|
|
66
78
|
* The maximum number of significant digits to use. Possible values are from 1 to 21; the default is 21.
|
|
67
79
|
*/
|
|
68
|
-
readonly maximumSignificantDigits?: import('ts-type-forge').
|
|
80
|
+
readonly maximumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
81
|
+
1,
|
|
82
|
+
21
|
|
83
|
+
>;
|
|
69
84
|
|
|
70
85
|
/**
|
|
71
86
|
* The formatting that should be displayed for the number, the defaults is "standard"
|
|
@@ -91,7 +106,7 @@ interface BigInt {
|
|
|
91
106
|
* Returns a string representation of an object.
|
|
92
107
|
* @param radix Specifies a radix for converting numeric values to strings.
|
|
93
108
|
*/
|
|
94
|
-
toString(radix?: import('ts-type-forge').
|
|
109
|
+
toString(radix?: import('ts-type-forge').UintRangeInclusive<2, 36>): string;
|
|
95
110
|
|
|
96
111
|
/** Returns a string representation appropriate to the host environment's current locale. */
|
|
97
112
|
toLocaleString(
|
|
@@ -115,14 +130,20 @@ interface BigIntConstructor {
|
|
|
115
130
|
* @param bits The number of low bits to use
|
|
116
131
|
* @param int The BigInt whose bits to extract
|
|
117
132
|
*/
|
|
118
|
-
asIntN(
|
|
133
|
+
asIntN(
|
|
134
|
+
bits: import('ts-type-forge').UintRangeInclusive<0, 64>,
|
|
135
|
+
int: bigint,
|
|
136
|
+
): bigint;
|
|
119
137
|
/**
|
|
120
138
|
* Interprets the low bits of a BigInt as an unsigned integer.
|
|
121
139
|
* All higher bits are discarded.
|
|
122
140
|
* @param bits The number of low bits to use
|
|
123
141
|
* @param int The BigInt whose bits to extract
|
|
124
142
|
*/
|
|
125
|
-
asUintN(
|
|
143
|
+
asUintN(
|
|
144
|
+
bits: import('ts-type-forge').UintRangeInclusive<0, 64>,
|
|
145
|
+
int: bigint,
|
|
146
|
+
): bigint;
|
|
126
147
|
}
|
|
127
148
|
|
|
128
149
|
declare const BigInt: BigIntConstructor;
|
|
@@ -24,7 +24,7 @@ declare function eval(x: string): unknown;
|
|
|
24
24
|
*/
|
|
25
25
|
declare function parseInt(
|
|
26
26
|
string: string,
|
|
27
|
-
radix?: import('ts-type-forge').
|
|
27
|
+
radix?: import('ts-type-forge').UintRangeInclusive<2, 36>,
|
|
28
28
|
): import('ts-type-forge').Int | import('ts-type-forge').NaNType;
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -650,27 +650,31 @@ interface Number {
|
|
|
650
650
|
* Returns a string representation of an object.
|
|
651
651
|
* @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.
|
|
652
652
|
*/
|
|
653
|
-
toString(radix?: import('ts-type-forge').
|
|
653
|
+
toString(radix?: import('ts-type-forge').UintRangeInclusive<2, 36>): string;
|
|
654
654
|
|
|
655
655
|
/**
|
|
656
656
|
* Returns a string representing a number in fixed-point notation.
|
|
657
657
|
* @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
|
|
658
658
|
*/
|
|
659
|
-
toFixed(
|
|
659
|
+
toFixed(
|
|
660
|
+
fractionDigits?: import('ts-type-forge').UintRangeInclusive<0, 100>,
|
|
661
|
+
): string;
|
|
660
662
|
|
|
661
663
|
/**
|
|
662
664
|
* Returns a string containing a number represented in exponential notation.
|
|
663
665
|
* @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
|
|
664
666
|
*/
|
|
665
667
|
toExponential(
|
|
666
|
-
fractionDigits?: import('ts-type-forge').
|
|
668
|
+
fractionDigits?: import('ts-type-forge').UintRangeInclusive<0, 100>,
|
|
667
669
|
): string;
|
|
668
670
|
|
|
669
671
|
/**
|
|
670
672
|
* Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.
|
|
671
673
|
* @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
|
|
672
674
|
*/
|
|
673
|
-
toPrecision(
|
|
675
|
+
toPrecision(
|
|
676
|
+
precision?: import('ts-type-forge').UintRangeInclusive<1, 100>,
|
|
677
|
+
): string;
|
|
674
678
|
|
|
675
679
|
/** Returns the primitive value of the specified object. */
|
|
676
680
|
valueOf(): number;
|
|
@@ -1324,7 +1328,7 @@ interface JSON {
|
|
|
1324
1328
|
stringify(
|
|
1325
1329
|
value: unknown,
|
|
1326
1330
|
replacer?: (this: unknown, key: string, value: unknown) => unknown,
|
|
1327
|
-
space?: string | import('ts-type-forge').
|
|
1331
|
+
space?: string | import('ts-type-forge').UintRangeInclusive<1, 10>,
|
|
1328
1332
|
): string;
|
|
1329
1333
|
/**
|
|
1330
1334
|
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
|
@@ -1336,7 +1340,7 @@ interface JSON {
|
|
|
1336
1340
|
stringify(
|
|
1337
1341
|
value: unknown,
|
|
1338
1342
|
replacer?: readonly (number | string)[] | null,
|
|
1339
|
-
space?: string | import('ts-type-forge').
|
|
1343
|
+
space?: string | import('ts-type-forge').UintRangeInclusive<1, 10>,
|
|
1340
1344
|
): string;
|
|
1341
1345
|
}
|
|
1342
1346
|
|
|
@@ -6312,19 +6316,19 @@ declare namespace Intl {
|
|
|
6312
6316
|
readonly currencyDisplay?: NumberFormatOptionsCurrencyDisplay | undefined;
|
|
6313
6317
|
readonly useGrouping?: NumberFormatOptionsUseGrouping | undefined;
|
|
6314
6318
|
readonly minimumIntegerDigits?:
|
|
6315
|
-
| import('ts-type-forge').
|
|
6319
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
6316
6320
|
| undefined;
|
|
6317
6321
|
readonly minimumFractionDigits?:
|
|
6318
|
-
| import('ts-type-forge').
|
|
6322
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
6319
6323
|
| undefined;
|
|
6320
6324
|
readonly maximumFractionDigits?:
|
|
6321
|
-
| import('ts-type-forge').
|
|
6325
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
6322
6326
|
| undefined;
|
|
6323
6327
|
readonly minimumSignificantDigits?:
|
|
6324
|
-
| import('ts-type-forge').
|
|
6328
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
6325
6329
|
| undefined;
|
|
6326
6330
|
readonly maximumSignificantDigits?:
|
|
6327
|
-
| import('ts-type-forge').
|
|
6331
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
6328
6332
|
| undefined;
|
|
6329
6333
|
}
|
|
6330
6334
|
|
|
@@ -6334,16 +6338,25 @@ declare namespace Intl {
|
|
|
6334
6338
|
readonly style: NumberFormatOptionsStyle;
|
|
6335
6339
|
readonly currency?: string;
|
|
6336
6340
|
readonly currencyDisplay?: NumberFormatOptionsCurrencyDisplay;
|
|
6337
|
-
readonly minimumIntegerDigits: import('ts-type-forge').
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
+
readonly minimumIntegerDigits: import('ts-type-forge').UintRangeInclusive<
|
|
6342
|
+
1,
|
|
6343
|
+
21
|
|
6344
|
+
>;
|
|
6345
|
+
readonly minimumFractionDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
6346
|
+
0,
|
|
6347
|
+
20
|
|
6348
|
+
>;
|
|
6349
|
+
readonly maximumFractionDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
6350
|
+
0,
|
|
6351
|
+
20
|
|
6352
|
+
>;
|
|
6353
|
+
readonly minimumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
6341
6354
|
1,
|
|
6342
|
-
|
|
6355
|
+
21
|
|
6343
6356
|
>;
|
|
6344
|
-
readonly maximumSignificantDigits?: import('ts-type-forge').
|
|
6357
|
+
readonly maximumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
6345
6358
|
1,
|
|
6346
|
-
|
|
6359
|
+
21
|
|
6347
6360
|
>;
|
|
6348
6361
|
readonly useGrouping: ResolvedNumberFormatOptionsUseGrouping;
|
|
6349
6362
|
}
|