@elemental/common / Class

LmnCountdown

Extends:LmnTimerBase

@class LmnCountdown @description A helper class that can be used to manage countdowns.

This class provides utilities to work with countdowns, allowing:

  • Starting, pausing, resuming and resetting the countdown.
  • Getting the updated raw or formatted time.

Constructor

No documentation has been provided.

Presentation
constructor(
	time: LmnTimeLimit
): LmnCountdown;
Parameters
NameTypeDescription
time
overrides LmnTimerBase
LmnTimeLimit

Properties

NameTypeDescription
ended
r
inherited from LmnTimerBase
Signal<boolean>

Whether the timer/countdown has reached its time limit.

extendedTime
r
inherited from LmnTimerBase
Signal<string>

The current value of the timer expressed as an extended hms string (i.e. "4hr 5min 29sec"). This format is the most suitable for screen readers.

fullTime
r
inherited from LmnTimerBase
Signal<string>

The current value of the timer expressed as a full hms string (i.e. "4 hours 5 minutes 29 seconds").

milliseconds
r
inherited from LmnTimerBase
Signal<number>

The current value of the timer expressed in milliseconds.

running
r
inherited from LmnTimerBase
Signal<boolean>

Whether the timer/countdown is currently running.

time
r
inherited from LmnTimerBase
Signal<string>

The current value of the timer expressed as a hms string (i.e. "4h 5m 29s").

Methods

pause()

inherited from LmnTimerBase

It pauses the timer/countdown.

Presentation
pause(): void;
Returns
void

restart()

inherited from LmnTimerBase

It restarts the timer/countdown from its initial state, resetting the current value.

Presentation
restart(updateInterval: number = 1000): void;
Parameters
NameTypeDescription
updateInterval
number

@param updateInterval How often the timer value needs to be updated.

Returns
void

start()

inherited from LmnTimerBase

It starts the timer/countdown from the latest available value.

Presentation
start(updateInterval: number = 1000): void;
Parameters
NameTypeDescription
updateInterval
number

@param updateInterval How often the timer value needs to be updated.

Returns
void