import type { FormEvent, KeyboardEvent, ReactNode } from "react"; import type { ChatStatus } from "../../Chat/types"; import type { TextAreaAutoSizeProps } from "../../Fields/TextAreaAutoSize/TextAreaAutoSize"; export type ChatPromptLocale = { textareaLabel?: string; emptyMessageTooltip?: string; stopResponseTooltip?: string; sendMessageTooltip?: string; disabledTooltip?: string; }; export type ChatPromptProps = Omit & { /** * Content to render above the textarea (e.g., a title or instructions). */ renderHeader?: ReactNode; /** * Content to render below the textarea (e.g., additional controls or hints). */ renderFooter?: ReactNode; /** * An optional array of placeholder strings to cycle through with a typewriter effect. * If provided and non-empty, the component will use the dynamic, animated placeholder * text instead of any static `placeholder` prop passed in. */ placeholders?: string[]; /** * The current status of the chat prompt submit button: * - "submitted": The message has been sent to the API and we're awaiting the start of the response stream. * - "streaming": The response is actively streaming in from the API, receiving chunks of data. * - "ready": The full response has been received and processed; a new user message can be submitted. * - "error": An error occurred during the API request, preventing successful completion. */ status?: ChatStatus; /** * Whether to automatically focus the textarea when the user starts typing. */ autoFocusOnTyping?: boolean; /** * Whether to enable right-to-left (RTL) layout support. */ rtl?: boolean; /** * Optional locale. */ locale?: ChatPromptLocale; /** * Callback invoked when the user submits the form, either by clicking * the submit button or pressing Enter (without Shift) inside the textarea. */ onSubmit?: (e: KeyboardEvent | FormEvent) => void; /** * Callback invoked when the user requests to stop the current chat response stream. */ onStop?: () => void; }; /** * The `ChatPrompt` component provides a textarea for users to type messages and a button to submit them. * * See the [ChatPrompt documentation page](https://satellite.algolia.com/8261d6576/p/06f740-chat-prompt) for more information. */ export declare const ChatPrompt: import("react").ForwardRefExoticComponent & { /** * Content to render above the textarea (e.g., a title or instructions). */ renderHeader?: ReactNode; /** * Content to render below the textarea (e.g., additional controls or hints). */ renderFooter?: ReactNode; /** * An optional array of placeholder strings to cycle through with a typewriter effect. * If provided and non-empty, the component will use the dynamic, animated placeholder * text instead of any static `placeholder` prop passed in. */ placeholders?: string[]; /** * The current status of the chat prompt submit button: * - "submitted": The message has been sent to the API and we're awaiting the start of the response stream. * - "streaming": The response is actively streaming in from the API, receiving chunks of data. * - "ready": The full response has been received and processed; a new user message can be submitted. * - "error": An error occurred during the API request, preventing successful completion. */ status?: ChatStatus; /** * Whether to automatically focus the textarea when the user starts typing. */ autoFocusOnTyping?: boolean; /** * Whether to enable right-to-left (RTL) layout support. */ rtl?: boolean; /** * Optional locale. */ locale?: ChatPromptLocale; /** * Callback invoked when the user submits the form, either by clicking * the submit button or pressing Enter (without Shift) inside the textarea. */ onSubmit?: (e: KeyboardEvent | FormEvent) => void; /** * Callback invoked when the user requests to stop the current chat response stream. */ onStop?: () => void; } & import("react").RefAttributes>;