Skip to content

TimerOptions

Defined in: plugins/TimerPlugin.ts:9

Configuration options for creating a timer.

optional autoStart: boolean

Defined in: plugins/TimerPlugin.ts:13

Whether to start the timer immediately upon creation


optional duration: number

Defined in: plugins/TimerPlugin.ts:11

Duration in milliseconds. If not provided, timer counts up indefinitely


optional loop: boolean

Defined in: plugins/TimerPlugin.ts:15

Whether to restart the timer when it completes


optional onComplete: () => void

Defined in: plugins/TimerPlugin.ts:21

Callback fired when the timer completes. Not called in count-up mode

void


optional onTick: (remaining) => void

Defined in: plugins/TimerPlugin.ts:23

Callback fired on each timer tick with the remaining time (or elapsed time in count-up mode)

number

void


optional useWorker: boolean

Defined in: plugins/TimerPlugin.ts:17

Run timer in a web worker for better performance and independence from main thread


optional workerInterval: number

Defined in: plugins/TimerPlugin.ts:19

Update interval in milliseconds for worker-based timers. Default is 16ms (roughly 60fps)