UNPKG

@toreda/time

Version:

Simple, small footprint library for common time operations and converting between units of time.

18 lines (17 loc) 689 B
import type { Id, StrongArray } from '@toreda/strong-types'; import type { TimerCallback } from '../callback'; import type { TimerCallbackSync } from './sync'; /** * @category Timers */ export declare class TimerCallbackGroup { readonly id: Id; readonly _once: StrongArray<TimerCallback | TimerCallbackSync>; readonly _always: StrongArray<TimerCallback | TimerCallbackSync>; constructor(id: string); reset(): void; execute(duration?: number | null): Promise<void>; invoke(fn: TimerCallback | TimerCallbackSync, duration?: number | null): Promise<void>; once(duration?: number | null): Promise<void>; always(duration?: number | null): Promise<void>; }