@payfit/unity-components
Version:
31 lines (30 loc) • 1.46 kB
TypeScript
export interface AIStructuredInputContextValue {
/** Stable ID of the active question. */
activeStepId: string;
/** Zero-based position of the active question. */
activeStepIndex: number;
/** Number of questions in the sequence. */
totalSteps: number;
/** Whether the active question is the last question. */
isFinalStep: boolean;
/** Whether another question follows the active question. */
canContinue: boolean;
/** Advances to the next question when one exists. */
continueToNextStep: () => void;
/** ID of the active question panel. */
stepPanelId: string;
/** Whether a previous question exists. */
canGoToPreviousStep: boolean;
/** Whether a next question exists. */
canGoToNextStep: boolean;
/** Moves to the previous question when one exists. */
goToPreviousStep: () => void;
/** Moves to the next question when one exists. */
goToNextStep: () => void;
/** Registers the active heading so it can receive focus after navigation. */
registerStepHeading: (stepId: string, heading: HTMLHeadingElement | null) => void;
}
/** Provider for structured-input navigation state. */
export declare const AIStructuredInputContextProvider: import('react').Provider<AIStructuredInputContextValue | null>;
/** Reads structured-input state, or `null` when used outside the root. */
export declare const useAIStructuredInputContext: () => AIStructuredInputContextValue | null;