@types/intl-unofficial-duration-unit-format
TypeScript icon, indicating that this package has built-in type declarations

3.1.4 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/intl-unofficial-duration-unit-format

Weekly Downloads

720

Version

3.1.4

License

MIT

Unpacked Size

5.07 kB

Total Files

5

Last publish

Collaborators

  • types