TransitionEvent
Defined in: state-machine.ts:67
TransitionEvent describes a transition (change) event in a state machine. See StateMachine Includes the event type, parameters, source and target states, and a reference to the machine.
See also:
Source
Section titled “Source”This interface is used throughout Matchina to represent events that trigger state transitions. It provides a consistent structure for event handling, allowing for type-safe interactions with state machines. It is a core part of the Matchina API, enabling developers to define and manage state
export interface TransitionEvent<To = unknown, From = To> { type: string; // The event type string params: any[]; // Parameters passed to the event to: To; // Target state for the transition from: From; // Source state for the transition get machine(): StateMachine<TransitionEvent<To, From>>; // Reference to the state machine instance}
Type Parameters
Section titled “Type Parameters”Type Parameter | Default type | Description |
---|---|---|
To | unknown | Target state type |
From | To | Source state type |
Accessors
Section titled “Accessors”machine
Section titled “machine”Get Signature
Section titled “Get Signature”get machine():
StateMachine
<TransitionEvent
<To
,From
>>
Defined in: state-machine.ts:72
Returns
Section titled “Returns”StateMachine
<TransitionEvent
<To
, From
>>
Reference to the state machine instance handling this event.