Skip to content

Commit a433b81

Browse files
committed
Intl.NumberFormat: conditional type override for useGrouping
1 parent 8b96367 commit a433b81

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/lib/es2023.intl.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
declare namespace Intl {
22
interface NumberFormatOptionsUseGroupingRegistry {
3-
true: any;
4-
false: any;
53
min2: any;
64
auto: any;
75
always: any;

src/lib/es5.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -4419,7 +4419,8 @@ declare namespace Intl {
44194419

44204420
interface NumberFormatOptionsUseGroupingRegistry {}
44214421

4422-
type NumberFormatOptionsUseGrouping = keyof NumberFormatOptionsUseGroupingRegistry | boolean;
4422+
type NumberFormatOptionsUseGrouping = {} extends NumberFormatOptionsUseGroupingRegistry ? boolean : keyof NumberFormatOptionsUseGroupingRegistry | "true" | "false" | boolean;
4423+
type ResolvedNumberFormatOptionsUseGrouping = {} extends NumberFormatOptionsUseGroupingRegistry ? boolean : keyof NumberFormatOptionsUseGrouping;
44234424

44244425
interface NumberFormatOptions {
44254426
localeMatcher?: "lookup" | "best fit" | undefined;
@@ -4445,7 +4446,7 @@ declare namespace Intl {
44454446
maximumFractionDigits: number;
44464447
minimumSignificantDigits?: number;
44474448
maximumSignificantDigits?: number;
4448-
useGrouping: NumberFormatOptionsUseGrouping;
4449+
useGrouping: ResolvedNumberFormatOptionsUseGrouping;
44494450
}
44504451

44514452
interface NumberFormat {

0 commit comments

Comments
 (0)