import { KeyboardEventHandler } from 'react';

/** Props for the TextArea auto-resizing input component. */
interface TextAreaProps {
    /** Current text value (controlled). */
    value: string;
    /** Called on every input change with the new text value. */
    onChange: (value: string) => void;
    /** Placeholder text shown when the textarea is empty. */
    placeholder?: string;
    /** Maximum height in pixels before the textarea scrolls instead of growing. */
    maxHeight?: number;
    /** Initial number of visible text rows. @default 1 */
    rows?: number;
    /** Whether to focus the textarea on mount. */
    autoFocus?: boolean;
    /** Keyboard event handler — useful for intercepting Enter to send. */
    onKeyDown?: KeyboardEventHandler<HTMLTextAreaElement>;
    /** Whether the textarea is non-interactive. */
    disabled?: boolean;
    /** Additional CSS class name. */
    className?: string;
}

export type { TextAreaProps as T };
