@formatjs/intl-locale 5.1.1 → 5.2.0

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,103 +1,105 @@
1
1
  export interface IntlLocaleOptions {
2
- language?: string;
3
- script?: string;
4
- region?: string;
5
- calendar?: string;
6
- collation?: string;
7
- hourCycle?: 'h11' | 'h12' | 'h23' | 'h24';
8
- caseFirst?: 'upper' | 'lower' | 'false';
9
- numberingSystem?: string;
10
- numeric?: boolean;
11
- firstDayOfWeek?: string;
2
+ language?: string;
3
+ script?: string;
4
+ region?: string;
5
+ calendar?: string;
6
+ collation?: string;
7
+ hourCycle?: "h11" | "h12" | "h23" | "h24";
8
+ caseFirst?: "upper" | "lower" | "false";
9
+ numberingSystem?: string;
10
+ numeric?: boolean;
11
+ firstDayOfWeek?: string;
12
12
  }
13
13
  export interface IntlLocaleInternal extends IntlLocaleOptions {
14
- locale: string;
15
- initializedLocale: boolean;
14
+ locale: string;
15
+ initializedLocale: boolean;
16
16
  }
17
17
  export declare class Locale {
18
- constructor(tag: string | Locale, opts?: IntlLocaleOptions);
19
- /**
20
- * https://www.unicode.org/reports/tr35/#Likely_Subtags
21
- */
22
- maximize(): Locale;
23
- /**
24
- * https://www.unicode.org/reports/tr35/#Likely_Subtags
25
- */
26
- minimize(): Locale;
27
- toString(): string;
28
- get baseName(): string;
29
- get calendar(): string | undefined;
30
- get collation(): string | undefined;
31
- get caseFirst(): 'upper' | 'lower' | 'false' | undefined;
32
- get numeric(): boolean | undefined;
33
- get numberingSystem(): string | undefined;
34
- /**
35
- * https://tc39.es/proposal-intl-locale/#sec-Intl.Locale.prototype.language
36
- */
37
- get language(): string;
38
- /**
39
- * https://tc39.es/proposal-intl-locale/#sec-Intl.Locale.prototype.script
40
- */
41
- get script(): string | undefined;
42
- /**
43
- * https://tc39.es/proposal-intl-locale/#sec-Intl.Locale.prototype.region
44
- */
45
- get region(): string | undefined;
46
- get firstDayOfWeek(): string | undefined;
47
- get hourCycle(): 'h11' | 'h12' | 'h23' | 'h24' | undefined;
48
- /**
49
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getCalendars
50
- * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getCalendars
51
- */
52
- getCalendars(): string[];
53
- /**
54
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getCollations
55
- * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getCollations
56
- */
57
- getCollations(): string[];
58
- /**
59
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getHourCycles
60
- * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getHourCycles
61
- */
62
- getHourCycles(): string[];
63
- /**
64
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getNumberingSystems
65
- * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getNumberingSystems
66
- */
67
- getNumberingSystems(): string[];
68
- /**
69
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTimeZones
70
- * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getTimeZones
71
- */
72
- getTimeZones(): string[] | undefined;
73
- /**
74
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo
75
- * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getTextInfo
76
- */
77
- getTextInfo(): {
78
- direction: string;
79
- };
80
- /**
81
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo
82
- * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getWeekInfo
83
- */
84
- getWeekInfo(): {
85
- firstDay: string;
86
- weekend: {
87
- start: string;
88
- end: string;
89
- };
90
- minimalDays: number;
91
- };
92
- static relevantExtensionKeys: readonly [
93
- 'ca',
94
- 'co',
95
- 'hc',
96
- 'kf',
97
- 'kn',
98
- 'nu',
99
- 'fw'
100
- ];
101
- static readonly polyfilled = true;
18
+ constructor(tag: string | Locale, opts?: IntlLocaleOptions);
19
+ /**
20
+ * https://www.unicode.org/reports/tr35/#Likely_Subtags
21
+ */
22
+ maximize(): Locale;
23
+ /**
24
+ * https://www.unicode.org/reports/tr35/#Likely_Subtags
25
+ */
26
+ minimize(): Locale;
27
+ toString(): string;
28
+ get baseName(): string;
29
+ get calendar(): string | undefined;
30
+ get collation(): string | undefined;
31
+ get caseFirst(): "upper" | "lower" | "false" | undefined;
32
+ get numeric(): boolean | undefined;
33
+ get numberingSystem(): string | undefined;
34
+ /**
35
+ * https://tc39.es/proposal-intl-locale/#sec-Intl.Locale.prototype.language
36
+ */
37
+ get language(): string;
38
+ /**
39
+ * https://tc39.es/proposal-intl-locale/#sec-Intl.Locale.prototype.script
40
+ */
41
+ get script(): string | undefined;
42
+ /**
43
+ * https://tc39.es/proposal-intl-locale/#sec-Intl.Locale.prototype.region
44
+ */
45
+ get region(): string | undefined;
46
+ /**
47
+ * Returns the variant subtags of the locale, or undefined if none exist.
48
+ * Multiple variants are joined with hyphens in alphabetical order.
49
+ *
50
+ * Added in ECMA-402 via PR #960 to align with other subtag accessors.
51
+ * @see https://tc39.es/ecma402/#sec-Intl.Locale.prototype.variants
52
+ * @see https://github.com/tc39/ecma402/pull/960
53
+ * @see https://github.com/tc39/ecma402/issues/900
54
+ */
55
+ get variants(): string | undefined;
56
+ get firstDayOfWeek(): string | undefined;
57
+ get hourCycle(): "h11" | "h12" | "h23" | "h24" | undefined;
58
+ /**
59
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getCalendars
60
+ * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getCalendars
61
+ */
62
+ getCalendars(): string[];
63
+ /**
64
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getCollations
65
+ * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getCollations
66
+ */
67
+ getCollations(): string[];
68
+ /**
69
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getHourCycles
70
+ * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getHourCycles
71
+ */
72
+ getHourCycles(): string[];
73
+ /**
74
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getNumberingSystems
75
+ * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getNumberingSystems
76
+ */
77
+ getNumberingSystems(): string[];
78
+ /**
79
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTimeZones
80
+ * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getTimeZones
81
+ */
82
+ getTimeZones(): string[] | undefined;
83
+ /**
84
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo
85
+ * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getTextInfo
86
+ */
87
+ getTextInfo(): {
88
+ direction: string;
89
+ };
90
+ /**
91
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo
92
+ * https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getWeekInfo
93
+ */
94
+ getWeekInfo(): {
95
+ firstDay: string;
96
+ weekend: {
97
+ start: string;
98
+ end: string;
99
+ };
100
+ minimalDays: number;
101
+ };
102
+ static relevantExtensionKeys: readonly ["ca", "co", "hc", "kf", "kn", "nu", "fw"];
103
+ static readonly polyfilled: true;
102
104
  }
103
105
  export default Locale;