/** * A test scenario for a transition. `given` is a partial set of model props — * only the fields relevant to this scenario need be specified. `expected` is * the state the model should be in after the transition. */ export type Scenario, States extends string = string> = { readonly expected: States; readonly given: Partial; }; /** Builder — returned during model definition for chaining .when()/.scenario(). */ export type TransitionBuilder, States extends string = string> = { scenario(given: Partial, expected: States): TransitionBuilder; /** * Replaces previous guard (last-wins semantics). * Guards on optional props must handle undefined values — no automatic null checks are added. */ when(fn: (ctx: Ctx) => boolean): TransitionBuilder; } & TransitionData; /** Plain data — stored in ModelDef, consumed by codegen. No builder methods. */ export type TransitionData, States extends string = string> = { readonly from: From; readonly guard: ((ctx: Ctx) => boolean) | null; readonly kind: "transition"; readonly scenarios: readonly Scenario[]; readonly to: To; }; export declare const from: (state: F) => { to(toState: T): TransitionBuilder; }; /** @internal Used by model() to create typed from() factories. Phantom generics — type-level only, erased at runtime. */ export declare const createTypedFrom: () => (state: F) => { to(toState: T): TransitionBuilder; }; //# sourceMappingURL=transitions.d.ts.map