@toreda/time
Version:
Simple, small footprint library for common time operations and converting between units of time.
19 lines (18 loc) • 529 B
TypeScript
import type { TimeUnit } from './unit';
/**
* Check whether timeConvert can convert between the provided units.
* @param from
* @param to
* @param value
* @returns
*/
export declare function canConvert(from: TimeUnit, to: TimeUnit, value?: number | null): value is number;
/**
* Convert value to a different time unit.
* @param from
* @param to
* @param value
* @param decimals
* @returns
*/
export declare function timeConvert(from: TimeUnit, to: TimeUnit, value?: number | null, decimals?: number): number | null;