npm.io
7.0.0 • Published 1 year ago

@types/timestring

Licence
MIT
Version
7.0.0
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

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 | number,
    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: Fri, 18 Oct 2024 2141 GMT
  • Dependencies: none

Credits

These definitions were written by Devin Spikowski.