import type { AttachmentUploadApi } from "./api.js"; import type { ReadyAttachment, SubmitAttachmentQueue } from "./submit-adapter.js"; export type AttachmentDraftState = "waiting" | "uploading" | "ready" | "failed"; export interface AttachmentDraft { readonly id: string; readonly displayName: string; readonly size: number; readonly state: AttachmentDraftState; readonly progress: number; readonly detectedType?: string; readonly fileRef?: string; readonly errorCode?: string; } export interface AttachmentQueueOptions { readonly concurrency?: number; readonly maxDraftFiles?: number; readonly maxDraftBytes?: number; } export declare class AttachmentQueueError extends Error { readonly code: string; readonly name = "AttachmentQueueError"; constructor(code: string, message: string); } export declare class AttachmentQueue implements SubmitAttachmentQueue { private readonly api; private readonly sessions; private readonly concurrency; private readonly maxDraftFiles; private readonly maxDraftBytes; private running; private sequence; private pumpScheduled; constructor(api: AttachmentUploadApi, options?: AttachmentQueueOptions); enqueue(sessionId: string, files: Iterable): readonly string[]; getSnapshot(sessionId: string): readonly AttachmentDraft[]; subscribe(sessionId: string, listener: () => void): () => void; hasDrafts(sessionId: string): boolean; waitUntilReady(sessionId: string): Promise; cancel(sessionId: string, id: string): Promise; retry(sessionId: string, id: string): void; remove(sessionId: string, id: string): Promise; adoptAndClear(sessionId: string): Promise; dispose(): void; private session; private publish; private schedulePump; private pump; private run; }