import type { ReactElement } from 'react'; import type { StepperProps, StepperStepProps } from '../Stepper.types.js'; import type { StepperStoreApi } from '../store/StepperStore.types.js'; import { type StepFlowEntry } from '../utils/step-flow.js'; import type { StepperFocusControls } from './useStepperFocus.js'; /** * Inputs of `useStepperActions`. * @internal */ interface UseStepperActionsOptions> extends Pick, 'onStepSelected' | 'onComplete'> { /** * The store the actions read and write. */ store: StepperStoreApi; /** * The `Stepper.Step` elements, used to look up each step's handlers. */ elements: ReadonlyArray>; /** * Navigation metadata of the steps in the flow. */ entries: readonly StepFlowEntry[]; /** * The id of the active step. */ currentStepId: string; /** * Focus management the actions drive after navigating. */ focus: StepperFocusControls; } /** * Handlers for the navigation, Back, Next and Finish controls of a Stepper. * @internal */ export interface StepperActions { /** * Goes to a step the user selected in the navigation. */ handleNavigate: (stepId: string) => void; /** * Goes to the previous enabled step. */ handleBack: () => void; /** * Runs `onNext` and goes to the resulting step, or refuses and stays when the * step blocks Next or `onNext` throws a `StepperRefusal`. Any other error is * reported and the step stays. Never rejects. */ handleNext: () => Promise; /** * Runs `onComplete`, then goes to the step it returned or to the first * invalid step. A `StepperRefusal` refuses in place, any other error is * reported and the step stays. Never rejects. */ handleComplete: () => Promise; } /** * Wires the user actions of a Stepper to the store, the step handlers and the * focus management. * @internal */ export declare function useStepperActions>({ store, elements, entries, currentStepId, focus, onStepSelected, onComplete, }: Readonly>): StepperActions; export {}; //# sourceMappingURL=useStepperActions.d.ts.map