|
1 | 1 | type t
|
2 | 2 |
|
| 3 | +type options = { |
| 4 | + localeMathcer?: [#lookup | #"best fit"], |
| 5 | + calendar?: string, |
| 6 | + numberingSystem?: string, |
| 7 | + hour12?: bool, |
| 8 | + hourCycle?: [#h11 | #h12 | #h23 | #h24], |
| 9 | + timeZone?: string, |
| 10 | + weekday?: [#long | #short | #narrow], |
| 11 | + era?: [#long | #short | #narrow], |
| 12 | + year?: [#numeric | #"2-digit"], |
| 13 | + month?: [#numeric | #"2-digit" | #long | #short | #narrow], |
| 14 | + day?: [#numeric | #"2-digit"], |
| 15 | + dayPeriod?: [#long | #short | #narrow], |
| 16 | + hour?: [#numeric | #"2-digit"], |
| 17 | + minute?: [#numeric | #"2-digit"], |
| 18 | + second?: [#numeric | #"2-digit"], |
| 19 | + fractionalSecondDigits?: int, |
| 20 | + timeZoneName?: [#long | #short | #shortOffset | #longOffset | #shortGeneric | #longGeneric], |
| 21 | + formatMatcher?: [#basic | #"best fit"], |
| 22 | + dateStyle?: [#full | #long | #medium | #short], |
| 23 | + timeStyle?: [#full | #long | #medium | #short], |
| 24 | +} |
| 25 | + |
3 | 26 | @new external make: unit => t = "Intl.DateTimeFormat"
|
4 | 27 | @new external makeWithLocale: string => t = "Intl.DateTimeFormat"
|
5 | 28 | @new external makeWithLocales: array<string> => t = "Intl.DateTimeFormat"
|
6 |
| -@new external makeWithLocaleAndOptions: (string, {..}) => t = "Intl.DateTimeFormat" |
7 |
| -@new external makeWithLocalesAndOptions: (array<string>, {..}) => t = "Intl.DateTimeFormat" |
8 |
| -@new external makeWithOptions: (@as(json`undefined`) _, {..}) => t = "Intl.DateTimeFormat" |
| 29 | +@new external makeWithLocaleAndOptions: (string, options) => t = "Intl.DateTimeFormat" |
| 30 | +@new external makeWithLocalesAndOptions: (array<string>, options) => t = "Intl.DateTimeFormat" |
| 31 | +@new external makeWithOptions: (@as(json`undefined`) _, options) => t = "Intl.DateTimeFormat" |
9 | 32 |
|
10 | 33 | @val external supportedLocalesOf: array<string> => t = "Intl.DateTimeFormat.supportedLocalesOf"
|
11 | 34 | @val
|
12 |
| -external supportedLocalesOfWithOptions: (array<string>, {..}) => t = |
| 35 | +external supportedLocalesOfWithOptions: (array<string>, options) => t = |
13 | 36 | "Intl.DateTimeFormat.supportedLocalesOf"
|
14 | 37 |
|
15 |
| -@send external resolvedOptions: t => {..} = "resolvedOptions" |
| 38 | +@send external resolvedOptions: t => options = "resolvedOptions" |
16 | 39 |
|
17 | 40 | @send external format: (t, Core__Date.t) => string = "format"
|
18 | 41 | @send
|
|
0 commit comments