/**
 * A navigation away from the current step, passed to the before-leave interceptor.
 * Only `goto` carries a destination — `next`'s target is unknown at intercept time
 * because the `nextStep` predicate is evaluated after the interceptor runs.
 */
export type StepNavAction<TTarget extends string = string> = {
    type: 'next';
} | {
    type: 'back';
} | {
    type: 'goto';
    target: TTarget;
};
/**
 * Interceptor run before leaving a step (registered via `useStepperBeforeNavigate`).
 *
 * Declarative: return `false` to block the move; `true` / `undefined` proceeds. The
 * interceptor MUST NOT call `goNext`/`goBack`/`goTo` itself — the stepper performs the
 * move when the interceptor does not return `false`. It runs *before* the move, so it is
 * the place to both block and do something first (e.g. validate then persist a draft).
 */
export type BeforeNavigate<TTarget extends string = string> = (action: StepNavAction<TTarget>) => boolean | void | Promise<boolean | void>;
/**
 * Internal per-step handle stored in the stepper's ref map (keyed by step id) and
 * consulted by `goNext`/`goBack`/`goTo` before moving. Not a public interface —
 * `useStepperBeforeNavigate` is the seam consumers see.
 */
type StepHandle = {
    onBeforeLeave?: BeforeNavigate;
};
export default StepHandle;
