Skip to content

TimerOptions

Defined in: plugins/TimerPlugin.ts:10

Configuration options for creating a timer.

Properties

autoStart?

optional autoStart: boolean

Defined in: plugins/TimerPlugin.ts:14

Whether to start the timer immediately upon creation


duration?

optional duration: number

Defined in: plugins/TimerPlugin.ts:12

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


loop?

optional loop: boolean

Defined in: plugins/TimerPlugin.ts:16

Whether to restart the timer when it completes


onComplete()?

optional onComplete: () => void

Defined in: plugins/TimerPlugin.ts:22

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

Returns

void


onTick()?

optional onTick: (remaining) => void

Defined in: plugins/TimerPlugin.ts:24

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

Parameters

remaining

number

Returns

void


useWorker?

optional useWorker: boolean

Defined in: plugins/TimerPlugin.ts:18

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


workerInterval?

optional workerInterval: number

Defined in: plugins/TimerPlugin.ts:20

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