import type { MessagePaste } from '../types.js'; export type PasteUploadResult = { paste: MessagePaste; } | { error: string; } | { unsupported: true; }; /** Pastes over inlineMaxBytes are saved with the target and sent by placeholder; undefined keeps them text. */ export interface ComposerPastes { inlineMaxBytes: number | undefined; upload: (text: string) => Promise; } /** A paste waiting in the composer as a file card; paste is set once saved. */ export interface PasteCard { key: string; /** Unknown for a paste taken back from the target, which keeps its text. */ text?: string | undefined; lines: number; bytes: number; paste?: MessagePaste; error?: string; } /** The composer the cards belong to. Each getter is read when needed, so it answers with the latest. */ export interface PasteCardsHost { pastes: () => ComposerPastes | undefined; input: () => string; setInput: (value: string) => void; onCardsChange: (cards: PasteCard[]) => void; } export interface PasteCards { /** Reports whether the paste became a card, so the caller stops the text pasting too. */ handleTextPaste: (raw: string) => boolean; /** Moves pastes between the box and cards for a new inline limit, such as another model's. */ applyInlineLimit: (inlineMax: number) => void; removeCard: (key: string) => void; /** Empties the cards, answering with the pastes that were saved. */ takeCards: () => MessagePaste[]; /** Puts back cards taken for a send that failed. */ returnCards: (taken: PasteCard[]) => void; /** Cards for pastes the target already saved, such as a message's taken back before it was read. */ savedCards: (pastes: MessagePaste[]) => PasteCard[]; } /** Keeps a composer's cards in step with the model, so text or card shows how each paste is sent. */ export declare function createPasteCards(host: PasteCardsHost): PasteCards;