import { type Readable } from "node:stream"; import { type LocatedFile } from "./io.js"; export type AttachmentPreviewType = "image" | "markdown" | "html" | "text" | "download"; export interface RoomMessageAttachment { id: string; storedFilename: string; originalFilename: string; size?: number; mime?: string; previewType: AttachmentPreviewType; } export declare function filenameExt(filename: string): string; export declare function inferAttachmentPreviewType(filename: string): AttachmentPreviewType; export declare function displayFilename(filename: string): string; export declare const MAX_UPLOAD_SIZE: number; export type AttachmentLocation = { kind: "room"; roomId: string; } | { kind: "dm"; memberId: string; } | { kind: "mm"; memberIds: [string, string]; }; export interface StoredAttachment { storedFilename: string; originalFilename: string; absolutePath: string; size: number; } export type AttachmentImportOutcome = ({ ok: true; } & StoredAttachment) | { ok: false; path: string; error: string; }; export declare function storeAttachment(source: Readable, location: AttachmentLocation, originalFilename: string, maxSize?: number): Promise; /** Validate local paths against host-authorized roots, then copy each file into one attachment store. */ export declare function importAttachments(paths: string[], location: AttachmentLocation, allowedRoots: string[], maxSize?: number): Promise; export declare function getAttachmentPath(location: AttachmentLocation, storedFilename: string): string; export declare function locateAttachment(location: AttachmentLocation, storedFilename: string, maxSizeBytes?: number): LocatedFile; export declare function attachmentExists(location: AttachmentLocation, storedFilename: string): boolean; //# sourceMappingURL=attachments.d.ts.map