StateDefinition
Defined in: StateMachine.ts:75
One state in a StateMachine transition table.
Type Parameters
Section titled “Type Parameters”S extends string
Properties
Section titled “Properties”enter?
Section titled “enter?”
readonlyoptionalenter?: (transition) =>void
Defined in: StateMachine.ts:86
Called after this state becomes current.
Parameters
Section titled “Parameters”transition
Section titled “transition”StateTransition<NoInfer<S>> | null
Returns
Section titled “Returns”void
readonlyoptionalexit?: (transition) =>void
Defined in: StateMachine.ts:88
Called before this state stops being current.
Parameters
Section titled “Parameters”transition
Section titled “transition”StateTransition<NoInfer<S>>
Returns
Section titled “Returns”void
readonlyoptionalfor?:number| (() =>number)
Defined in: StateMachine.ts:82
Seconds before the machine enters next. A function is called each time
the state is entered, and must return a finite number above 0.
fromAny?
Section titled “fromAny?”
readonlyoptionalfromAny?:boolean
Defined in: StateMachine.ts:102
Whether every other state may enter this one without declaring it in to.
For the handful of states a whole machine falls into, such as hit or
die. It adds no edge from this state to itself.
readonlyoptionalnext?:NoInfer<S>
Defined in: StateMachine.ts:84
State entered when for elapses. Must be one this state can reach.
start?
Section titled “start?”
readonlyoptionalstart?:NoInfer<S>
Defined in: StateMachine.ts:96
Child entered with this state. Required when states is declared.
states?
Section titled “states?”
readonlyoptionalstates?:Readonly<{ [K in string]?: ChildStateDefinition<S> }>
Defined in: StateMachine.ts:94
Phases of this state, named in the same union as every other state. The machine is in exactly one of them while this state is current. Nesting is one level deep.
readonlyoptionalto?: readonlyNoInfer<S>[]
Defined in: StateMachine.ts:77
States reachable from this one with StateMachine.go.
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.