import { LitElement, nothing, type PropertyValues } from 'lit'; import type { Size, Attachment } from '../../types/index.js'; /** * @tag loquix-message-attachments * @summary Displays file attachments inside a message as a grid of visual cards * with image previews, file icons, and optional remove buttons. * * @csspart grid - Outer wrapper containing the list and overflow button. * @csspart card - Individual attachment card wrapper. * @csspart thumbnail - Thumbnail area (image preview or file icon). * @csspart filename - Filename text. * @csspart filesize - File size text. * @csspart remove - Remove button on each card. * @csspart overflow - "+N more" expand button. * * @cssprop [--loquix-message-attachments-gap=8px] - Gap between cards. * @cssprop [--loquix-message-attachments-card-bg=rgba(0,0,0,0.03)] - Card background. * @cssprop [--loquix-message-attachments-card-border-color=rgba(0,0,0,0.08)] - Card border color. * @cssprop [--loquix-message-attachments-card-border-radius=8px] - Card border radius. * @cssprop [--loquix-message-attachments-card-hover-shadow=0 1px 4px rgba(0,0,0,0.1)] - Card hover shadow. * @cssprop [--loquix-message-attachments-sm-size=48px] - Card width at `sm` size. * @cssprop [--loquix-message-attachments-md-size=80px] - Card width at `md` size. * @cssprop [--loquix-message-attachments-lg-size=120px] - Card width at `lg` size. * @cssprop [--loquix-message-attachments-xs-size=28px] - Thumbnail size at `xs` size. * * @fires loquix-attachment-click - Fired when a card is clicked. Detail: { attachment } * @fires loquix-attachment-remove - Fired when the remove button is clicked. Detail: { attachment } */ export declare class LoquixMessageAttachments extends LitElement { static styles: import("lit").CSSResult[]; private _localize; /** Array of attachment objects to display. */ attachments: Attachment[]; /** Card size variant. */ size: Size; /** Whether to show remove buttons on each card. */ removable: boolean; /** Maximum number of visible cards. 0 means show all. */ maxVisible: number; /** Whether the overflow is expanded (show all). */ private _expanded; protected willUpdate(changed: PropertyValues): void; /** Check if a filetype represents an image. */ private _isImageType; /** Return an emoji icon based on file type. */ private _getFileIcon; /** Format bytes into human-readable string. */ private _formatSize; /** Truncate filename preserving extension. */ private _truncateFilename; /** * Sanitise URL for ``. * Allows https, http, blob. For data: URLs, only `data:image/*` (case-insensitive) * is permitted, excluding `data:image/svg+xml` (defense-in-depth: SVG can contain scripts). */ private _safeImageSrc; private _onClick; private _onRemove; private _handleExpand; /** Build the card title tooltip string. */ private _cardTitle; /** Build the aria-label for a card. */ private _cardAriaLabel; /** Render a single attachment card. */ private _renderCard; protected render(): import("lit").TemplateResult<1> | typeof nothing; } //# sourceMappingURL=loquix-message-attachments.d.ts.map