Skip to content

Commit 48e1a89

Browse files
author
dangoo
committed
Add Intl.NumberFormat.formatToParts types
1 parent 392b7ea commit 48e1a89

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/lib/esnext.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/// <reference lib="esnext.asynciterable" />
33
/// <reference lib="esnext.array" />
44
/// <reference lib="esnext.symbol" />
5+
/// <reference lib="esnext.intl" />

src/lib/esnext.intl.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
declare namespace Intl {
2+
type NumberFormatPartTypes = "currency" | "decimal" | "fraction" | "group" | "infinity" | "integer" | "literal" | "minusSign" | "nan" | "plusSign" | "percentSign";
3+
4+
interface NumberFormatPart {
5+
type: NumberFormatPartTypes;
6+
value: string;
7+
}
8+
9+
interface NumberFormat {
10+
formatToParts(number?: number): NumberFormatPart[];
11+
}
12+
}

0 commit comments

Comments
 (0)