yay-machine
Version:
A modern, simple, lightweight, zero-dependency, TypeScript state-machine library
12 lines • 844 B
TypeScript
import type { MachineDefinition } from "./MachineDefinition";
import { type MachineDefinitionConfig } from "./MachineDefinitionConfig";
import type { MachineEvent } from "./MachineEvent";
import type { MachineState } from "./MachineState";
/**
* Defines a machine prototype. Use this when you intend to create multiple instances of the same machine.
* @param definitionConfig describes the machine prototype; it's states and how it responds to events
* @returns the machine definition, which can be used to create new machine instances
* @throws {Error} if the definition is invalid
*/
export declare const defineMachine: <StateType extends MachineState, EventType extends MachineEvent>(definitionConfig: MachineDefinitionConfig<StateType, EventType>) => MachineDefinition<StateType, EventType>;
//# sourceMappingURL=defineMachine.d.ts.map