Installation
npm install --save @types/hh-mm-ss
Summary
This package contains type definitions for hh-mm-ss (https://github.com/Goldob/hh-mm-ss#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hh-mm-ss.
index.d.ts
/**
* Convert given `hh:mm:ss` formatted string to miliseconds
*
* @param time String representation
* @param format Default input format. If present, it will be used to resolve
* ambiguities during interpretation. If not specified, `mm:ss` is implied.
* [See section below for supported format list](https://github.com/Goldob/hh-mm-ss#supported-time-formats)
*/
export function toMs(time: string, format?: string): number;
/**
* Convert given `hh:mm:ss` formatted string to seconds
*
* @param time String representation
* @param format Default input format. If present, it will be used to resolve
* amiguities during interpretation. If not specified, `mm:ss` is implied.
* [See section below for supported format list](https://github.com/Goldob/hh-mm-ss#supported-time-formats)
*/
export function toS(time: string, format?: string): number;
/**
* Generate formatted string from time in miliseconds
*
* @param ms Time in miliseconds
* @param format Default output format. If not specified, `mm:ss` is implied.
* [See section below for supported format list](https://github.com/Goldob/hh-mm-ss#supported-time-formats)
*/
export function fromMs(ms: number, format?: string): string;
/**
* Generate formatted string from time in seconds
*
* @param s Time in seconds
* @param format Default output format. If not specified, `mm:ss` is implied.
* [See section below for supported format list](https://github.com/Goldob/hh-mm-ss#supported-time-formats)
*/
export function fromS(s: number, format?: string): string;
Additional Details
- Last updated: Tue, 07 Nov 2023 03:09:37 GMT
- Dependencies: none
Credits
These definitions were written by Thomas Cazade.