import React from 'react'; import { SilkeTextFieldOutlineProps } from '../silke-text-field/silke-text-field-outline'; import { SilkeFileCategory } from './file-utils'; import { SilkeCommand, SilkeCommandTextFieldValue } from './utils'; export type SilkeCommandTextFieldProps = SilkeTextFieldOutlineProps & { /** * File type categories to accept as attachments. * - `'image'` — all image types (png, jpeg, gif, etc.) * - `'text'` — documents and text files (PDF, Word, Excel, CSV, TXT, JSON, etc.) * Defaults to `[]` (no files accepted). */ acceptedFileTypes?: SilkeFileCategory[]; autoFocus?: boolean; availableCommands: SilkeCommand[]; disabled?: boolean; /** Maximum height in pixels before the field starts scrolling */ maxHeight?: number; name?: string; onChange: (value: SilkeCommandTextFieldValue[]) => void; onCommandFocus?: (index: number, command: SilkeCommandTextFieldValue | undefined) => void; onKeyDown?: (e: React.KeyboardEvent) => void; onSuggestions?: (suggestions: SilkeCommand[]) => void; placeholder?: string; value: SilkeCommandTextFieldValue[]; }; export type SilkeCommandTextFieldHandle = { /** Remove focus from the input */ blur: () => void; /** Focus the input */ focus: () => void; /** Open the file picker dialog (requires acceptedFileTypes to be set) */ openFilePicker: () => void; /** Get the current value as a string */ toString: (value?: SilkeCommandTextFieldValue[]) => string; /** * Update command in the commands array. * @param command - the command to update * @param index - defaults to active index, use -1 to append */ update: (command: SilkeCommand, index?: number) => void; }; declare const SilkeCommandTextField: React.ForwardRefExoticComponent void; onCommandFocus?: (index: number, command: SilkeCommandTextFieldValue | undefined) => void; onKeyDown?: (e: React.KeyboardEvent) => void; onSuggestions?: (suggestions: SilkeCommand[]) => void; placeholder?: string; value: SilkeCommandTextFieldValue[]; } & React.RefAttributes>; export { SilkeCommandTextField };