import type { AssignAction, Assigner, CancelAction, EventObject, LogAction, LogExpr, MachineContext, MutateAction, MutateRecipe, PropertyAssigner, RaiseAction, RaiseActionOptions, SendExpr } from "./types/index.js"; import type { DoNotInfer, NonReducibleUnknown } from "./types/common.js"; /** * Builtin action creators. Like XState they return frozen *functions* (named * `assign` / `mutate` / `raise` / `cancel` / `log`) carrying the `BUILTIN` * brand and their payload; calling one throws. The interpreter core applies * `assign` and `mutate` itself and routes `raise` / `cancel` / `log` through * the executor. * * All parameters are `DoNotInfer`: the generics (including `TParams`) are * inferred from the contextual type — the `actions` slot of a typed config or * implementation table — not from the argument. Same approach as XState. */ /** Updates the context: a partial object, or a function of `{ context, event }` returning a partial. */ export declare function assign(assignment: Assigner, DoNotInfer, DoNotInfer> | PropertyAssigner, DoNotInfer, DoNotInfer>): AssignAction; /** * Updates the context through an Immer draft: the recipe mutates `context` * in place and the produced next context replaces the current one (the * previous object is untouched; unchanged subtrees are shared). The recipe's * return value is ignored. Plain objects and arrays are drafted; other values * (`Map`, `Set`, class instances) are handed over as they are. * * Not an XState builtin: the converter emits it for `@action` bodies, and * `toXStateSource()` imports it from this package. */ export declare function mutate(recipe: MutateRecipe, DoNotInfer, DoNotInfer>): MutateAction; /** * Raises an event to the machine itself. Immediate (internal queue of the * current macrostep) unless `options.delay` is given. */ export declare function raise(eventOrExpr: DoNotInfer | SendExpr, DoNotInfer, DoNotInfer, DoNotInfer>, options?: RaiseActionOptions, DoNotInfer, DoNotInfer>): RaiseAction; /** Cancels a pending delayed `raise` (or an `after` timer by its event type). */ export declare function cancel(sendId: CancelAction, DoNotInfer, DoNotInfer>["sendId"]): CancelAction; /** Logs a value (or the result of an expression) through the engine's logger. */ export declare function log(value?: NonReducibleUnknown | LogExpr, DoNotInfer, DoNotInfer>, label?: string): LogAction;