Interval 
Repeatedly calls a function or executes a code snippet, with a time delay between each call, with controls to pause & resume the interval.
Interval class 
ts
class Interval<TArgs extends any[] = []> implements IIntervalRepresents a repeated calls of a function with a time delay between each call.
Type Parameters 
- TArgs extends any[] = []Type of arguments to pass to the callback function.
Constructors 
ts
constructor(callback: Action, delay?: number)Creates a new Interval.
Parameters 
- callback: ActionThe function to be called when the interval elapses.
- delay?: numberThe delay between each call in milliseconds.
ts
constructor(callback: Action, options?: IntervalOptions)Creates a new Interval.
Parameters 
- callback: ActionThe function to be called when the interval elapses.
- options?: IntervalOptionsThe options for the interval.
ts
constructor(callback: Action<TArgs>, options?: number | IntervalOptions, ...args: TArgs)Creates a new Interval.
Parameters 
- callback: Action<TArgs>The function to be called when the interval elapses.
- options?: number | IntervalOptionsThe options for the interval.
- ...args: TArgsArguments to pass to the callback function.
Properties 
| Name | Type | Description | 
|---|---|---|
| isActive | boolean | get Whether the interval is currently active. | 
| delay | number | undefined | get Delay in milliseconds. | 
pause method 
ts
pause(): voidPauses the interval.
resume method 
ts
resume(): voidResumes the interval.
IInterval interface 
ts
interface IIntervalInterface that represent a repeated calls of a function.
Properties 
| Name | Type | Description | 
|---|---|---|
| delay | number | readonly optional Delay in milliseconds. | 
| isActive | boolean | readonly Whether the interval is currently active. | 
pause method 
ts
pause(): voidPauses the interval.
resume method 
ts
resume(): voidResumes the interval.
IntervalOptions interface 
ts
interface IntervalOptionsOptions for the Interval class.
Properties 
| Name | Type | Description | 
|---|---|---|
| delay | number | optional Delay in milliseconds. | 
| immediate | boolean | optional Whether to start the interval immediately. | 
