|
1 | 1 | type t
|
2 | 2 |
|
| 3 | +type options = { |
| 4 | + usage?: [#sort | #search], |
| 5 | + localeMathcer?: [#lookup | #"best fit"], |
| 6 | + collation?: string, |
| 7 | + numeric?: bool, |
| 8 | + caseFirst?: [#upper | #lower | #"false"], |
| 9 | + sensitivity?: [#base | #accent | #case | #variant], |
| 10 | + ignorePunctuation?: bool, |
| 11 | +} |
| 12 | + |
3 | 13 | @new external make: unit => t = "Intl.Collator"
|
4 | 14 | @new external makeWithLocale: string => t = "Intl.Collator"
|
5 | 15 | @new external makeWithLocales: array<string> => t = "Intl.Collator"
|
6 |
| -@new external makeWithLocaleAndOptions: (string, {..}) => t = "Intl.Collator" |
7 |
| -@new external makeWithLocalesAndOptions: (array<string>, {..}) => t = "Intl.Collator" |
8 |
| -@new external makeWithOptions: (@as(json`undefined`) _, {..}) => t = "Intl.Collator" |
| 16 | +@new external makeWithLocaleAndOptions: (string, options) => t = "Intl.Collator" |
| 17 | +@new external makeWithLocalesAndOptions: (array<string>, options) => t = "Intl.Collator" |
| 18 | +@new external makeWithOptions: (@as(json`undefined`) _, options) => t = "Intl.Collator" |
9 | 19 |
|
10 | 20 | @val external supportedLocalesOf: array<string> => t = "Intl.Collator.supportedLocalesOf"
|
11 | 21 | @val
|
12 |
| -external supportedLocalesOfWithOptions: (array<string>, {..}) => t = |
| 22 | +external supportedLocalesOfWithOptions: (array<string>, options) => t = |
13 | 23 | "Intl.Collator.supportedLocalesOf"
|
14 | 24 |
|
15 |
| -@send external resolvedOptions: t => {..} = "resolvedOptions" |
| 25 | +@send external resolvedOptions: t => options = "resolvedOptions" |
16 | 26 |
|
17 | 27 | @send external compare: (t, string, string) => int = "compare"
|
0 commit comments