import React from 'react';
import { useDropdownStatus } from '../../internal/components/dropdown-status';
import { CaretController } from '../core/caret-controller';
import { MenuItemsHandlers, MenuItemsState } from '../core/menu-state';
import { PortalContainer } from '../core/token-renderer';
import { PromptInputProps } from '../interfaces';
/** Mutable state shared between the editable tokens hook and event handlers. */
export interface EditableState {
    skipNextZeroWidthUpdate: boolean;
    menuSelectionTokenId: string | null;
}
export declare function createEditableState(): EditableState;
/** Configuration for the useTokenMode hook — all props needed to drive token-mode behavior. */
export interface UseTokenModeConfig {
    editableElementRef: React.RefObject<HTMLDivElement>;
    caretControllerRef: React.MutableRefObject<CaretController | null>;
    tokens?: readonly PromptInputProps.InputToken[];
    tokensToText?: (tokens: readonly PromptInputProps.InputToken[]) => string;
    menus?: readonly PromptInputProps.MenuDefinition[];
    disabled?: boolean;
    readOnly?: boolean;
    autoFocus?: boolean;
    placeholder?: string;
    invalid?: boolean;
    warning?: boolean;
    ariaLabel?: string;
    ariaLabelledby?: string;
    ariaDescribedby?: string;
    ariaRequired?: boolean;
    disableBrowserAutocorrect?: boolean;
    spellcheck?: boolean;
    onChange: (detail: {
        value: string;
        tokens: PromptInputProps.InputToken[];
    }) => void;
    onTriggerDetected?: (detail: PromptInputProps.TriggerDetectedDetail) => boolean;
    onAction?: PromptInputProps['onAction'];
    onBlur?: PromptInputProps['onBlur'];
    onFocus?: PromptInputProps['onFocus'];
    onKeyDown?: PromptInputProps['onKeyDown'];
    onKeyUp?: PromptInputProps['onKeyUp'];
    onMenuItemSelect?: PromptInputProps['onMenuItemSelect'];
    onMenuFilter?: PromptInputProps['onMenuFilter'];
    onMenuLoadItems?: PromptInputProps['onMenuLoadItems'];
    i18nStrings?: PromptInputProps['i18nStrings'];
    adjustInputHeight: () => void;
}
/** Return value of useTokenMode — state, handlers, and attributes consumed by TokenMode component. */
export interface UseTokenModeResult {
    portalContainersRef: React.MutableRefObject<Map<string, PortalContainer>>;
    /** Snapshot of portal containers for rendering portals. Updated after each renderTokensToDOM call. */
    portalContainers: PortalContainer[];
    /** Portal elements to render — renders Token components into DOM containers via createPortal. */
    portals: React.ReactPortal[];
    editableState: EditableState;
    editableElementAttributes: React.HTMLAttributes<HTMLDivElement> & {
        'data-placeholder'?: string;
    };
    activeTriggerToken: PromptInputProps.TriggerToken | null;
    activeMenu: PromptInputProps.MenuDefinition | null;
    menuIsOpen: boolean;
    menuFilterText: string;
    triggerWrapperRef: React.MutableRefObject<HTMLElement | null>;
    triggerWrapperReady: boolean;
    menuListId: string;
    menuFooterControlId: string;
    highlightedMenuOptionId: string | undefined;
    menuItemsState: MenuItemsState;
    menuItemsHandlers: MenuItemsHandlers;
    menuDropdownStatus: ReturnType<typeof useDropdownStatus> | null;
    shouldRenderMenuDropdown: boolean;
    handleInput: () => void;
    handleLoadMore: () => void;
    tokenOperationAnnouncement: string;
    markTokensAsSent: (tokens: readonly PromptInputProps.InputToken[]) => void;
}
/** Encapsulates all token-mode logic: trigger detection, menu state, keyboard handling, and rendering. */
export declare function useTokenMode(config: UseTokenModeConfig): UseTokenModeResult;
//# sourceMappingURL=use-token-mode.d.ts.map