utils_TimeoutManager_smart_timer.Timeout
perfect-graph / Modules / utils/TimeoutManager/smart-timer / Timeout
Class: Timeout#
utils/TimeoutManager/smart-timer.Timeout
Table of contents#
Constructors#
Properties#
Methods#
Constructors#
constructor#
• new Timeout()
Properties#
keyId#
â–ª Static Private keyId: KeyId = {}
Defined in#
utils/TimeoutManager/smart-timer.ts:51
metadata#
â–ª Static Private metadata: Metadata = {}
Defined in#
utils/TimeoutManager/smart-timer.ts:55
originalMs#
â–ª Static Private originalMs: OriginalMs = {}
Defined in#
utils/TimeoutManager/smart-timer.ts:53
Methods#
clear#
â–¸ Static clear(key, erase?): void
clear timeout and optionally erase all knowledge of its existence
Parameters#
| Name | Type | Default value |
|---|---|---|
key | string | undefined |
erase | boolean | true |
Returns#
void
Defined in#
utils/TimeoutManager/smart-timer.ts:62
create#
â–¸ Static create(key, callback, ms, ...params): boolean | Checker
same as set() except returns false if timeout already exists
Parameters#
| Name | Type |
|---|---|
key | string |
callback | Callback |
ms | number |
...params | any[] |
Returns#
boolean | Checker
Defined in#
utils/TimeoutManager/smart-timer.ts:136
â–¸ Static create(callback, ms, ...params): boolean | Checker
same as set() except returns false if timeout already exists
Parameters#
| Name | Type |
|---|---|
callback | Callback |
ms | number |
...params | any[] |
Returns#
boolean | Checker
Defined in#
utils/TimeoutManager/smart-timer.ts:143
executed#
â–¸ Static executed(key): boolean
test if a timeout has run
Parameters#
| Name | Type |
|---|---|
key | string |
Returns#
boolean
Defined in#
utils/TimeoutManager/smart-timer.ts:173
exists#
â–¸ Static exists(key): boolean
timeout has been created
Parameters#
| Name | Type |
|---|---|
key | string |
Returns#
boolean
Defined in#
utils/TimeoutManager/smart-timer.ts:165
instantiate#
â–¸ Static instantiate(callback, ms?, ...params): TimeoutInstance
instantiate timeout to handle as object
Parameters#
| Name | Type | Default value |
|---|---|---|
callback | Callback | undefined |
ms | number | 0 |
...params | any[] | undefined |
Returns#
Defined in#
utils/TimeoutManager/smart-timer.ts:281
lastExecuted#
â–¸ Static lastExecuted(key): Date
when timeout was last executed
Parameters#
| Name | Type |
|---|---|
key | string |
Returns#
Date
Defined in#
utils/TimeoutManager/smart-timer.ts:181
pause#
â–¸ Static pause(key): number | boolean
pause our execution countdown until we're ready for it to resume
Parameters#
| Name | Type |
|---|---|
key | string |
Returns#
number | boolean
Defined in#
utils/TimeoutManager/smart-timer.ts:241
paused#
â–¸ Static paused(key): boolean
timeout does exist, but will not execute because it is paused
Parameters#
| Name | Type |
|---|---|
key | string |
Returns#
boolean
Defined in#
utils/TimeoutManager/smart-timer.ts:199
pending#
â–¸ Static pending(key): boolean
timeout does exist, but has not yet run
Parameters#
| Name | Type |
|---|---|
key | string |
Returns#
boolean
Defined in#
utils/TimeoutManager/smart-timer.ts:191
remaining#
â–¸ Static remaining(key): number
remaining time until timeout will occur
Parameters#
| Name | Type |
|---|---|
key | string |
Returns#
number
Defined in#
utils/TimeoutManager/smart-timer.ts:209
restart#
â–¸ Static restart(key): boolean | Checker
restart timeout with original time
Parameters#
| Name | Type |
|---|---|
key | string |
Returns#
boolean | Checker
Defined in#
utils/TimeoutManager/smart-timer.ts:223
resume#
â–¸ Static resume(key): boolean | Checker
resume paused Timeout with the remaining time
Parameters#
| Name | Type |
|---|---|
key | string |
Returns#
boolean | Checker
Defined in#
utils/TimeoutManager/smart-timer.ts:258
set#
â–¸ Static set(key, callback, ms, ...params): Checker
returns a function allowing you to test if it has executed
Parameters#
| Name | Type |
|---|---|
key | string |
callback | Callback |
ms | number |
...params | any[] |
Returns#
Defined in#
utils/TimeoutManager/smart-timer.ts:79
â–¸ Static set(callback, ms, ...params): Checker
returns a function allowing you to test if it has executed
Parameters#
| Name | Type |
|---|---|
callback | Callback |
ms | number |
...params | any[] |
Returns#
Defined in#
utils/TimeoutManager/smart-timer.ts:86
â–¸ Static set(...args): Checker
Parameters#
| Name | Type |
|---|---|
...args | any[] |