|
1 | 1 | type t
|
2 | 2 |
|
| 3 | +type options = { |
| 4 | + localeMathcer?: [#lookup | #"best fit"], |
| 5 | + numberingSystem?: string, |
| 6 | + style?: [#long | #short | #narrow], |
| 7 | + numeric?: [#always | #auto], |
| 8 | +} |
| 9 | + |
3 | 10 | @new external make: unit => t = "Intl.RelativeTimeFormat"
|
4 | 11 | @new external makeWithLocale: string => t = "Intl.RelativeTimeFormat"
|
5 | 12 | @new external makeWithLocales: array<string> => t = "Intl.RelativeTimeFormat"
|
6 |
| -@new external makeWithLocaleAndOptions: (string, {..}) => t = "Intl.RelativeTimeFormat" |
7 |
| -@new external makeWithLocalesAndOptions: (array<string>, {..}) => t = "Intl.RelativeTimeFormat" |
8 |
| -@new external makeWithOptions: (@as(json`undefined`) _, {..}) => t = "Intl.RelativeTimeFormat" |
| 13 | +@new external makeWithLocaleAndOptions: (string, options) => t = "Intl.RelativeTimeFormat" |
| 14 | +@new external makeWithLocalesAndOptions: (array<string>, options) => t = "Intl.RelativeTimeFormat" |
| 15 | +@new external makeWithOptions: (@as(json`undefined`) _, options) => t = "Intl.RelativeTimeFormat" |
9 | 16 |
|
10 | 17 | @val
|
11 | 18 | external supportedLocalesOf: array<string> => t = "Intl.RelativeTimeFormat.supportedLocalesOf"
|
12 | 19 | @val
|
13 |
| -external supportedLocalesOfWithOptions: (array<string>, {..}) => t = |
| 20 | +external supportedLocalesOfWithOptions: (array<string>, options) => t = |
14 | 21 | "Intl.RelativeTimeFormat.supportedLocalesOf"
|
15 | 22 |
|
16 |
| -@send external resolvedOptions: t => {..} = "resolvedOptions" |
| 23 | +@send external resolvedOptions: t => options = "resolvedOptions" |
17 | 24 |
|
18 | 25 | type timeUnit = [#year | #quarter | #month | #week | #day | #hour | #minute | #second]
|
19 | 26 |
|
|
0 commit comments