@types/timestring
TypeScript icon, indicating that this package has built-in type declarations

6.0.5 • Public • Published

Installation

npm install --save @types/timestring

Summary

This package contains type definitions for timestring (https://github.com/mike182uk/timestring).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/timestring.

index.d.ts

declare function timestring(input: string, returnUnit?: timestring.ReturnUnit, opts?: timestring.Options): number;

declare namespace timestring {
    type ReturnUnit =
        | "ms"
        | "milli"
        | "millisecond"
        | "milliseconds"
        | "s"
        | "sec"
        | "secs"
        | "second"
        | "seconds"
        | "m"
        | "min"
        | "mins"
        | "minute"
        | "minutes"
        | "h"
        | "hr"
        | "hrs"
        | "hour"
        | "hours"
        | "d"
        | "day"
        | "days"
        | "w"
        | "week"
        | "weeks"
        | "mon"
        | "mth"
        | "mths"
        | "month"
        | "months"
        | "y"
        | "yr"
        | "yrs"
        | "year"
        | "years";

    interface Options {
        /**
         * @default 24
         */
        hoursPerDay?: number | undefined;
        /**
         * @default 7
         */
        daysPerWeek?: number | undefined;
        /**
         * @default 4
         */
        weeksPerMonth?: number | undefined;
        /**
         * @default 12
         */
        monthsPerYear?: number | undefined;
        /**
         * @default 365.25s
         */
        daysPerYear?: number | undefined;
    }
}

export = timestring;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Devin Spikowski.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/timestring

Weekly Downloads

4,918

Version

6.0.5

License

MIT

Unpacked Size

5.1 kB

Total Files

5

Last publish

Collaborators

  • types