@formatjs/intl-durationformat 0.10.8 → 0.10.9
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 +55 -1
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -11,6 +11,18 @@ interface DurationInput {
|
|
|
11
11
|
microseconds?: number;
|
|
12
12
|
nanoseconds?: number;
|
|
13
13
|
}
|
|
14
|
+
interface DurationRecord {
|
|
15
|
+
years: number;
|
|
16
|
+
months: number;
|
|
17
|
+
weeks: number;
|
|
18
|
+
days: number;
|
|
19
|
+
hours: number;
|
|
20
|
+
minutes: number;
|
|
21
|
+
seconds: number;
|
|
22
|
+
milliseconds: number;
|
|
23
|
+
microseconds: number;
|
|
24
|
+
nanoseconds: number;
|
|
25
|
+
}
|
|
14
26
|
//#endregion
|
|
15
27
|
//#region packages/intl-durationformat/types.d.ts
|
|
16
28
|
type DurationFormatOptions = Partial<ResolvedDurationFormatOptions>;
|
|
@@ -46,6 +58,10 @@ interface DurationFormatPart {
|
|
|
46
58
|
type: unknown;
|
|
47
59
|
value: string;
|
|
48
60
|
}
|
|
61
|
+
interface RawDurationLocaleData {
|
|
62
|
+
data: DurationFormatLocaleInternalData;
|
|
63
|
+
locale: string;
|
|
64
|
+
}
|
|
49
65
|
interface DurationFormatLocaleInternalData {
|
|
50
66
|
nu: readonly string[];
|
|
51
67
|
digitalFormat: Record<string, string>;
|
|
@@ -55,6 +71,44 @@ interface DurationFormat$1 {
|
|
|
55
71
|
formatToParts(duration: DurationInput): DurationFormatPart[];
|
|
56
72
|
format(duration: DurationInput): string;
|
|
57
73
|
}
|
|
74
|
+
interface IntlDurationFormatInternal {
|
|
75
|
+
initializedDurationFormat: boolean;
|
|
76
|
+
fractionalDigits: number | undefined;
|
|
77
|
+
dataLocale: string;
|
|
78
|
+
locale: string;
|
|
79
|
+
numberingSystem: string;
|
|
80
|
+
style: DurationFormatOptions["style"];
|
|
81
|
+
years: "long" | "short" | "narrow";
|
|
82
|
+
yearsDisplay: "always" | "auto";
|
|
83
|
+
months: "long" | "short" | "narrow";
|
|
84
|
+
monthsDisplay: "always" | "auto";
|
|
85
|
+
weeks: "long" | "short" | "narrow";
|
|
86
|
+
weeksDisplay: "always" | "auto";
|
|
87
|
+
days: "long" | "short" | "narrow";
|
|
88
|
+
daysDisplay: "always" | "auto";
|
|
89
|
+
hours: "long" | "short" | "narrow" | "numeric" | "2-digit";
|
|
90
|
+
hoursDisplay: "always" | "auto";
|
|
91
|
+
minutes: "long" | "short" | "narrow" | "numeric" | "2-digit";
|
|
92
|
+
minutesDisplay: "always" | "auto";
|
|
93
|
+
seconds: "long" | "short" | "narrow" | "numeric" | "2-digit";
|
|
94
|
+
secondsDisplay: "always" | "auto";
|
|
95
|
+
milliseconds: "long" | "short" | "narrow" | "numeric";
|
|
96
|
+
millisecondsDisplay: "always" | "auto";
|
|
97
|
+
microseconds: "long" | "short" | "narrow" | "numeric";
|
|
98
|
+
microsecondsDisplay: "always" | "auto";
|
|
99
|
+
nanoseconds: "long" | "short" | "narrow" | "numeric";
|
|
100
|
+
nanosecondsDisplay: "always" | "auto";
|
|
101
|
+
}
|
|
102
|
+
interface DurationFormatConstructor {
|
|
103
|
+
new (locales?: string | string[], options?: DurationFormatOptions): DurationFormat$1;
|
|
104
|
+
(locales?: string | string[], options?: DurationFormatOptions): DurationFormat$1;
|
|
105
|
+
supportedLocalesOf(locales: string | string[], options?: Pick<DurationFormatOptions, "localeMatcher">): string[];
|
|
106
|
+
getDefaultLocale(): string;
|
|
107
|
+
__defaultLocale: string;
|
|
108
|
+
localeData: Record<string, DurationFormatLocaleInternalData | undefined>;
|
|
109
|
+
availableLocales: Set<string>;
|
|
110
|
+
polyfilled: boolean;
|
|
111
|
+
}
|
|
58
112
|
//#endregion
|
|
59
113
|
//#region packages/intl-durationformat/core.d.ts
|
|
60
114
|
/**
|
|
@@ -74,5 +128,5 @@ declare class DurationFormat implements DurationFormat$1 {
|
|
|
74
128
|
static polyfilled: boolean;
|
|
75
129
|
}
|
|
76
130
|
//#endregion
|
|
77
|
-
export { DurationFormat };
|
|
131
|
+
export { DurationFormat, type DurationFormatConstructor, type DurationFormatLocaleInternalData, type DurationFormatOptions, type DurationFormatPart, type DurationInput, type DurationRecord, type IntlDurationFormatInternal, type RawDurationLocaleData, type ResolvedDurationFormatOptions };
|
|
78
132
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-durationformat",
|
|
3
3
|
"description": "Intl.DurationFormat polyfill",
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.9",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Long Ho <holevietlong@gmail.com>",
|
|
7
7
|
"type": "module",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"./should-polyfill.js": "./should-polyfill.js"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@formatjs/
|
|
17
|
-
"@formatjs/
|
|
16
|
+
"@formatjs/bigdecimal": "0.2.4",
|
|
17
|
+
"@formatjs/intl-localematcher": "0.8.7"
|
|
18
18
|
},
|
|
19
19
|
"bugs": "https://github.com/formatjs/formatjs/issues",
|
|
20
20
|
"homepage": "https://github.com/formatjs/formatjs#readme",
|