-
Notifications
You must be signed in to change notification settings - Fork 0
/
typings.d.ts
50 lines (37 loc) · 1.21 KB
/
typings.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
declare namespace Intl {
function getCanonicalLocales(locales: string | string[] | undefined): string[];
type Locale = string;
type Locales = Locale[];
type Type = "conjunction" | "disjunction" | "unit";
type Style = "long" | "short" | "narrow";
type LocaleMatcher = "lookup" | "best fit";
interface ListFormatOptions {
type: Type;
style: Style;
localeMatcher: LocaleMatcher;
}
interface ResolvedListFormatOptions {
type: Type;
style: Style;
locale: Locale;
}
interface ElementPartition {
type: "element";
value: ListPartition[] | string;
}
interface ListPartitionBase {
value: string;
}
interface LiteralPartition extends ListPartitionBase {
type: "literal";
}
type ListPartition = ElementPartition | LiteralPartition;
type ListPartitions = ReadonlyArray<ListPartition>;
class ListFormat {
constructor(locales?: Locale | Locales | undefined, options?: Partial<ListFormatOptions>);
public static supportedLocalesOf(locales: Locale | Locales, options?: Intl.SupportedLocalesOptions | undefined): Locales;
public format(list?: Iterable<string>): string;
public formatToParts(list?: Iterable<string>): ListPartitions;
public resolvedOptions(): ResolvedListFormatOptions;
}
}