Skip to main content

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#

NameTypeDefault value
keystringundefined
erasebooleantrue

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#

NameType
keystring
callbackCallback
msnumber
...paramsany[]

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#

NameType
callbackCallback
msnumber
...paramsany[]

Returns#

boolean | Checker

Defined in#

utils/TimeoutManager/smart-timer.ts:143


executed#

â–¸ Static executed(key): boolean

test if a timeout has run

Parameters#

NameType
keystring

Returns#

boolean

Defined in#

utils/TimeoutManager/smart-timer.ts:173


exists#

â–¸ Static exists(key): boolean

timeout has been created

Parameters#

NameType
keystring

Returns#

boolean

Defined in#

utils/TimeoutManager/smart-timer.ts:165


instantiate#

â–¸ Static instantiate(callback, ms?, ...params): TimeoutInstance

instantiate timeout to handle as object

Parameters#

NameTypeDefault value
callbackCallbackundefined
msnumber0
...paramsany[]undefined

Returns#

TimeoutInstance

Defined in#

utils/TimeoutManager/smart-timer.ts:281


lastExecuted#

â–¸ Static lastExecuted(key): Date

when timeout was last executed

Parameters#

NameType
keystring

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#

NameType
keystring

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#

NameType
keystring

Returns#

boolean

Defined in#

utils/TimeoutManager/smart-timer.ts:199


pending#

â–¸ Static pending(key): boolean

timeout does exist, but has not yet run

Parameters#

NameType
keystring

Returns#

boolean

Defined in#

utils/TimeoutManager/smart-timer.ts:191


remaining#

â–¸ Static remaining(key): number

remaining time until timeout will occur

Parameters#

NameType
keystring

Returns#

number

Defined in#

utils/TimeoutManager/smart-timer.ts:209


restart#

â–¸ Static restart(key): boolean | Checker

restart timeout with original time

Parameters#

NameType
keystring

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#

NameType
keystring

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#

NameType
keystring
callbackCallback
msnumber
...paramsany[]

Returns#

Checker

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#

NameType
callbackCallback
msnumber
...paramsany[]

Returns#

Checker

Defined in#

utils/TimeoutManager/smart-timer.ts:86

â–¸ Static set(...args): Checker

Parameters#

NameType
...argsany[]

Returns#

Checker

Defined in#

utils/TimeoutManager/smart-timer.ts:87