ProcessSlot
Defined in: ProcessSlot.ts:42
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:62
Parameters
Section titled “Parameters”config?
Section titled “config?”ProcessSlotConfig = {}
Returns
Section titled “Returns”ProcessSlot
Properties
Section titled “Properties”_guardCallback
Section titled “_guardCallback”_guardCallback: ((
run) =>void) |undefined
Defined in: ProcessSlot.ts:60
Internal
Runs slot callbacks the engine invokes outside a tick — cleanup from
cancel() and restart() — through the owning component’s error
boundary, so a throw is attributed to the slot rather than to whichever
game code called cancel().
— set by ProcessComponent.slot()
Accessors
Section titled “Accessors”completed
Section titled “completed”Get Signature
Section titled “Get Signature”get completed():
boolean
Defined in: ProcessSlot.ts:71
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:81
Seconds elapsed since start.
Returns
Section titled “Returns”number
Get Signature
Section titled “Get Signature”get ratio():
number
Defined in: ProcessSlot.ts:96
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:76
Whether the slot is actively running (not completed and not paused).
Returns
Section titled “Returns”boolean
Get Signature
Section titled “Get Signature”get tags(): readonly
string[]
Defined in: ProcessSlot.ts:90
Tags for filtering/grouping — the running slot’s tags, which start()
overrides can replace for one run, and the configured tags once it has
completed.
Returns
Section titled “Returns”readonly string[]
Methods
Section titled “Methods”_tick()
Section titled “_tick()”_tick(
dt):unknown
Defined in: ProcessSlot.ts:169
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:128
Cancel the slot. Calls cleanup if running.
Returns
Section titled “Returns”void
onComplete()
Section titled “onComplete()”onComplete(
fn):this
Defined in: ProcessSlot.ts:152
Set/override the onComplete callback. Chainable. Applies to the current run as well as to later ones.
Parameters
Section titled “Parameters”() => void
Returns
Section titled “Returns”this
pause()
Section titled “pause()”pause():
void
Defined in: ProcessSlot.ts:139
Pause the slot.
Returns
Section titled “Returns”void
restart()
Section titled “restart()”restart(
overrides?):this
Defined in: ProcessSlot.ts:122
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:144
Resume the slot.
Returns
Section titled “Returns”void
start()
Section titled “start()”start(
overrides?):this
Defined in: ProcessSlot.ts:109
Start the slot. No-op if already running (use restart() to force), which also means overrides passed to a running slot are discarded.
Overrides apply to this run only: the next bare start() uses the config
the slot was created with.
Parameters
Section titled “Parameters”overrides?
Section titled “overrides?”Partial<Omit<ProcessSlotConfig, "clock">>
Returns
Section titled “Returns”this
Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/core.md.