import { ChangeEvent, Ref } from 'react'; import { ChatInputV2AttachedFile } from './ChatInputV2.types'; export declare const FILE_NAME_TAG_MAX_LEN = 8; export declare const truncateFileNameForTag: (name: string) => string; /** Layout buffer and “+ N more” reserve — mirrors `AttachmentFile` in ChatInput. */ export declare const ATTACHMENT_ROW_BUFFER_PX = 30; export declare const ATTACHMENT_ROW_MORE_BUTTON_RESERVE_PX = 100; export declare const ATTACHMENT_ROW_GAP_PX = 8; export declare const OVERFLOW_MENU_TRIGGER_CLASS = "overflow-menu-trigger"; /** Outer container resize: ignore tiny fluctuations; treat meaningful width change as ≥10px. */ export declare function isSignificantOuterWidthChange(previousWidth: number, nextWidth: number): boolean; /** Wider viewport → allow re-measuring with more chips visible (see `isExpanding` in row). */ export declare function isOuterWidthExpanding(previousWidth: number, nextWidth: number): boolean; /** * After `attachedFiles.length` changes, update visible cutoff without flashing all chips on remove * or jumping to full list on add. */ export declare function reduceCutoffForFileCountChange(previousFileCount: number, nextFileCount: number): (currentCutoff: number) => number; /** When true with fewer rendered chips than files, the row first sets the cutoff to all files, then re-runs (viewport widening or file list shrink). */ export declare function shouldExpandCutoffToMeasureAllChips(isExpanding: boolean, renderedChipCount: number, attachedFileCount: number): boolean; type ComputeCutoffArgs = { filesContainer: HTMLElement; attachedFileCount: number; /** Inter-chip gap in px — must match `gap` on the flex row (from tokens, e.g. `attachedFilesContainer.gap`). */ rowGapPx: number; }; /** * Walk visible chip DOM nodes and compute how many files can stay inline before “+ N more”. */ export declare function computeAttachmentRowCutoff({ filesContainer, attachedFileCount, rowGapPx, }: ComputeCutoffArgs): number; export declare function sliceVisibleChatInputV2AttachedFiles(attachedFiles: ChatInputV2AttachedFile[], cutOffIndex: number): ChatInputV2AttachedFile[]; export declare function sliceOverflowChatInputV2AttachedFiles(attachedFiles: ChatInputV2AttachedFile[], cutOffIndex: number): ChatInputV2AttachedFile[]; /** Max height in px: explicit prop wins; otherwise parse token `maxHeight` (defaults to 200). */ export declare function resolveChatInputV2TextareaMaxHeightPx(textareaMaxHeightProp: number | undefined, tokenMaxHeight: unknown): number; /** ChatGPT-style auto-grow: clamp scroll height to `maxHeightPx`. */ export declare function applyChatInputV2TextareaAutoHeight(el: HTMLTextAreaElement | null, maxHeightPx: number): void; export declare function notifyChatInputV2DuplicateFiles(duplicateFileNames: string[]): void; /** Hidden file input: filters duplicates vs `attachedFiles`, shows SnackbarV2, forwards new files. Resets input value. */ export declare function handleChatInputV2FileInputChange(e: ChangeEvent, attachedFiles: ChatInputV2AttachedFile[], onAttachFiles: (files: File[]) => void): void; export declare function assignForwardedRef(node: T | null, ref: Ref | null | undefined): void; export declare const truncatePlaceholder: (textarea: HTMLTextAreaElement | null, placeholder: string | undefined) => string | undefined; export declare const removePxFromValue: (value: number | string) => number; export {};