Metakit / @doeixd/metakit/machine

PhaseEdge

interface · packages/metakit/src/machinePhaseTypes.ts:56

interface PhaseEdge<State, Input, Name extends string> {
  readonly from: ReadonlyArray<Phase<State, Name, unknown>>
  readonly to: Phase<State, Name, unknown>
  readonly when: ExprType<TransitionEnv<State, Input>, boolean | null>
  readonly label: Option.Option<string>
}

One edge of a phase transition: the phases it leaves, the phase it enters, and when it is taken.

Members

PhaseEdge.from

property · packages/metakit/src/machinePhaseTypes.ts:57

readonly from: ReadonlyArray<Phase<State, Name, unknown>>

PhaseEdge.to

property · packages/metakit/src/machinePhaseTypes.ts:58

readonly to: Phase<State, Name, unknown>

PhaseEdge.when

property · packages/metakit/src/machinePhaseTypes.ts:60

readonly when: ExprType<TransitionEnv<State, Input>, boolean | null>

Its from, its own condition, and the negation of every earlier alternative's: at most one edge of a transition holds.

PhaseEdge.label

property · packages/metakit/src/machinePhaseTypes.ts:62

readonly label: Option.Option<string>

The condition as text for a diagram (when …, otherwise); none for an edge built with to.