import React from "react";
/**
 * Attachment item for multimodal input
 */
export interface AttachmentItem {
    /** Unique identifier for the attachment */
    id: string;
    /** The file object */
    file: File;
    /** Type of attachment */
    type: "image" | "file";
    /** Preview URL for images */
    previewUrl?: string;
    /** Whether the image is being compressed */
    isCompressing?: boolean;
}
/**
 * Attachment error types
 */
export interface AttachmentError {
    type: "file-too-large" | "file-invalid-type" | "too-many-attachments" | "compression-failed";
    message: string;
    file?: File;
}
/**
 * AI prompt input component props
 *
 * Supports both controlled and uncontrolled patterns for maximum flexibility.
 *
 * @example Uncontrolled usage
 * ```tsx
 * <PromptInput onSubmit={(text, model) => handlePrompt(text, model)} />
 * ```
 *
 * @example Controlled usage
 * ```tsx
 * <PromptInput
 *   value={prompt}
 *   onChange={setPrompt}
 *   selectedModel={model}
 *   onModelChange={setModel}
 * />
 * ```
 */
export interface PromptInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange" | "onSubmit" | "onKeyDown"> {
    /** Controlled value - when provided, component becomes controlled */
    value?: string;
    /** Default value for uncontrolled mode */
    defaultValue?: string;
    /**
     * Change handler for controlled mode
     * @param value - The new textarea value
     * @param event - The change event
     */
    onChange?: (value: string, event: React.ChangeEvent<HTMLTextAreaElement>) => void;
    /** Placeholder text for the textarea */
    placeholder?: string;
    /** Maximum character length */
    maxLength?: number;
    /** Minimum height of the textarea (CSS value, e.g., "48px") */
    minHeight?: string;
    /** Maximum height of the textarea (CSS value, e.g., "120px") */
    maxHeight?: string;
    /** Initial number of rows (only applies before auto-resize) */
    rows?: number;
    /** Component state */
    state?: PromptInputState;
    /** Whether the input is disabled (alternative to state="disabled") */
    disabled?: boolean;
    /** Helper text displayed below the input */
    helperText?: string;
    /** Whether to show character count in helper text */
    showCharCount?: boolean;
    /** Currently selected model key (controlled) */
    selectedModel?: string;
    /** Default selected model for uncontrolled mode */
    defaultSelectedModel?: string;
    /** Available models for the dropdown */
    models?: ModelOption[];
    /**
     * Callback when model selection changes
     * @param modelKey - The selected model key
     */
    onModelChange?: (modelKey: string) => void;
    /**
     * Submit callback triggered by submit button or keyboard shortcut
     * @param text - The trimmed prompt text
     * @param modelKey - The currently selected model key
     */
    onSubmit?: (text: string, modelKey: string) => void;
    /** Callback when attachment button is clicked */
    onAttachmentClick?: () => void;
    /** Callback when voice button is clicked */
    onVoiceClick?: () => void;
    /** Callback when settings button is clicked */
    onSettingsClick?: () => void;
    /** Additional keyboard event handler (useful for custom shortcuts) */
    onKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
    /**
     * Current attachments (controlled mode)
     * Each attachment has an id, file, type, and optional preview URL
     */
    attachments?: AttachmentItem[];
    /**
     * Callback when attachments change
     * @param attachments - Updated array of attachment items
     */
    onAttachmentsChange?: (attachments: AttachmentItem[]) => void;
    /**
     * Accepted file types for attachments
     * @default ["image/*", "application/pdf"]
     */
    acceptedFileTypes?: string[];
    /**
     * Maximum file size in bytes
     * @default 10 * 1024 * 1024 (10MB)
     */
    maxFileSize?: number;
    /**
     * Maximum number of attachments
     * @default 10
     */
    maxAttachments?: number;
    /**
     * Enable image compression before upload
     * @default true
     */
    compressImages?: boolean;
    /**
     * Maximum dimension (width or height) for compressed images
     * @default 1024
     */
    maxImageDimension?: number;
    /**
     * Image compression quality (0-1)
     * @default 0.8
     */
    imageQuality?: number;
    /**
     * Callback when an attachment error occurs
     */
    onAttachmentError?: (error: AttachmentError) => void;
    /** Whether to show the attachment button (default: true) */
    showAttachmentButton?: boolean;
    /** Whether to show the voice button (default: true) */
    showVoiceButton?: boolean;
    /** Whether to show the settings button (default: true) */
    showSettingsButton?: boolean;
    /** Whether to show the model selector dropdown (default: true) */
    showModelSelector?: boolean;
    /** Custom label for submit button (for aria-label) */
    submitButtonLabel?: string;
    /** Custom icon for submit button */
    submitButtonIcon?: React.ReactNode;
    /** Visual indicator for keyboard shortcut (not functional) */
    submitShortcut?: string;
    /**
     * Callback when stop button is clicked during loading state.
     * When provided AND state="loading", the submit button becomes a stop button.
     */
    onStop?: () => void;
    /**
     * Enable inline voice recording mode.
     * When true, clicking the voice button starts an inline recording UI
     * instead of calling onVoiceClick.
     * @default false
     */
    enableVoiceRecording?: boolean;
    /**
     * Called when the user confirms a voice recording
     * @param audioBlob - The recorded audio as a Blob
     */
    onRecordingComplete?: (audioBlob: Blob) => void;
    /**
     * Called when the user cancels a voice recording
     */
    onRecordingCancel?: () => void;
    /**
     * Maximum recording duration in seconds (auto-stops at limit)
     * @default 120
     */
    maxRecordingDuration?: number;
    /**
     * Enable drag-and-drop file attachment
     * @default true
     */
    enableDropzone?: boolean;
    /**
     * Text displayed in the dropzone overlay (legacy, used as fallback for dropzoneTitle)
     * @default "Drop files here to add to chat"
     */
    dropzoneText?: string;
    /**
     * Title text for the enhanced dropzone overlay.
     * Supports **bold** markdown for the "browse" action word.
     * Falls back to dropzoneText if not provided.
     */
    dropzoneTitle?: string;
    /**
     * Subtitle text for the enhanced dropzone overlay
     */
    dropzoneSubtitle?: string;
    /**
     * Layout variant
     * - "default": stacked layout with footer toolbar below textarea
     * - "simple": inline layout with submit button next to textarea, no footer
     * @default "default"
     */
    variant?: "default" | "simple";
    /** Additional class name for the container (highest priority) */
    className?: string;
    /** Additional class name for the textarea element */
    textareaClassName?: string;
    /** Additional class name for the footer section */
    footerClassName?: string;
    /** Theme overrides for component styling */
    theme?: PromptInputThemeOverrides;
    /** ARIA label for the textarea (default: "Prompt input") */
    "aria-label"?: string;
    /** ARIA describedby for the textarea */
    "aria-describedby"?: string;
    /** ID for the textarea element */
    id?: string;
}
/**
 * Component state types
 */
export type PromptInputState = "default" | "disabled" | "invalid" | "loading";
/**
 * Model option for the model selector dropdown
 */
export interface ModelOption {
    /** Unique key for the model */
    key: string;
    /** Display label for the model */
    label: string;
    /** Optional description for the model */
    description?: string;
    /** Optional icon to display with the model */
    icon?: React.ReactNode;
}
/**
 * Theme overrides for PromptInput component
 *
 * Allows customization of component styling while maintaining
 * the shadcn approach where className prop takes highest priority.
 */
export interface PromptInputThemeOverrides {
    /** Style for the main container */
    baseStyle?: string;
    /** Style for the textarea element */
    textareaStyle?: string;
    /** Style for the footer section */
    footerStyle?: string;
    /** Style for the action buttons container */
    actionsStyle?: string;
    /** Style for the submit button */
    submitButtonStyle?: string;
    /** Style for the dropzone overlay */
    dropzoneStyle?: string;
    /** Style for the dropzone title text */
    dropzoneTitleStyle?: string;
    /** Style for the dropzone subtitle text */
    dropzoneSubtitleStyle?: string;
    /** Style for the dropzone action icons row */
    dropzoneActionsStyle?: string;
    /** Style for the voice recorder container */
    voiceRecorderStyle?: string;
    /** State-specific styles */
    states?: Partial<Record<PromptInputState, string>>;
}
/**
 * Complete theme interface (internal use)
 */
export interface PromptInputTheme {
    baseStyle: string;
    textareaStyle: string;
    footerStyle: string;
    actionsStyle: string;
    submitButtonStyle: string;
    dropzoneStyle: string;
    dropzoneTitleStyle: string;
    dropzoneSubtitleStyle: string;
    dropzoneActionsStyle: string;
    voiceRecorderStyle: string;
    states: Record<PromptInputState, string>;
}
