import { type JSX, type RefObject } from 'react'; import type { FocusAction } from '../utils/focus-actions.js'; /** * Data of the screen reader message for a refused navigation. * @internal */ export interface StepperRefusal { /** * Position of the step that needs attention among the counted steps. */ current: number; /** * Number of counted steps. */ total: number; /** * Number of steps that still need attention. Left out when only the target * step is announced. */ invalidStepCount?: number; } /** * Focus and screen reader announcement state of a Stepper. * @internal */ export interface StepperFocusControls { setAnnouncement: (refusal: StepperRefusal | null) => void; /** * Runs `action` on the Stepper root right away. */ focusNow: (action: FocusAction) => void; /** * Runs `action` after the next render that changes the current step. A field * in a hidden step can not take focus, and the footer buttons depend on the * step that is shown. */ focusOnArrival: (action: FocusAction) => void; } /** * Everything the Stepper needs to render the focus target and the live region. * The controls are kept apart from `rootRef` so they can be passed on without * handing out the ref. * @internal */ export interface StepperFocus { rootRef: RefObject; /** * The live-region content, `null` when there is nothing to announce. */ announcement: JSX.Element | null; controls: StepperFocusControls; } /** * Owns the Stepper root ref, the pending focus action and the live-region * content. * @internal */ export declare function useStepperFocus(currentStepId: string): StepperFocus; //# sourceMappingURL=useStepperFocus.d.ts.map