@toreda/time
Version:
Simple, small footprint library for common time operations and converting between units of time.
15 lines (14 loc) • 610 B
TypeScript
import type { TimeUnit } from './unit';
import { TimeUtils } from './utils';
/**
* @deprecated Use `TimeUtils.canConvert` instead. This re-export will be removed in a future major release.
*/
export declare const canConvert: typeof TimeUtils.canConvert;
/**
* Convert value to a different time unit.
* @param from `TimeUnit` to convert from.
* @param to `TimeUnit` to convert to.
* @param value value to convert
* @param decimals (optional) Decimals to use for precision.
*/
export declare function timeConvert(from: TimeUnit, to: TimeUnit, value?: number | null, decimals?: number): number | null;