strict-ts-lib-v5.2 0.5.1 → 0.6.1
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 +53 -0
- package/libs/dom/index.d.ts +1 -4
- package/libs/es2015/core/index.d.ts +2 -2
- package/libs/es2017/object/index.d.ts +1 -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 +34 -21
- package/libs-branded/dom/index.d.ts +1 -4
- package/libs-branded/es2015/core/index.d.ts +2 -2
- package/libs-branded/es2017/object/index.d.ts +1 -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 +34 -21
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
# strict-ts-lib-v5.2
|
|
2
2
|
|
|
3
|
+
## 0.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
|
|
9
|
+
## 0.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- ac290c1: Leave `Exclude`, `Extract`, `Omit` and `Pick` with the constraints TypeScript
|
|
14
|
+
declares, and widen `strict-ts-lib-v7.0`'s `typescript` peer range to
|
|
15
|
+
`>=6.0.0 <8.0.0`.
|
|
16
|
+
|
|
17
|
+
Both landed on main in #1672 and #1673 but shipped no release: those changesets
|
|
18
|
+
named the bundle packages (`strict-ts-lib-v7.0` and friends) rather than the
|
|
19
|
+
`-source` harnesses this repository versions. `changeset version` bumped the
|
|
20
|
+
bundle manifests, and `strict-lib:gen:packages` — which runs next and stamps
|
|
21
|
+
each bundle with its harness's version — wrote 0.5.1 straight back over them,
|
|
22
|
+
the harnesses never having been bumped at all. Nothing errored; the version
|
|
23
|
+
simply did not move.
|
|
24
|
+
|
|
25
|
+
All twelve harnesses are named. The `fixed` group in `.changeset/config.json`
|
|
26
|
+
would align the versions from a single name, but a changeset's text reaches
|
|
27
|
+
only the packages it names — the rest get a bare version heading with nothing
|
|
28
|
+
under it. A change to the shared converter affects every series equally, so
|
|
29
|
+
every series' changelog should say so.
|
|
30
|
+
|
|
31
|
+
### `Exclude` and `Omit`
|
|
32
|
+
|
|
33
|
+
Two of the four utility types had their second argument narrowed here —
|
|
34
|
+
`Exclude<T, U extends T>` and `Omit<T, K extends keyof T>`, against upstream's
|
|
35
|
+
`Exclude<T, U>` and `Omit<T, K extends keyof any>`. `Extract` and `Pick`
|
|
36
|
+
already matched.
|
|
37
|
+
|
|
38
|
+
Narrowing makes a choice on the caller's behalf, and only one of the two
|
|
39
|
+
readings is ever right for a given call. Subtracting keys a type may not have
|
|
40
|
+
is legitimate — upstream's own declarations do it — and under the narrowed
|
|
41
|
+
constraint it is a TS2344 that nothing can fix when the declaration lives
|
|
42
|
+
inside a dependency. Making the choice explicit belongs in the caller's code,
|
|
43
|
+
which is what `eslint-plugin-ts-type-forge`'s
|
|
44
|
+
`prefer-strict-or-relaxed-utility-type` does, pointing at `StrictOmit` /
|
|
45
|
+
`RelaxedOmit` and the rest.
|
|
46
|
+
|
|
47
|
+
Only widens what is accepted, so anything that compiled still does.
|
|
48
|
+
|
|
49
|
+
### Peer range
|
|
50
|
+
|
|
51
|
+
TypeScript 6.0.3 compiles the v7.0 lib set with `skipLibCheck: false` and no
|
|
52
|
+
errors, and resolves `@typescript/lib-*` by the same package-name lookup
|
|
53
|
+
TypeScript 7 uses, so one bundle serves both compilers. Without the wider
|
|
54
|
+
declaration npm refuses to install it beside TypeScript 6.
|
|
55
|
+
|
|
3
56
|
## 0.5.1
|
|
4
57
|
|
|
5
58
|
### Patch Changes
|
package/libs/dom/index.d.ts
CHANGED
|
@@ -33491,10 +33491,7 @@ interface MathMLElementTagNameMap {
|
|
|
33491
33491
|
type ElementTagNameMap = HTMLElementTagNameMap &
|
|
33492
33492
|
Pick<
|
|
33493
33493
|
SVGElementTagNameMap,
|
|
33494
|
-
|
|
33495
|
-
keyof SVGElementTagNameMap,
|
|
33496
|
-
keyof HTMLElementTagNameMap
|
|
33497
|
-
>
|
|
33494
|
+
Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>
|
|
33498
33495
|
>;
|
|
33499
33496
|
|
|
33500
33497
|
declare const Audio: {
|
|
@@ -97,7 +97,7 @@ interface Math {
|
|
|
97
97
|
* Returns the number of leading zero bits in the 32-bit binary representation of a number.
|
|
98
98
|
* @param x A numeric expression.
|
|
99
99
|
*/
|
|
100
|
-
clz32(x: number): import('ts-type-forge').
|
|
100
|
+
clz32(x: number): import('ts-type-forge').UintRangeInclusive<0, 32>;
|
|
101
101
|
|
|
102
102
|
/**
|
|
103
103
|
* Returns the result of 32-bit multiplication of two numbers.
|
|
@@ -270,7 +270,7 @@ interface NumberConstructor {
|
|
|
270
270
|
*/
|
|
271
271
|
parseInt(
|
|
272
272
|
string: string,
|
|
273
|
-
radix?: import('ts-type-forge').
|
|
273
|
+
radix?: import('ts-type-forge').UintRangeInclusive<2, 36>,
|
|
274
274
|
): number;
|
|
275
275
|
}
|
|
276
276
|
|
|
@@ -46,8 +46,7 @@ declare namespace StrictLibInternals {
|
|
|
46
46
|
ToStr<keyof PickByValue<R, R[K]>>,
|
|
47
47
|
R[K],
|
|
48
48
|
];
|
|
49
|
-
|
|
50
|
-
}[import('ts-type-forge').RelaxedExclude<keyof R, symbol>]
|
|
49
|
+
}[Exclude<keyof R, symbol>]
|
|
51
50
|
)[]
|
|
52
51
|
: never;
|
|
53
52
|
}
|
|
@@ -9,19 +9,19 @@ declare namespace Intl {
|
|
|
9
9
|
readonly localeMatcher?: 'lookup' | 'best fit' | undefined;
|
|
10
10
|
readonly type?: PluralRuleType | undefined;
|
|
11
11
|
readonly minimumIntegerDigits?:
|
|
12
|
-
| import('ts-type-forge').
|
|
12
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
13
13
|
| undefined;
|
|
14
14
|
readonly minimumFractionDigits?:
|
|
15
|
-
| import('ts-type-forge').
|
|
15
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
16
16
|
| undefined;
|
|
17
17
|
readonly maximumFractionDigits?:
|
|
18
|
-
| import('ts-type-forge').
|
|
18
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
19
19
|
| undefined;
|
|
20
20
|
readonly minimumSignificantDigits?:
|
|
21
|
-
| import('ts-type-forge').
|
|
21
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
22
22
|
| undefined;
|
|
23
23
|
readonly maximumSignificantDigits?:
|
|
24
|
-
| import('ts-type-forge').
|
|
24
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
25
25
|
| undefined;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -29,16 +29,25 @@ declare namespace Intl {
|
|
|
29
29
|
readonly locale: string;
|
|
30
30
|
readonly pluralCategories: readonly LDMLPluralRule[];
|
|
31
31
|
readonly type: PluralRuleType;
|
|
32
|
-
readonly minimumIntegerDigits: import('ts-type-forge').
|
|
33
|
-
readonly minimumFractionDigits: import('ts-type-forge').UintRange<0, 21>;
|
|
34
|
-
readonly maximumFractionDigits: import('ts-type-forge').UintRange<0, 21>;
|
|
35
|
-
readonly minimumSignificantDigits?: import('ts-type-forge').UintRange<
|
|
32
|
+
readonly minimumIntegerDigits: import('ts-type-forge').UintRangeInclusive<
|
|
36
33
|
1,
|
|
37
|
-
|
|
34
|
+
21
|
|
38
35
|
>;
|
|
39
|
-
readonly
|
|
36
|
+
readonly minimumFractionDigits: import('ts-type-forge').UintRangeInclusive<
|
|
37
|
+
0,
|
|
38
|
+
20
|
|
39
|
+
>;
|
|
40
|
+
readonly maximumFractionDigits: import('ts-type-forge').UintRangeInclusive<
|
|
41
|
+
0,
|
|
42
|
+
20
|
|
43
|
+
>;
|
|
44
|
+
readonly minimumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
45
|
+
1,
|
|
46
|
+
21
|
|
47
|
+
>;
|
|
48
|
+
readonly maximumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
40
49
|
1,
|
|
41
|
-
|
|
50
|
+
21
|
|
42
51
|
>;
|
|
43
52
|
}
|
|
44
53
|
|
|
@@ -47,27 +47,42 @@ interface BigIntToLocaleStringOptions {
|
|
|
47
47
|
/**
|
|
48
48
|
* The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1.
|
|
49
49
|
*/
|
|
50
|
-
readonly minimumIntegerDigits?: import('ts-type-forge').
|
|
50
|
+
readonly minimumIntegerDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
51
|
+
1,
|
|
52
|
+
21
|
|
53
|
+
>;
|
|
51
54
|
|
|
52
55
|
/**
|
|
53
56
|
* 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).
|
|
54
57
|
*/
|
|
55
|
-
readonly minimumFractionDigits?: import('ts-type-forge').
|
|
58
|
+
readonly minimumFractionDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
59
|
+
0,
|
|
60
|
+
20
|
|
61
|
+
>;
|
|
56
62
|
|
|
57
63
|
/**
|
|
58
64
|
* 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.
|
|
59
65
|
*/
|
|
60
|
-
readonly maximumFractionDigits?: import('ts-type-forge').
|
|
66
|
+
readonly maximumFractionDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
67
|
+
0,
|
|
68
|
+
20
|
|
69
|
+
>;
|
|
61
70
|
|
|
62
71
|
/**
|
|
63
72
|
* The minimum number of significant digits to use. Possible values are from 1 to 21; the default is 1.
|
|
64
73
|
*/
|
|
65
|
-
readonly minimumSignificantDigits?: import('ts-type-forge').
|
|
74
|
+
readonly minimumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
75
|
+
1,
|
|
76
|
+
21
|
|
77
|
+
>;
|
|
66
78
|
|
|
67
79
|
/**
|
|
68
80
|
* The maximum number of significant digits to use. Possible values are from 1 to 21; the default is 21.
|
|
69
81
|
*/
|
|
70
|
-
readonly maximumSignificantDigits?: import('ts-type-forge').
|
|
82
|
+
readonly maximumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
83
|
+
1,
|
|
84
|
+
21
|
|
85
|
+
>;
|
|
71
86
|
|
|
72
87
|
/**
|
|
73
88
|
* The formatting that should be displayed for the number, the defaults is "standard"
|
|
@@ -93,7 +108,7 @@ interface BigInt {
|
|
|
93
108
|
* Returns a string representation of an object.
|
|
94
109
|
* @param radix Specifies a radix for converting numeric values to strings.
|
|
95
110
|
*/
|
|
96
|
-
toString(radix?: import('ts-type-forge').
|
|
111
|
+
toString(radix?: import('ts-type-forge').UintRangeInclusive<2, 36>): string;
|
|
97
112
|
|
|
98
113
|
/** Returns a string representation appropriate to the host environment's current locale. */
|
|
99
114
|
toLocaleString(
|
|
@@ -117,14 +132,20 @@ interface BigIntConstructor {
|
|
|
117
132
|
* @param bits The number of low bits to use
|
|
118
133
|
* @param int The BigInt whose bits to extract
|
|
119
134
|
*/
|
|
120
|
-
asIntN(
|
|
135
|
+
asIntN(
|
|
136
|
+
bits: import('ts-type-forge').UintRangeInclusive<0, 64>,
|
|
137
|
+
int: bigint,
|
|
138
|
+
): bigint;
|
|
121
139
|
/**
|
|
122
140
|
* Interprets the low bits of a BigInt as an unsigned integer.
|
|
123
141
|
* All higher bits are discarded.
|
|
124
142
|
* @param bits The number of low bits to use
|
|
125
143
|
* @param int The BigInt whose bits to extract
|
|
126
144
|
*/
|
|
127
|
-
asUintN(
|
|
145
|
+
asUintN(
|
|
146
|
+
bits: import('ts-type-forge').UintRangeInclusive<0, 64>,
|
|
147
|
+
int: bigint,
|
|
148
|
+
): bigint;
|
|
128
149
|
}
|
|
129
150
|
|
|
130
151
|
declare const BigInt: BigIntConstructor;
|
package/libs/es5/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ declare function eval(x: string): unknown;
|
|
|
26
26
|
*/
|
|
27
27
|
declare function parseInt(
|
|
28
28
|
string: string,
|
|
29
|
-
radix?: import('ts-type-forge').
|
|
29
|
+
radix?: import('ts-type-forge').UintRangeInclusive<2, 36>,
|
|
30
30
|
): number;
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -632,27 +632,31 @@ interface Number {
|
|
|
632
632
|
* Returns a string representation of an object.
|
|
633
633
|
* @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.
|
|
634
634
|
*/
|
|
635
|
-
toString(radix?: import('ts-type-forge').
|
|
635
|
+
toString(radix?: import('ts-type-forge').UintRangeInclusive<2, 36>): string;
|
|
636
636
|
|
|
637
637
|
/**
|
|
638
638
|
* Returns a string representing a number in fixed-point notation.
|
|
639
639
|
* @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
|
|
640
640
|
*/
|
|
641
|
-
toFixed(
|
|
641
|
+
toFixed(
|
|
642
|
+
fractionDigits?: import('ts-type-forge').UintRangeInclusive<0, 100>,
|
|
643
|
+
): string;
|
|
642
644
|
|
|
643
645
|
/**
|
|
644
646
|
* Returns a string containing a number represented in exponential notation.
|
|
645
647
|
* @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
|
|
646
648
|
*/
|
|
647
649
|
toExponential(
|
|
648
|
-
fractionDigits?: import('ts-type-forge').
|
|
650
|
+
fractionDigits?: import('ts-type-forge').UintRangeInclusive<1, 100>,
|
|
649
651
|
): string;
|
|
650
652
|
|
|
651
653
|
/**
|
|
652
654
|
* Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.
|
|
653
655
|
* @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
|
|
654
656
|
*/
|
|
655
|
-
toPrecision(
|
|
657
|
+
toPrecision(
|
|
658
|
+
precision?: import('ts-type-forge').UintRangeInclusive<1, 100>,
|
|
659
|
+
): string;
|
|
656
660
|
|
|
657
661
|
/** Returns the primitive value of the specified object. */
|
|
658
662
|
valueOf(): number;
|
|
@@ -1247,7 +1251,7 @@ interface JSON {
|
|
|
1247
1251
|
stringify(
|
|
1248
1252
|
value: unknown,
|
|
1249
1253
|
replacer?: (this: unknown, key: string, value: unknown) => unknown,
|
|
1250
|
-
space?: string | import('ts-type-forge').
|
|
1254
|
+
space?: string | import('ts-type-forge').UintRangeInclusive<1, 10>,
|
|
1251
1255
|
): string;
|
|
1252
1256
|
/**
|
|
1253
1257
|
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
|
@@ -1258,7 +1262,7 @@ interface JSON {
|
|
|
1258
1262
|
stringify(
|
|
1259
1263
|
value: unknown,
|
|
1260
1264
|
replacer?: readonly (number | string)[] | null,
|
|
1261
|
-
space?: string | import('ts-type-forge').
|
|
1265
|
+
space?: string | import('ts-type-forge').UintRangeInclusive<1, 10>,
|
|
1262
1266
|
): string;
|
|
1263
1267
|
}
|
|
1264
1268
|
|
|
@@ -1859,7 +1863,7 @@ type Record<K extends PropertyKey, T> = {
|
|
|
1859
1863
|
/**
|
|
1860
1864
|
* Exclude from T those types that are assignable to U
|
|
1861
1865
|
*/
|
|
1862
|
-
type Exclude<T, U
|
|
1866
|
+
type Exclude<T, U> = T extends U ? never : T;
|
|
1863
1867
|
|
|
1864
1868
|
/**
|
|
1865
1869
|
* Extract from T those types that are assignable to U
|
|
@@ -1869,7 +1873,7 @@ type Extract<T, U> = T extends U ? T : never;
|
|
|
1869
1873
|
/**
|
|
1870
1874
|
* Construct a type with the properties of T except for those in type K.
|
|
1871
1875
|
*/
|
|
1872
|
-
type Omit<T, K extends
|
|
1876
|
+
type Omit<T, K extends PropertyKey> = Pick<T, Exclude<keyof T, K>>;
|
|
1873
1877
|
|
|
1874
1878
|
/**
|
|
1875
1879
|
* Exclude null and undefined from T
|
|
@@ -5529,19 +5533,19 @@ declare namespace Intl {
|
|
|
5529
5533
|
readonly currencySign?: string | undefined;
|
|
5530
5534
|
readonly useGrouping?: boolean | undefined;
|
|
5531
5535
|
readonly minimumIntegerDigits?:
|
|
5532
|
-
| import('ts-type-forge').
|
|
5536
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
5533
5537
|
| undefined;
|
|
5534
5538
|
readonly minimumFractionDigits?:
|
|
5535
|
-
| import('ts-type-forge').
|
|
5539
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
5536
5540
|
| undefined;
|
|
5537
5541
|
readonly maximumFractionDigits?:
|
|
5538
|
-
| import('ts-type-forge').
|
|
5542
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
5539
5543
|
| undefined;
|
|
5540
5544
|
readonly minimumSignificantDigits?:
|
|
5541
|
-
| import('ts-type-forge').
|
|
5545
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
5542
5546
|
| undefined;
|
|
5543
5547
|
readonly maximumSignificantDigits?:
|
|
5544
|
-
| import('ts-type-forge').
|
|
5548
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
5545
5549
|
| undefined;
|
|
5546
5550
|
}
|
|
5547
5551
|
|
|
@@ -5550,16 +5554,25 @@ declare namespace Intl {
|
|
|
5550
5554
|
readonly numberingSystem: string;
|
|
5551
5555
|
readonly style: string;
|
|
5552
5556
|
readonly currency?: string;
|
|
5553
|
-
readonly minimumIntegerDigits: import('ts-type-forge').
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
+
readonly minimumIntegerDigits: import('ts-type-forge').UintRangeInclusive<
|
|
5558
|
+
1,
|
|
5559
|
+
21
|
|
5560
|
+
>;
|
|
5561
|
+
readonly minimumFractionDigits: import('ts-type-forge').UintRangeInclusive<
|
|
5562
|
+
0,
|
|
5563
|
+
20
|
|
5564
|
+
>;
|
|
5565
|
+
readonly maximumFractionDigits: import('ts-type-forge').UintRangeInclusive<
|
|
5566
|
+
0,
|
|
5567
|
+
20
|
|
5568
|
+
>;
|
|
5569
|
+
readonly minimumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
5557
5570
|
1,
|
|
5558
|
-
|
|
5571
|
+
21
|
|
5559
5572
|
>;
|
|
5560
|
-
readonly maximumSignificantDigits?: import('ts-type-forge').
|
|
5573
|
+
readonly maximumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
5561
5574
|
1,
|
|
5562
|
-
|
|
5575
|
+
21
|
|
5563
5576
|
>;
|
|
5564
5577
|
readonly useGrouping: boolean;
|
|
5565
5578
|
}
|
|
@@ -33498,10 +33498,7 @@ interface MathMLElementTagNameMap {
|
|
|
33498
33498
|
type ElementTagNameMap = HTMLElementTagNameMap &
|
|
33499
33499
|
Pick<
|
|
33500
33500
|
SVGElementTagNameMap,
|
|
33501
|
-
|
|
33502
|
-
keyof SVGElementTagNameMap,
|
|
33503
|
-
keyof HTMLElementTagNameMap
|
|
33504
|
-
>
|
|
33501
|
+
Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>
|
|
33505
33502
|
>;
|
|
33506
33503
|
|
|
33507
33504
|
declare const Audio: {
|
|
@@ -117,7 +117,7 @@ interface Math {
|
|
|
117
117
|
* Returns the number of leading zero bits in the 32-bit binary representation of a number.
|
|
118
118
|
* @param x A numeric expression.
|
|
119
119
|
*/
|
|
120
|
-
clz32(x: number): import('ts-type-forge').
|
|
120
|
+
clz32(x: number): import('ts-type-forge').UintRangeInclusive<0, 32>;
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
123
|
* Returns the result of 32-bit multiplication of two numbers.
|
|
@@ -310,7 +310,7 @@ interface NumberConstructor {
|
|
|
310
310
|
*/
|
|
311
311
|
parseInt(
|
|
312
312
|
string: string,
|
|
313
|
-
radix?: import('ts-type-forge').
|
|
313
|
+
radix?: import('ts-type-forge').UintRangeInclusive<2, 36>,
|
|
314
314
|
): import('ts-type-forge').Int | import('ts-type-forge').NaNType;
|
|
315
315
|
}
|
|
316
316
|
|
|
@@ -46,8 +46,7 @@ declare namespace StrictLibInternals {
|
|
|
46
46
|
ToStr<keyof PickByValue<R, R[K]>>,
|
|
47
47
|
R[K],
|
|
48
48
|
];
|
|
49
|
-
|
|
50
|
-
}[import('ts-type-forge').RelaxedExclude<keyof R, symbol>]
|
|
49
|
+
}[Exclude<keyof R, symbol>]
|
|
51
50
|
)[]
|
|
52
51
|
: never;
|
|
53
52
|
}
|
|
@@ -9,19 +9,19 @@ declare namespace Intl {
|
|
|
9
9
|
readonly localeMatcher?: 'lookup' | 'best fit' | undefined;
|
|
10
10
|
readonly type?: PluralRuleType | undefined;
|
|
11
11
|
readonly minimumIntegerDigits?:
|
|
12
|
-
| import('ts-type-forge').
|
|
12
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
13
13
|
| undefined;
|
|
14
14
|
readonly minimumFractionDigits?:
|
|
15
|
-
| import('ts-type-forge').
|
|
15
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
16
16
|
| undefined;
|
|
17
17
|
readonly maximumFractionDigits?:
|
|
18
|
-
| import('ts-type-forge').
|
|
18
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
19
19
|
| undefined;
|
|
20
20
|
readonly minimumSignificantDigits?:
|
|
21
|
-
| import('ts-type-forge').
|
|
21
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
22
22
|
| undefined;
|
|
23
23
|
readonly maximumSignificantDigits?:
|
|
24
|
-
| import('ts-type-forge').
|
|
24
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
25
25
|
| undefined;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -29,16 +29,25 @@ declare namespace Intl {
|
|
|
29
29
|
readonly locale: string;
|
|
30
30
|
readonly pluralCategories: readonly LDMLPluralRule[];
|
|
31
31
|
readonly type: PluralRuleType;
|
|
32
|
-
readonly minimumIntegerDigits: import('ts-type-forge').
|
|
33
|
-
readonly minimumFractionDigits: import('ts-type-forge').UintRange<0, 21>;
|
|
34
|
-
readonly maximumFractionDigits: import('ts-type-forge').UintRange<0, 21>;
|
|
35
|
-
readonly minimumSignificantDigits?: import('ts-type-forge').UintRange<
|
|
32
|
+
readonly minimumIntegerDigits: import('ts-type-forge').UintRangeInclusive<
|
|
36
33
|
1,
|
|
37
|
-
|
|
34
|
+
21
|
|
38
35
|
>;
|
|
39
|
-
readonly
|
|
36
|
+
readonly minimumFractionDigits: import('ts-type-forge').UintRangeInclusive<
|
|
37
|
+
0,
|
|
38
|
+
20
|
|
39
|
+
>;
|
|
40
|
+
readonly maximumFractionDigits: import('ts-type-forge').UintRangeInclusive<
|
|
41
|
+
0,
|
|
42
|
+
20
|
|
43
|
+
>;
|
|
44
|
+
readonly minimumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
45
|
+
1,
|
|
46
|
+
21
|
|
47
|
+
>;
|
|
48
|
+
readonly maximumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
40
49
|
1,
|
|
41
|
-
|
|
50
|
+
21
|
|
42
51
|
>;
|
|
43
52
|
}
|
|
44
53
|
|
|
@@ -47,27 +47,42 @@ interface BigIntToLocaleStringOptions {
|
|
|
47
47
|
/**
|
|
48
48
|
* The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1.
|
|
49
49
|
*/
|
|
50
|
-
readonly minimumIntegerDigits?: import('ts-type-forge').
|
|
50
|
+
readonly minimumIntegerDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
51
|
+
1,
|
|
52
|
+
21
|
|
53
|
+
>;
|
|
51
54
|
|
|
52
55
|
/**
|
|
53
56
|
* 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).
|
|
54
57
|
*/
|
|
55
|
-
readonly minimumFractionDigits?: import('ts-type-forge').
|
|
58
|
+
readonly minimumFractionDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
59
|
+
0,
|
|
60
|
+
20
|
|
61
|
+
>;
|
|
56
62
|
|
|
57
63
|
/**
|
|
58
64
|
* 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.
|
|
59
65
|
*/
|
|
60
|
-
readonly maximumFractionDigits?: import('ts-type-forge').
|
|
66
|
+
readonly maximumFractionDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
67
|
+
0,
|
|
68
|
+
20
|
|
69
|
+
>;
|
|
61
70
|
|
|
62
71
|
/**
|
|
63
72
|
* The minimum number of significant digits to use. Possible values are from 1 to 21; the default is 1.
|
|
64
73
|
*/
|
|
65
|
-
readonly minimumSignificantDigits?: import('ts-type-forge').
|
|
74
|
+
readonly minimumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
75
|
+
1,
|
|
76
|
+
21
|
|
77
|
+
>;
|
|
66
78
|
|
|
67
79
|
/**
|
|
68
80
|
* The maximum number of significant digits to use. Possible values are from 1 to 21; the default is 21.
|
|
69
81
|
*/
|
|
70
|
-
readonly maximumSignificantDigits?: import('ts-type-forge').
|
|
82
|
+
readonly maximumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
83
|
+
1,
|
|
84
|
+
21
|
|
85
|
+
>;
|
|
71
86
|
|
|
72
87
|
/**
|
|
73
88
|
* The formatting that should be displayed for the number, the defaults is "standard"
|
|
@@ -93,7 +108,7 @@ interface BigInt {
|
|
|
93
108
|
* Returns a string representation of an object.
|
|
94
109
|
* @param radix Specifies a radix for converting numeric values to strings.
|
|
95
110
|
*/
|
|
96
|
-
toString(radix?: import('ts-type-forge').
|
|
111
|
+
toString(radix?: import('ts-type-forge').UintRangeInclusive<2, 36>): string;
|
|
97
112
|
|
|
98
113
|
/** Returns a string representation appropriate to the host environment's current locale. */
|
|
99
114
|
toLocaleString(
|
|
@@ -117,14 +132,20 @@ interface BigIntConstructor {
|
|
|
117
132
|
* @param bits The number of low bits to use
|
|
118
133
|
* @param int The BigInt whose bits to extract
|
|
119
134
|
*/
|
|
120
|
-
asIntN(
|
|
135
|
+
asIntN(
|
|
136
|
+
bits: import('ts-type-forge').UintRangeInclusive<0, 64>,
|
|
137
|
+
int: bigint,
|
|
138
|
+
): bigint;
|
|
121
139
|
/**
|
|
122
140
|
* Interprets the low bits of a BigInt as an unsigned integer.
|
|
123
141
|
* All higher bits are discarded.
|
|
124
142
|
* @param bits The number of low bits to use
|
|
125
143
|
* @param int The BigInt whose bits to extract
|
|
126
144
|
*/
|
|
127
|
-
asUintN(
|
|
145
|
+
asUintN(
|
|
146
|
+
bits: import('ts-type-forge').UintRangeInclusive<0, 64>,
|
|
147
|
+
int: bigint,
|
|
148
|
+
): bigint;
|
|
128
149
|
}
|
|
129
150
|
|
|
130
151
|
declare const BigInt: BigIntConstructor;
|
|
@@ -26,7 +26,7 @@ declare function eval(x: string): unknown;
|
|
|
26
26
|
*/
|
|
27
27
|
declare function parseInt(
|
|
28
28
|
string: string,
|
|
29
|
-
radix?: import('ts-type-forge').
|
|
29
|
+
radix?: import('ts-type-forge').UintRangeInclusive<2, 36>,
|
|
30
30
|
): import('ts-type-forge').Int | import('ts-type-forge').NaNType;
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -652,27 +652,31 @@ interface Number {
|
|
|
652
652
|
* Returns a string representation of an object.
|
|
653
653
|
* @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.
|
|
654
654
|
*/
|
|
655
|
-
toString(radix?: import('ts-type-forge').
|
|
655
|
+
toString(radix?: import('ts-type-forge').UintRangeInclusive<2, 36>): string;
|
|
656
656
|
|
|
657
657
|
/**
|
|
658
658
|
* Returns a string representing a number in fixed-point notation.
|
|
659
659
|
* @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
|
|
660
660
|
*/
|
|
661
|
-
toFixed(
|
|
661
|
+
toFixed(
|
|
662
|
+
fractionDigits?: import('ts-type-forge').UintRangeInclusive<0, 100>,
|
|
663
|
+
): string;
|
|
662
664
|
|
|
663
665
|
/**
|
|
664
666
|
* Returns a string containing a number represented in exponential notation.
|
|
665
667
|
* @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
|
|
666
668
|
*/
|
|
667
669
|
toExponential(
|
|
668
|
-
fractionDigits?: import('ts-type-forge').
|
|
670
|
+
fractionDigits?: import('ts-type-forge').UintRangeInclusive<1, 100>,
|
|
669
671
|
): string;
|
|
670
672
|
|
|
671
673
|
/**
|
|
672
674
|
* Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.
|
|
673
675
|
* @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.
|
|
674
676
|
*/
|
|
675
|
-
toPrecision(
|
|
677
|
+
toPrecision(
|
|
678
|
+
precision?: import('ts-type-forge').UintRangeInclusive<1, 100>,
|
|
679
|
+
): string;
|
|
676
680
|
|
|
677
681
|
/** Returns the primitive value of the specified object. */
|
|
678
682
|
valueOf(): number;
|
|
@@ -1315,7 +1319,7 @@ interface JSON {
|
|
|
1315
1319
|
stringify(
|
|
1316
1320
|
value: unknown,
|
|
1317
1321
|
replacer?: (this: unknown, key: string, value: unknown) => unknown,
|
|
1318
|
-
space?: string | import('ts-type-forge').
|
|
1322
|
+
space?: string | import('ts-type-forge').UintRangeInclusive<1, 10>,
|
|
1319
1323
|
): string;
|
|
1320
1324
|
/**
|
|
1321
1325
|
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string.
|
|
@@ -1326,7 +1330,7 @@ interface JSON {
|
|
|
1326
1330
|
stringify(
|
|
1327
1331
|
value: unknown,
|
|
1328
1332
|
replacer?: readonly (number | string)[] | null,
|
|
1329
|
-
space?: string | import('ts-type-forge').
|
|
1333
|
+
space?: string | import('ts-type-forge').UintRangeInclusive<1, 10>,
|
|
1330
1334
|
): string;
|
|
1331
1335
|
}
|
|
1332
1336
|
|
|
@@ -2014,7 +2018,7 @@ type Record<K extends PropertyKey, T> = {
|
|
|
2014
2018
|
/**
|
|
2015
2019
|
* Exclude from T those types that are assignable to U
|
|
2016
2020
|
*/
|
|
2017
|
-
type Exclude<T, U
|
|
2021
|
+
type Exclude<T, U> = T extends U ? never : T;
|
|
2018
2022
|
|
|
2019
2023
|
/**
|
|
2020
2024
|
* Extract from T those types that are assignable to U
|
|
@@ -2024,7 +2028,7 @@ type Extract<T, U> = T extends U ? T : never;
|
|
|
2024
2028
|
/**
|
|
2025
2029
|
* Construct a type with the properties of T except for those in type K.
|
|
2026
2030
|
*/
|
|
2027
|
-
type Omit<T, K extends
|
|
2031
|
+
type Omit<T, K extends PropertyKey> = Pick<T, Exclude<keyof T, K>>;
|
|
2028
2032
|
|
|
2029
2033
|
/**
|
|
2030
2034
|
* Exclude null and undefined from T
|
|
@@ -6154,19 +6158,19 @@ declare namespace Intl {
|
|
|
6154
6158
|
readonly currencySign?: string | undefined;
|
|
6155
6159
|
readonly useGrouping?: boolean | undefined;
|
|
6156
6160
|
readonly minimumIntegerDigits?:
|
|
6157
|
-
| import('ts-type-forge').
|
|
6161
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
6158
6162
|
| undefined;
|
|
6159
6163
|
readonly minimumFractionDigits?:
|
|
6160
|
-
| import('ts-type-forge').
|
|
6164
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
6161
6165
|
| undefined;
|
|
6162
6166
|
readonly maximumFractionDigits?:
|
|
6163
|
-
| import('ts-type-forge').
|
|
6167
|
+
| import('ts-type-forge').UintRangeInclusive<0, 20>
|
|
6164
6168
|
| undefined;
|
|
6165
6169
|
readonly minimumSignificantDigits?:
|
|
6166
|
-
| import('ts-type-forge').
|
|
6170
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
6167
6171
|
| undefined;
|
|
6168
6172
|
readonly maximumSignificantDigits?:
|
|
6169
|
-
| import('ts-type-forge').
|
|
6173
|
+
| import('ts-type-forge').UintRangeInclusive<1, 21>
|
|
6170
6174
|
| undefined;
|
|
6171
6175
|
}
|
|
6172
6176
|
|
|
@@ -6175,16 +6179,25 @@ declare namespace Intl {
|
|
|
6175
6179
|
readonly numberingSystem: string;
|
|
6176
6180
|
readonly style: string;
|
|
6177
6181
|
readonly currency?: string;
|
|
6178
|
-
readonly minimumIntegerDigits: import('ts-type-forge').
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
+
readonly minimumIntegerDigits: import('ts-type-forge').UintRangeInclusive<
|
|
6183
|
+
1,
|
|
6184
|
+
21
|
|
6185
|
+
>;
|
|
6186
|
+
readonly minimumFractionDigits: import('ts-type-forge').UintRangeInclusive<
|
|
6187
|
+
0,
|
|
6188
|
+
20
|
|
6189
|
+
>;
|
|
6190
|
+
readonly maximumFractionDigits: import('ts-type-forge').UintRangeInclusive<
|
|
6191
|
+
0,
|
|
6192
|
+
20
|
|
6193
|
+
>;
|
|
6194
|
+
readonly minimumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
6182
6195
|
1,
|
|
6183
|
-
|
|
6196
|
+
21
|
|
6184
6197
|
>;
|
|
6185
|
-
readonly maximumSignificantDigits?: import('ts-type-forge').
|
|
6198
|
+
readonly maximumSignificantDigits?: import('ts-type-forge').UintRangeInclusive<
|
|
6186
6199
|
1,
|
|
6187
|
-
|
|
6200
|
+
21
|
|
6188
6201
|
>;
|
|
6189
6202
|
readonly useGrouping: boolean;
|
|
6190
6203
|
}
|