Skip to content

Commit c030412

Browse files
feat: Intl.ListFormat
1 parent 2b265b4 commit c030412

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

src/intl/Core__Intl__ListFormat.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Generated by ReScript, PLEASE EDIT WITH CARE
2+
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */

src/intl/Core__Intl__ListFormat.res

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
type t
2+
3+
type listType = [
4+
| #conjunction
5+
| #disjunction
6+
| #unit
7+
]
8+
type style = [
9+
| #long
10+
| #short
11+
| #narrow
12+
]
13+
14+
type options = {
15+
localeMatcher?: Core__Intl__Common.localeMatcher,
16+
\"type"?: listType,
17+
style?: style,
18+
}
19+
20+
type listPartComponentType = [
21+
| #element
22+
| #literal
23+
]
24+
25+
type listPart = {
26+
\"type": listPartComponentType,
27+
value: string,
28+
}
29+
30+
type resolvedOptions = {
31+
locale: string,
32+
style: style,
33+
\"type": listType,
34+
}
35+
36+
type supportedLocalesOptions = {localeMatcher: Core__Intl__Common.localeMatcher}
37+
38+
@new external make: unit => t = "Intl.ListFormat"
39+
@new external makeWithLocale: string => t = "Intl.ListFormat"
40+
@new external makeWithLocales: array<string> => t = "Intl.ListFormat"
41+
@new external makeWithLocaleAndOptions: (string, options) => t = "Intl.ListFormat"
42+
@new external makeWithLocalesAndOptions: (array<string>, options) => t = "Intl.ListFormat"
43+
@new external makeWithOptions: (@as(json`undefined`) _, options) => t = "Intl.ListFormat"
44+
45+
@val external supportedLocalesOf: array<string> => t = "Intl.ListFormat.supportedLocalesOf"
46+
@val
47+
external supportedLocalesOfWithOptions: (array<string>, supportedLocalesOptions) => t =
48+
"Intl.ListFormat.supportedLocalesOf"
49+
50+
@send external resolvedOptions: t => resolvedOptions = "resolvedOptions"
51+
52+
@send external format: (t, array<string>) => string = "format"
53+
@send external formatToParts: (t, array<string>) => array<listPart> = "formatToParts"

0 commit comments

Comments
 (0)