@formatjs/intl-durationformat 0.7.5 → 0.8.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 +1 -1
- package/index.js +1 -4
- package/package.json +10 -4
- package/polyfill-force.js +2 -4
- package/polyfill.js +4 -6
- package/should-polyfill.js +1 -4
- package/src/abstract/DurationRecordSign.d.ts +1 -1
- package/src/abstract/DurationRecordSign.js +3 -6
- package/src/abstract/GetDurationUnitOptions.js +4 -7
- package/src/abstract/IsValidDurationRecord.d.ts +1 -1
- package/src/abstract/IsValidDurationRecord.js +7 -10
- package/src/abstract/PartitionDurationFormatPattern.d.ts +2 -2
- package/src/abstract/PartitionDurationFormatPattern.js +13 -16
- package/src/abstract/ToDurationRecord.d.ts +1 -1
- package/src/abstract/ToDurationRecord.js +14 -17
- package/src/abstract/ToIntegerIfIntegral.js +4 -7
- package/src/constants.d.ts +1 -1
- package/src/constants.js +2 -5
- package/src/core.d.ts +2 -2
- package/src/core.js +33 -38
- package/src/get_internal_slots.d.ts +1 -1
- package/src/get_internal_slots.js +1 -4
- package/src/numbering-systems.generated.js +1 -4
- package/src/time-separators.generated.js +1 -4
- package/src/types.d.ts +2 -2
- package/src/types.js +1 -2
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/polyfill-force.d.ts +0 -1
- package/lib/polyfill-force.js +0 -18
- package/lib/polyfill.d.ts +0 -1
- package/lib/polyfill.js +0 -21
- package/lib/should-polyfill.d.ts +0 -1
- package/lib/should-polyfill.js +0 -3
- package/lib/src/abstract/DurationRecordSign.d.ts +0 -2
- package/lib/src/abstract/DurationRecordSign.js +0 -13
- package/lib/src/abstract/GetDurationUnitOptions.d.ts +0 -4
- package/lib/src/abstract/GetDurationUnitOptions.js +0 -43
- package/lib/src/abstract/IsValidDurationRecord.d.ts +0 -2
- package/lib/src/abstract/IsValidDurationRecord.js +0 -18
- package/lib/src/abstract/PartitionDurationFormatPattern.d.ts +0 -3
- package/lib/src/abstract/PartitionDurationFormatPattern.js +0 -149
- package/lib/src/abstract/ToDurationRecord.d.ts +0 -2
- package/lib/src/abstract/ToDurationRecord.js +0 -68
- package/lib/src/abstract/ToIntegerIfIntegral.d.ts +0 -1
- package/lib/src/abstract/ToIntegerIfIntegral.js +0 -6
- package/lib/src/constants.d.ts +0 -63
- package/lib/src/constants.js +0 -84
- package/lib/src/core.d.ts +0 -14
- package/lib/src/core.js +0 -236
- package/lib/src/get_internal_slots.d.ts +0 -2
- package/lib/src/get_internal_slots.js +0 -9
- package/lib/src/numbering-systems.generated.d.ts +0 -1
- package/lib/src/numbering-systems.generated.js +0 -1
- package/lib/src/time-separators.generated.d.ts +0 -2219
- package/lib/src/time-separators.generated.js +0 -3701
- package/lib/src/types.d.ts +0 -108
- package/lib/src/types.js +0 -2
package/lib/src/types.d.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
export type DurationFormatOptions = Partial<ResolvedDurationFormatOptions>;
|
|
2
|
-
export interface ResolvedDurationFormatOptions {
|
|
3
|
-
localeMatcher: 'best fit' | 'lookup';
|
|
4
|
-
style: 'long' | 'short' | 'narrow' | 'digital';
|
|
5
|
-
years: 'long' | 'short' | 'narrow';
|
|
6
|
-
yearsDisplay: 'always' | 'auto';
|
|
7
|
-
months: 'long' | 'short' | 'narrow';
|
|
8
|
-
monthsDisplay: 'always' | 'auto';
|
|
9
|
-
weeks: 'long' | 'short' | 'narrow';
|
|
10
|
-
weeksDisplay: 'always' | 'auto';
|
|
11
|
-
days: 'long' | 'short' | 'narrow';
|
|
12
|
-
daysDisplay: 'always' | 'auto';
|
|
13
|
-
hours: 'long' | 'short' | 'narrow' | 'numeric';
|
|
14
|
-
hoursDisplay: 'always' | 'auto';
|
|
15
|
-
minutes: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit';
|
|
16
|
-
minutesDisplay: 'always' | 'auto';
|
|
17
|
-
seconds: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit';
|
|
18
|
-
secondsDisplay: 'always' | 'auto';
|
|
19
|
-
milliseconds: 'long' | 'short' | 'narrow' | 'numeric';
|
|
20
|
-
millisecondsDisplay: 'always' | 'auto';
|
|
21
|
-
microseconds: 'long' | 'short' | 'narrow' | 'numeric';
|
|
22
|
-
microsecondsDisplay: 'always' | 'auto';
|
|
23
|
-
nanoseconds: 'long' | 'short' | 'narrow' | 'numeric';
|
|
24
|
-
nanosecondsDisplay: 'always' | 'auto';
|
|
25
|
-
fractionalDigits?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
26
|
-
numberingSystem: string;
|
|
27
|
-
round: boolean;
|
|
28
|
-
}
|
|
29
|
-
export interface DurationFormatPart {
|
|
30
|
-
unit?: string;
|
|
31
|
-
type: unknown;
|
|
32
|
-
value: string;
|
|
33
|
-
}
|
|
34
|
-
export interface RawDurationLocaleData {
|
|
35
|
-
data: DurationFormatLocaleInternalData;
|
|
36
|
-
locale: string;
|
|
37
|
-
}
|
|
38
|
-
export interface DurationFormatLocaleInternalData {
|
|
39
|
-
nu: readonly string[];
|
|
40
|
-
digitalFormat: Record<string, string>;
|
|
41
|
-
}
|
|
42
|
-
export interface DurationFormat {
|
|
43
|
-
resolvedOptions(): ResolvedDurationFormatOptions;
|
|
44
|
-
formatToParts(duration: DurationInput): DurationFormatPart[];
|
|
45
|
-
format(duration: DurationInput): string;
|
|
46
|
-
}
|
|
47
|
-
export interface IntlDurationFormatInternal {
|
|
48
|
-
initializedDurationFormat: boolean;
|
|
49
|
-
fractionalDigits: number | undefined;
|
|
50
|
-
dataLocale: string;
|
|
51
|
-
locale: string;
|
|
52
|
-
numberingSystem: string;
|
|
53
|
-
style: DurationFormatOptions['style'];
|
|
54
|
-
years: 'long' | 'short' | 'narrow';
|
|
55
|
-
yearsDisplay: 'always' | 'auto';
|
|
56
|
-
months: 'long' | 'short' | 'narrow';
|
|
57
|
-
monthsDisplay: 'always' | 'auto';
|
|
58
|
-
weeks: 'long' | 'short' | 'narrow';
|
|
59
|
-
weeksDisplay: 'always' | 'auto';
|
|
60
|
-
days: 'long' | 'short' | 'narrow';
|
|
61
|
-
daysDisplay: 'always' | 'auto';
|
|
62
|
-
hours: 'long' | 'short' | 'narrow' | 'numeric';
|
|
63
|
-
hoursDisplay: 'always' | 'auto';
|
|
64
|
-
minutes: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit';
|
|
65
|
-
minutesDisplay: 'always' | 'auto';
|
|
66
|
-
seconds: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit';
|
|
67
|
-
secondsDisplay: 'always' | 'auto';
|
|
68
|
-
milliseconds: 'long' | 'short' | 'narrow' | 'numeric';
|
|
69
|
-
millisecondsDisplay: 'always' | 'auto';
|
|
70
|
-
microseconds: 'long' | 'short' | 'narrow' | 'numeric';
|
|
71
|
-
microsecondsDisplay: 'always' | 'auto';
|
|
72
|
-
nanoseconds: 'long' | 'short' | 'narrow' | 'numeric';
|
|
73
|
-
nanosecondsDisplay: 'always' | 'auto';
|
|
74
|
-
}
|
|
75
|
-
export interface DurationInput {
|
|
76
|
-
years?: number;
|
|
77
|
-
months?: number;
|
|
78
|
-
weeks?: number;
|
|
79
|
-
days?: number;
|
|
80
|
-
hours?: number;
|
|
81
|
-
minutes?: number;
|
|
82
|
-
seconds?: number;
|
|
83
|
-
milliseconds?: number;
|
|
84
|
-
microseconds?: number;
|
|
85
|
-
nanoseconds?: number;
|
|
86
|
-
}
|
|
87
|
-
export interface DurationRecord {
|
|
88
|
-
years: number;
|
|
89
|
-
months: number;
|
|
90
|
-
weeks: number;
|
|
91
|
-
days: number;
|
|
92
|
-
hours: number;
|
|
93
|
-
minutes: number;
|
|
94
|
-
seconds: number;
|
|
95
|
-
milliseconds: number;
|
|
96
|
-
microseconds: number;
|
|
97
|
-
nanoseconds: number;
|
|
98
|
-
}
|
|
99
|
-
export interface DurationFormatConstructor {
|
|
100
|
-
new (locales?: string | string[], options?: DurationFormatOptions): DurationFormat;
|
|
101
|
-
(locales?: string | string[], options?: DurationFormatOptions): DurationFormat;
|
|
102
|
-
supportedLocalesOf(locales: string | string[], options?: Pick<DurationFormatOptions, 'localeMatcher'>): string[];
|
|
103
|
-
getDefaultLocale(): string;
|
|
104
|
-
__defaultLocale: string;
|
|
105
|
-
localeData: Record<string, DurationFormatLocaleInternalData | undefined>;
|
|
106
|
-
availableLocales: Set<string>;
|
|
107
|
-
polyfilled: boolean;
|
|
108
|
-
}
|
package/lib/src/types.js
DELETED