|
1 | 1 | type t
|
2 | 2 |
|
| 3 | +type options = { |
| 4 | + localeMathcer?: [#lookup | #"best fit"], |
| 5 | + numberingSystem?: string, |
| 6 | + compactDisplay?: [#compact | #short | #long], |
| 7 | + currency?: string, |
| 8 | + currencyDisplay?: [#symbol | #narrowSymbol | #code | #name], |
| 9 | + currencySign?: [#standard | #accounting], |
| 10 | + notation?: [#standard | #scientific | #engineering | #compact], |
| 11 | + signDisplay?: [#auto | #always | #exceptZero | #negative | #never], |
| 12 | + style?: [#decimal | #currency | #percent | #unit], |
| 13 | + unit?: string, |
| 14 | + unitDisplay?: [#long | #short | #narrow], |
| 15 | + useGrouping?: bool, // TODO: also [#always | #auto | #min2] |
| 16 | + roundingMode?: [ |
| 17 | + | #ceil |
| 18 | + | #floot |
| 19 | + | #expand |
| 20 | + | #trunc |
| 21 | + | #halfCeil |
| 22 | + | #halfFloor |
| 23 | + | #haldExpand |
| 24 | + | #halfTrunc |
| 25 | + | #halfEven |
| 26 | + ], |
| 27 | + roundingPriority?: [#auto | #morePrecision | #lessPrecision], |
| 28 | + roundingIncrement?: int, |
| 29 | + trailingZeroDisplay?: [#auto | #stripIfInteger], |
| 30 | + minimumIntegerDigits?: int, |
| 31 | + minimumFractionDigits?: int, |
| 32 | + maximumFractionDigits?: int, |
| 33 | + minimumSignificantDigits?: int, |
| 34 | + maximumSignificantDigits?: int, |
| 35 | +} |
| 36 | + |
3 | 37 | @new external make: unit => t = "Intl.NumberFormat"
|
4 | 38 | @new external makeWithLocale: string => t = "Intl.NumberFormat"
|
5 | 39 | @new external makeWithLocales: array<string> => t = "Intl.NumberFormat"
|
6 |
| -@new external makeWithLocaleAndOptions: (string, {..}) => t = "Intl.NumberFormat" |
7 |
| -@new external makeWithLocalesAndOptions: (array<string>, {..}) => t = "Intl.NumberFormat" |
8 |
| -@new external makeWithOptions: (@as(json`undefined`) _, {..}) => t = "Intl.NumberFormat" |
| 40 | +@new external makeWithLocaleAndOptions: (string, options) => t = "Intl.NumberFormat" |
| 41 | +@new external makeWithLocalesAndOptions: (array<string>, options) => t = "Intl.NumberFormat" |
| 42 | +@new external makeWithOptions: (@as(json`undefined`) _, options) => t = "Intl.NumberFormat" |
9 | 43 |
|
10 | 44 | @val external supportedLocalesOf: array<string> => t = "Intl.NumberFormat.supportedLocalesOf"
|
11 | 45 | @val
|
12 |
| -external supportedLocalesOfWithOptions: (array<string>, {..}) => t = |
| 46 | +external supportedLocalesOfWithOptions: (array<string>, options) => t = |
13 | 47 | "Intl.NumberFormat.supportedLocalesOf"
|
14 | 48 |
|
15 |
| -@send external resolvedOptions: t => {..} = "resolvedOptions" |
| 49 | +@send external resolvedOptions: t => options = "resolvedOptions" |
16 | 50 |
|
17 | 51 | @send external format: (t, float) => string = "format"
|
18 | 52 | @send
|
|
0 commit comments