import { LitElement, type PropertyValues } from 'lit'; import type { Attachment } from '../../types/index.js'; /** * @tag loquix-attachment-panel * @summary Container for managing file attachments with file picker and attachment chips. * Drag-and-drop is handled by the parent `loquix-chat-composer` via `loquix-drop-zone`. * * @csspart panel - The panel container * @csspart chips - The chips grid * @csspart trigger - The upload trigger button * * @slot trigger - Custom upload trigger button * @slot trigger-icon - Custom icon for the default trigger button * * @method openFilePicker - Opens the native file picker programmatically * @method addFiles - Programmatically add files (e.g. from paste or external drop) * * @fires loquix-attachment-add - Fired when files are added. Detail: { attachments } * @fires loquix-attachment-remove - Re-dispatched from child attachment-chip */ export declare class LoquixAttachmentPanel extends LitElement { static styles: import("lit").CSSResult[]; private _localize; /** Array of current attachments. */ attachments: Attachment[]; /** Accepted file types (MIME or extension). */ acceptedTypes: string; /** Maximum number of files allowed. */ maxFiles: number; /** Maximum file size in bytes (default: 10 MB). */ maxSize: number; /** Allow multiple file selection. */ multiple: boolean; /** Whether the panel is disabled. */ disabled: boolean; /** Hide the default trigger button. Use when providing an external upload button. */ noTrigger: boolean; /** Label text for the default trigger button. */ triggerLabel?: string; private _fileInput?; /** Map of attachment id → blob URL for image previews. */ private _previewUrls; private _uploadSvg; private get _isMaxReached(); private _isImageFile; /** * Returns a blob URL preview for image attachments that have a File object. * Lazily creates and caches the URL to avoid re-creating on each render. */ private _getPreviewUrl; /** Revoke blob URLs for attachments no longer in the list. */ private _cleanupPreviewUrls; protected updated(changed: PropertyValues): void; disconnectedCallback(): void; private _handleTriggerClick; /** * Programmatically opens the native file picker dialog. * Respects `disabled` and `maxFiles` constraints. */ openFilePicker(): void; /** * Programmatically add files (e.g. from paste or external drop). * Respects `disabled`, `acceptedTypes`, `maxSize`, and `maxFiles` constraints. */ addFiles(files: File[]): void; private _handleFileSelect; /** * Centralized validation for files from both the file-input and drag-and-drop. * Filters by acceptedTypes (MIME type and extension), maxSize, multiple flag, * and maxFiles remaining capacity. Returns the validated subset of files. */ private _processFiles; /** Run validation then dispatch the attachment-add event. */ private _emitValidFiles; private _handleChipRemove; protected render(): import("lit").TemplateResult<1>; } //# sourceMappingURL=loquix-attachment-panel.d.ts.map