import type { Schema } from "src/types/schema"; import type { Flow } from "../types/flow/typed"; import type { OnYield } from "../types/handlers/typed"; import type { OnReturn } from "../types/handlers/typed"; import type { OnNext } from "src/types/form-controls"; import type { OnBack } from "src/types/form-controls"; import type { OnJump } from "src/types/form-controls"; import type { GetState } from "src/types/form-controls"; import type { SetState } from "src/types/form-controls"; import type { State } from "../types/state/state"; /** * Finds the first form step in the flow, triggering `onYield` for any yield * operations along the way, and returns the initial state at the position of that form step. * * @throws If no form step is found or a return is encountered before reaching one. */ export declare function initState(options: { flow: Flow; onYield: OnYield; inputs: T["inputs"]; history: boolean; }): State; /** * Advances past the current form step, triggering `onYield` for any yield operations * and `onReturn` if a return is found, and returns the state at the next form step * if reached, or the current one otherwise. */ export declare function nextState(options: { flow: Flow; onYield: OnYield; onReturn: OnReturn; state: State; fields: Record; history: boolean; }): State; /** * Goes back to the previous form step, triggering `onYield` for any yield * operations encountered along the way, and returns the state at the previous * form step if found, or the current one otherwise. */ export declare function prevState(options: { flow: Flow; onYield: OnYield; state: State; fields: Record; }): State; /** * Jumps to the jump element with the given id and returns the state at its form step, * or returns the current state if no matching jump element is found. */ export declare function jumpState(options: { flow: Flow; state: State; fields: Record; history: boolean; id: unknown; }): State; /** * Returns a new state with the values of the current form step updated. */ export declare function syncState(options: { flow: Flow; state: State; fields: Record; }): State; /** * Returns the rendered form for the current step of the multi-step form. */ export declare function getForm(options: { flow: Flow; params: T["params"]; state: State; onNext: OnNext>; onBack: OnBack>; onJump: OnJump>; getState: GetState>; setState: SetState; }): T["render"]; //# sourceMappingURL=index.d.ts.map