import * as React from 'react'; /** * Represents an interaction event from an AI interactive component. * Used to communicate user interactions back to the parent application. */ export type AIInteractionComponentType = 'chart' | 'select' | 'table' | 'form' | 'component'; export interface AIClarificationCardOtherInteractionValue { kind: 'other'; value: string; label?: string; } export interface AIClarificationCardFileInteractionValue { id: string; name: string; size?: number; type?: string; progress?: number; status?: 'attached' | 'uploading' | 'complete' | 'error'; error?: string; } export type AIClarificationCardInteractionValue = string | string[] | number | boolean | AIClarificationCardOtherInteractionValue | AIClarificationCardFileInteractionValue[] | Record | null; /** @deprecated Use AIClarificationCardOtherInteractionValue. */ export type AIComponentOtherInteractionValue = AIClarificationCardOtherInteractionValue; /** @deprecated Use AIClarificationCardFileInteractionValue. */ export type AIComponentFileInteractionValue = AIClarificationCardFileInteractionValue; /** @deprecated Use AIClarificationCardInteractionValue. */ export type AIComponentInteractionValue = AIClarificationCardInteractionValue; export interface AIInteractionValueMap { chart: Record; select: string | string[] | null; table: { selectedRows: string[]; }; form: Record; component: AIClarificationCardInteractionValue; } export type AIInteractionEvent = { [ComponentType in AIInteractionComponentType]: { /** Unique identifier for the component instance */ componentId: string; /** Type of interactive component that generated the event */ componentType: ComponentType; /** The action that was performed (e.g., 'click', 'select', 'submit') */ action: string; /** The value associated with the interaction */ value: AIInteractionValueMap[ComponentType]; /** Unix timestamp when the interaction occurred */ timestamp: number; }; }[AIInteractionComponentType]; /** * Context value for AI interaction handling */ export interface AIInteractionContextValue { /** Callback invoked when an interaction occurs */ onInteraction?: (event: AIInteractionEvent) => void; } declare const AIInteractionContext: React.Context, useAIInteraction: () => AIInteractionContextValue; /** * Hook to access the AI interaction context. * Must be used within an AIInteractionProvider. * * @throws Error if used outside of AIInteractionProvider * @returns The AI interaction context value */ export { useAIInteraction }; export interface AIInteractionProviderProps { /** Child components that can access the interaction context */ children: React.ReactNode; /** Callback invoked when any child interactive component triggers an interaction */ onInteraction?: (event: AIInteractionEvent) => void; } /** * Provider component that enables AI interactive components to communicate * user interactions back to the parent application. */ export declare function AIInteractionProvider({ children, onInteraction, }: AIInteractionProviderProps): React.ReactElement; export declare namespace AIInteractionProvider { var displayName: string; } export { AIInteractionContext };