ProcessSlot
Defined in: ProcessSlot.ts:33
A reusable, restartable process handle owned by a ProcessComponent.
Starts in completed state (ready to use). Call start() to activate.
Use for cooldowns, invincibility windows, flash effects, shakes, etc.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ProcessSlot(
config?):ProcessSlot
Defined in: ProcessSlot.ts:42
Parameters
Section titled “Parameters”config?
Section titled “config?”ProcessSlotConfig = {}
Returns
Section titled “Returns”ProcessSlot
Properties
Section titled “Properties”
readonlytags: readonlystring[]
Defined in: ProcessSlot.ts:40
Tags for filtering/grouping.
Accessors
Section titled “Accessors”completed
Section titled “completed”Get Signature
Section titled “Get Signature”get completed():
boolean
Defined in: ProcessSlot.ts:48
Whether the slot has completed (starts true).
Returns
Section titled “Returns”boolean
elapsed
Section titled “elapsed”Get Signature
Section titled “Get Signature”get elapsed():
number
Defined in: ProcessSlot.ts:58
Seconds elapsed since start.
Returns
Section titled “Returns”number
Get Signature
Section titled “Get Signature”get ratio():
number
Defined in: ProcessSlot.ts:63
Progress ratio 0..1 (elapsed / duration). 0 if no duration set.
Returns
Section titled “Returns”number
running
Section titled “running”Get Signature
Section titled “Get Signature”get running():
boolean
Defined in: ProcessSlot.ts:53
Whether the slot is actively running (not completed and not paused).
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”_tick()
Section titled “_tick()”_tick(
dt):unknown
Defined in: ProcessSlot.ts:126
Internal
Advance the slot by dt seconds. Returns whatever config.update returned
— boolean | void per its declared type, but nothing stops a caller from
passing an async function anyway, so the caller-observed return can
also be a thenable. Returning it lets tickProcessGuarded attach a
rejection handler, mirroring Process._update.
— called by ProcessComponent
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”unknown
cancel()
Section titled “cancel()”cancel():
void
Defined in: ProcessSlot.ts:96
Cancel the slot. Calls cleanup if running.
Returns
Section titled “Returns”void
onComplete()
Section titled “onComplete()”onComplete(
fn):this
Defined in: ProcessSlot.ts:113
Set/override the onComplete callback. Chainable.
Parameters
Section titled “Parameters”() => void
Returns
Section titled “Returns”this
pause()
Section titled “pause()”pause():
void
Defined in: ProcessSlot.ts:103
Pause the slot.
Returns
Section titled “Returns”void
restart()
Section titled “restart()”restart(
overrides?):this
Defined in: ProcessSlot.ts:85
Cancel if running, then start fresh. Always restarts.
Parameters
Section titled “Parameters”overrides?
Section titled “overrides?”Partial<Omit<ProcessSlotConfig, "clock">>
Returns
Section titled “Returns”this
resume()
Section titled “resume()”resume():
void
Defined in: ProcessSlot.ts:108
Resume the slot.
Returns
Section titled “Returns”void
start()
Section titled “start()”start(
overrides?):this
Defined in: ProcessSlot.ts:70
Start the slot. No-op if already running (use restart() to force).
Parameters
Section titled “Parameters”overrides?
Section titled “overrides?”Partial<Omit<ProcessSlotConfig, "clock">>
Returns
Section titled “Returns”this