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