UNPKG

@toreda/time

Version:

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

28 lines (27 loc) 769 B
import type { Mutable } from '../mutable'; import type { Time } from '../time'; import type { Timer } from '../timer'; /** * @category Timers */ export declare class TimerPassive implements Timer { running: boolean; readonly interval: Mutable<number>; readonly lastTrigger: Mutable<number>; readonly triggerLimit: Mutable<number>; timeStart: Time; constructor(); /** * Start timer using the current time. No effect if timer is running. * @returns Whether timer started successfully. */ start(): boolean; /** * Stop current timer. No effect if timer is not running. * @returns Whether timer stopped succesfully. */ stop(): boolean; trigger(): void; onUpdate(): void; reset(): void; }