import type { ChatComposerToken, ChatComposerTokenCustom } from './ChatComposerInput';
export interface TokenPortal {
    id: string;
    span: HTMLSpanElement;
    token: ChatComposerToken;
}
export interface UseChatComposerTokensOptions {
    /** Ref to the contentEditable element. */
    editableRef: React.RefObject<HTMLDivElement | null>;
    /** Called after token insertion/removal to sync state. */
    onEmitChange: () => void;
}
export interface UseChatComposerTokensReturn {
    /** Active token portals — render via createPortal in the component. */
    tokenPortals: TokenPortal[];
    /** Expand a token — replace the token span with its text value. */
    expandToken: (id: string) => void;
    /** Insert a token at the current cursor position. */
    insertToken: (token: ChatComposerToken) => string | undefined;
    /** Handle keydown — intercepts Backspace near tokens. Returns true if handled. */
    handleKeyDown: (e: React.KeyboardEvent) => boolean;
    /** Handle paste — prevents pasting into token spans. Returns true if handled. */
    handlePaste: (e: React.ClipboardEvent) => boolean;
    /** Clean up orphaned portals (call after content changes). */
    cleanupPortals: () => void;
}
/** Type guard: does this token use the custom render path? */
export declare function isCustomToken(token: ChatComposerToken): token is ChatComposerTokenCustom;
export declare function useChatComposerTokens({ editableRef, onEmitChange, }: UseChatComposerTokensOptions): UseChatComposerTokensReturn;
//# sourceMappingURL=useChatComposerTokens.d.ts.map