Skip to content

KeyedStateFactory

Defined in: state-keyed.ts:30

A factory object mapping state keys to state creator functions. Each function returns a State instance (optionally with additional properties).

This interface is useful for defining a set of states in a state machine, allowing for dynamic state creation and management. It ensures that each state can be uniquely identified by its key, enabling type-safe transitions and state handling.

export interface KeyedStateFactory {
[key: string]: (...args: any[]) => KeyedState;
} /**

These types are the underpinnings of the library, enabling type inference and state management throughout factory machines. The implementation leverages matchbox factories for dynamic and type-safe state construction and transitions.

[key: string]: (…args: any[]) => KeyedState