UNPKG

@toreda/time

Version:

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

28 lines (27 loc) 764 B
import type { Bool, Float, UInt } from '@toreda/strong-types'; import type { Time } from '../time'; import type { Timer } from '../timer'; /** * @category Timers */ export declare class TimerPassive implements Timer { readonly running: Bool; readonly interval: Float; readonly lastTrigger: Float; readonly triggerLimit: UInt; 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; }