|
1 | 1 | type t
|
2 | 2 |
|
| 3 | +type usage = [#sort | #search] |
| 4 | +type sensitivity = [#base | #accent | #case | #variant] |
| 5 | +type caseFirst = [#upper | #lower | #"false"] |
| 6 | + |
| 7 | +type options = { |
| 8 | + localeMatcher?: Core__Intl__Common.localeMatcher, |
| 9 | + usage?: usage, |
| 10 | + sensitivity?: sensitivity, |
| 11 | + ignorePunctuation?: bool, |
| 12 | + numeric?: bool, |
| 13 | + caseFirst?: caseFirst, |
| 14 | +} |
| 15 | + |
| 16 | +type resolvedOptions = { |
| 17 | + locale: string, |
| 18 | + usage: usage, |
| 19 | + sensitivity: sensitivity, |
| 20 | + ignorePunctuation: bool, |
| 21 | + collation: [Core__Intl__Common.collation | #default], |
| 22 | + numeric?: bool, |
| 23 | + caseFirst?: caseFirst, |
| 24 | +} |
| 25 | + |
| 26 | +type supportedLocalesOptions = {localeMatcher: Core__Intl__Common.localeMatcher} |
| 27 | + |
3 | 28 | @new external make: unit => t = "Intl.Collator"
|
4 | 29 | @new external makeWithLocale: string => t = "Intl.Collator"
|
5 | 30 | @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" |
| 31 | +@new external makeWithLocaleAndOptions: (string, options) => t = "Intl.Collator" |
| 32 | +@new external makeWithLocalesAndOptions: (array<string>, options) => t = "Intl.Collator" |
| 33 | +@new external makeWithOptions: (@as(json`undefined`) _, options) => t = "Intl.Collator" |
9 | 34 |
|
10 | 35 | @val external supportedLocalesOf: array<string> => t = "Intl.Collator.supportedLocalesOf"
|
11 | 36 | @val
|
12 |
| -external supportedLocalesOfWithOptions: (array<string>, {..}) => t = |
| 37 | +external supportedLocalesOfWithOptions: (array<string>, supportedLocalesOptions) => t = |
13 | 38 | "Intl.Collator.supportedLocalesOf"
|
14 | 39 |
|
15 |
| -@send external resolvedOptions: t => {..} = "resolvedOptions" |
| 40 | +@send external resolvedOptions: t => resolvedOptions = "resolvedOptions" |
16 | 41 |
|
17 | 42 | @send external compare: (t, string, string) => int = "compare"
|
0 commit comments