Skip to content

@web-engine-dev/time


@web-engine-dev/time / TimerConfig

Interface: TimerConfig ​

Timer configuration

Example ​

typescript
const config: TimerConfig = {
  duration: 5.0,
  repeating: true,
  onComplete: () => console.log('Interval tick!'),
  onTick: (t) => console.log(`${t.remaining.toFixed(1)}s left`),
};

Properties ​

duration ​

duration: number

Duration in seconds


onComplete()? ​

optional onComplete: () => void

Callback when timer completes

Returns ​

void


onTick()? ​

optional onTick: (timer) => void

Callback each tick

Parameters ​

timer ​

Timer

Returns ​

void


repeating? ​

optional repeating: boolean

Whether to repeat

Proprietary software. All rights reserved.