@formatjs/intl-getcanonicallocales 3.2.2 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,5 +1,57 @@
1
- export declare function getCanonicalLocales(locales?: string[] | string | Intl.Locale | Intl.Locale[] | ArrayLike<string | Intl.Locale>): string[];
2
- export * from "./src/emitter.js";
3
- export { isStructurallyValidLanguageTag, isUnicodeLanguageSubtag, isUnicodeRegionSubtag, isUnicodeScriptSubtag, parseUnicodeLanguageId, parseUnicodeLocaleId } from "./src/parser.js";
4
- export * from "./src/types.js";
5
- export * from "./src/likelySubtags.generated.js";
1
+ //#region packages/intl-getcanonicallocales/types.d.ts
2
+ interface UnicodeLocaleId {
3
+ lang: UnicodeLanguageId;
4
+ extensions: Array<UnicodeExtension | TransformedExtension | PuExtension | OtherExtension>;
5
+ }
6
+ interface UnicodeLanguageId {
7
+ lang: string;
8
+ script?: string;
9
+ region?: string;
10
+ variants: string[];
11
+ }
12
+ type KV = [string, string] | [string];
13
+ interface Extension {
14
+ type: string;
15
+ }
16
+ interface UnicodeExtension extends Extension {
17
+ type: "u";
18
+ keywords: KV[];
19
+ attributes: string[];
20
+ }
21
+ interface TransformedExtension extends Extension {
22
+ type: "t";
23
+ fields: KV[];
24
+ lang?: UnicodeLanguageId;
25
+ }
26
+ interface PuExtension extends Extension {
27
+ type: "x";
28
+ value: string;
29
+ }
30
+ interface OtherExtension extends Extension {
31
+ type: "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "v" | "w" | "y" | "z";
32
+ value: string;
33
+ }
34
+ //#endregion
35
+ //#region packages/intl-getcanonicallocales/emitter.d.ts
36
+ declare function emitUnicodeLanguageId(lang?: UnicodeLanguageId): string;
37
+ declare function emitUnicodeLocaleId({
38
+ lang,
39
+ extensions
40
+ }: UnicodeLocaleId): string;
41
+ //#endregion
42
+ //#region packages/intl-getcanonicallocales/parser.d.ts
43
+ declare function isUnicodeLanguageSubtag(lang: string): boolean;
44
+ declare function isStructurallyValidLanguageTag(tag: string): boolean;
45
+ declare function isUnicodeRegionSubtag(region: string): boolean;
46
+ declare function isUnicodeScriptSubtag(script: string): boolean;
47
+ declare function parseUnicodeLanguageId(chunks: string[] | string): UnicodeLanguageId;
48
+ declare function parseUnicodeLocaleId(locale: string): UnicodeLocaleId;
49
+ //#endregion
50
+ //#region packages/intl-getcanonicallocales/likelySubtags.generated.d.ts
51
+ declare const likelySubtags: Record<string, string>;
52
+ //#endregion
53
+ //#region packages/intl-getcanonicallocales/index.d.ts
54
+ declare function getCanonicalLocales(locales?: string[] | string | Intl.Locale | Intl.Locale[] | ArrayLike<string | Intl.Locale>): string[];
55
+ //#endregion
56
+ export { Extension, KV, OtherExtension, PuExtension, TransformedExtension, UnicodeExtension, UnicodeLanguageId, UnicodeLocaleId, emitUnicodeLanguageId, emitUnicodeLocaleId, getCanonicalLocales, isStructurallyValidLanguageTag, isUnicodeLanguageSubtag, isUnicodeRegionSubtag, isUnicodeScriptSubtag, likelySubtags, parseUnicodeLanguageId, parseUnicodeLocaleId };
57
+ //# sourceMappingURL=index.d.ts.map