import { ConversationState, ConversationAPI, ConversationConfig, MessageAttachment } from '../conversation/index.js';
export { ChatAuthor, ChatMessage, ChatRole, ChatTransport, Conversation, ConversationAPI, ConversationConfig, ConversationState, MessageStatus, SendContext, SendOptions, ThreadingMode, TransportChunk, createConversation, findMessage, getReplyCount, rootIdOf, selectMainTimeline, selectReplies, selectRoots, selectThreadMessages, selectTimelineFromState } from '../conversation/index.js';
import * as React from 'react';

interface UseConversationResult {
    /** Live store snapshot (re-renders on change) */
    state: ConversationState;
    /** The underlying store, for advanced/imperative use */
    api: ConversationAPI;
    sendMessage: ConversationAPI['sendMessage'];
    newConversation: ConversationAPI['newConversation'];
    selectConversation: ConversationAPI['selectConversation'];
    deleteConversation: ConversationAPI['deleteConversation'];
    renameConversation: ConversationAPI['renameConversation'];
    editMessage: ConversationAPI['editMessage'];
    deleteMessage: ConversationAPI['deleteMessage'];
    react: ConversationAPI['react'];
    retryLast: ConversationAPI['retryLast'];
    stop: ConversationAPI['stop'];
    openThread: ConversationAPI['openThread'];
    replyTo: ConversationAPI['replyTo'];
    closeThread: ConversationAPI['closeThread'];
    setThreadingMode: ConversationAPI['setThreadingMode'];
}
/**
 * useConversation — binds the headless `createConversation` store to React via
 * `useSyncExternalStore`. The store is created once; a changing `config.transport`
 * is hot-swapped so consumers can wire the backend after mount.
 */
declare function useConversation(config?: ConversationConfig): UseConversationResult;

/** A `/` command entry. */
interface SlashCommand {
    id: string;
    label: string;
    description?: string;
    icon?: string;
    /** Text inserted into the composer when chosen. If omitted, `onSlashCommand` fires and the trigger is removed. */
    insertText?: string;
}
/** An `@` mention candidate. */
interface Mention {
    id: string;
    label: string;
    avatarUrl?: string;
}
interface ComposerProps {
    placeholder?: string;
    busy?: boolean;
    /** `/` command palette entries */
    slashCommands?: SlashCommand[];
    /** `@` mention candidates — array or (async) resolver of a query */
    mentions?: Mention[] | ((query: string) => Mention[] | Promise<Mention[]>);
    /** Show the markdown formatting toolbar (default true) */
    toolbar?: boolean;
    /** Enable `:` emoji autocomplete (default true) */
    emoji?: boolean;
    /** Enable the attach button (default true) */
    attachments?: boolean;
    onSubmit: (content: string, attachments?: MessageAttachment[]) => void;
    onStop?: () => void;
    /** Called when a `/` command without `insertText` is chosen */
    onSlashCommand?: (cmd: SlashCommand) => void;
    autoFocus?: boolean;
}
/**
 * Composer — rich message input: markdown formatting toolbar + Cmd/Ctrl shortcuts,
 * and `/` command, `@` mention, and `:` emoji autocomplete menus.
 */
declare function Composer({ placeholder, busy, slashCommands, mentions, toolbar, emoji, attachments, onSubmit, onStop, onSlashCommand, autoFocus, }: ComposerProps): React.DetailedReactHTMLElement<{
    className: string;
}, HTMLElement>;

interface ChatProps {
    conversation: UseConversationResult;
    showConversationList?: boolean;
    showModeToggle?: boolean;
    placeholder?: string;
    currentUserId?: string;
    emptyState?: React.ReactNode;
    className?: string;
    slashCommands?: SlashCommand[];
    mentions?: Mention[] | ((query: string) => Mention[] | Promise<Mention[]>);
    onSlashCommand?: (cmd: SlashCommand) => void;
    composerToolbar?: boolean;
}
/**
 * Chat — batteries-included composite over `useConversation()`:
 * conversation sidebar + main timeline + rich composer + thread side panel.
 * Hybrid layout: assistant replies full-width, user messages in a right-aligned
 * bubble. Markdown/code/gifs, reactions, edit/delete, streaming, and a composer
 * with `/` commands, `@` mentions, `:` emoji, and a formatting toolbar.
 */
declare function Chat({ conversation, showConversationList, showModeToggle, placeholder, currentUserId, emptyState, className, slashCommands, mentions, onSlashCommand, composerToolbar, }: ChatProps): React.DetailedReactHTMLElement<{
    className: string;
}, HTMLElement>;

export { Chat, type ChatProps, Composer, type ComposerProps, type Mention, type SlashCommand, type UseConversationResult, useConversation };
