Skip to content

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.

new ProcessSlot(config?): ProcessSlot

Defined in: ProcessSlot.ts:42

ProcessSlotConfig = {}

ProcessSlot

readonly tags: readonly string[]

Defined in: ProcessSlot.ts:40

Tags for filtering/grouping.

get completed(): boolean

Defined in: ProcessSlot.ts:48

Whether the slot has completed (starts true).

boolean


get elapsed(): number

Defined in: ProcessSlot.ts:58

Seconds elapsed since start.

number


get ratio(): number

Defined in: ProcessSlot.ts:63

Progress ratio 0..1 (elapsed / duration). 0 if no duration set.

number


get running(): boolean

Defined in: ProcessSlot.ts:53

Whether the slot is actively running (not completed and not paused).

boolean

_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

number

unknown


cancel(): void

Defined in: ProcessSlot.ts:96

Cancel the slot. Calls cleanup if running.

void


onComplete(fn): this

Defined in: ProcessSlot.ts:113

Set/override the onComplete callback. Chainable.

() => void

this


pause(): void

Defined in: ProcessSlot.ts:103

Pause the slot.

void


restart(overrides?): this

Defined in: ProcessSlot.ts:85

Cancel if running, then start fresh. Always restarts.

Partial<Omit<ProcessSlotConfig, "clock">>

this


resume(): void

Defined in: ProcessSlot.ts:108

Resume the slot.

void


start(overrides?): this

Defined in: ProcessSlot.ts:70

Start the slot. No-op if already running (use restart() to force).

Partial<Omit<ProcessSlotConfig, "clock">>

this