-
Notifications
You must be signed in to change notification settings - Fork 190
Expand file tree
/
Copy pathduration-format-ponyfill.d.ts
More file actions
34 lines (34 loc) · 1.32 KB
/
duration-format-ponyfill.d.ts
File metadata and controls
34 lines (34 loc) · 1.32 KB
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
import type { Duration } from './duration.js';
interface DurationFormatResolvedOptions {
locale: string;
style: 'long' | 'short' | 'narrow' | 'digital';
years: 'long' | 'short' | 'narrow';
yearsDisplay: 'always' | 'auto';
months: 'long' | 'short' | 'narrow';
monthsDisplay: 'always' | 'auto';
weeks: 'long' | 'short' | 'narrow';
weeksDisplay: 'always' | 'auto';
days: 'long' | 'short' | 'narrow';
daysDisplay: 'always' | 'auto';
hours: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit';
hoursDisplay: 'always' | 'auto';
minutes: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit';
minutesDisplay: 'always' | 'auto';
seconds: 'long' | 'short' | 'narrow' | 'numeric' | '2-digit';
secondsDisplay: 'always' | 'auto';
milliseconds: 'long' | 'short' | 'narrow' | 'numeric';
millisecondsDisplay: 'always' | 'auto';
}
export type DurationFormatOptions = Partial<Omit<DurationFormatResolvedOptions, 'locale'>>;
interface DurationPart {
type: 'integer' | 'literal' | 'element';
value: string;
}
export default class DurationFormat {
#private;
constructor(locale: string, options?: DurationFormatOptions);
resolvedOptions(): DurationFormatResolvedOptions;
formatToParts(duration: Duration): DurationPart[];
format(duration: Duration): string;
}
export {};