Installation
npm install --save @types/intl-unofficial-duration-unit-format
Summary
This package contains type definitions for intl-unofficial-duration-unit-format (https://github.com/piuccio/intl-unofficial-duration-unit-format).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/intl-unofficial-duration-unit-format.
index.d.ts
export type DurationUnitFormatStyle = typeof DurationUnitFormat.styles[keyof typeof DurationUnitFormat.styles];
export type DurationUnitFormatUnit = typeof DurationUnitFormat.units[keyof typeof DurationUnitFormat.units];
export type DurationUnitFormatPartType = DurationUnitFormatUnit | "literal" | "group" | "unit";
export interface DurationUnitFormatPart {
type: DurationUnitFormatPartType;
value: string;
}
export interface DurationUnitFormatOptions {
style?: DurationUnitFormatStyle;
format?: string;
formatDuration?: string;
formatUnits?: Record<DurationUnitFormatUnit, string>;
round?: boolean;
}
export default class DurationUnitFormat {
constructor(locales?: string | readonly string[], options?: DurationUnitFormatOptions);
static styles: {
CUSTOM: "custom";
TIMER: "timer";
LONG: "long";
SHORT: "short";
NARROW: "narrow";
};
static units: {
DAY: "day";
HOUR: "hour";
MINUTE: "minute";
SECOND: "second";
};
format: (value: number) => string;
formatToParts: (value: number) => DurationUnitFormatPart[];
}
Additional Details
- Last updated: Mon, 20 Nov 2023 23:36:24 GMT
- Dependencies: none
Credits
These definitions were written by Maxim Khvatalin.