UNPKG

946 BTypeScriptView Raw
1import { AnyActorLogic, EventFromLogic, InputFrom, SnapshotFrom, ExecutableActionsFrom } from "./types.js";
2/**
3 * Given actor `logic`, a `snapshot`, and an `event`, returns a tuple of the
4 * `nextSnapshot` and `actions` to execute.
5 *
6 * This is a pure function that does not execute `actions`.
7 */
8export declare function transition<T extends AnyActorLogic>(logic: T, snapshot: SnapshotFrom<T>, event: EventFromLogic<T>): [nextSnapshot: SnapshotFrom<T>, actions: ExecutableActionsFrom<T>[]];
9/**
10 * Given actor `logic` and optional `input`, returns a tuple of the
11 * `nextSnapshot` and `actions` to execute from the initial transition (no
12 * previous state).
13 *
14 * This is a pure function that does not execute `actions`.
15 */
16export declare function initialTransition<T extends AnyActorLogic>(logic: T, ...[input]: undefined extends InputFrom<T> ? [input?: InputFrom<T>] : [input: InputFrom<T>]): [SnapshotFrom<T>, ExecutableActionsFrom<T>[]];