export type MediaAttachmentKind = 'image' | 'audio' | 'video' | 'file'; /** Allow private conditional caching, but recheck access before every reuse. */ export declare const MEDIA_CACHE_CONTROL = "private, max-age=0, must-revalidate"; /** Preserve Unicode and the extension while removing unsafe filesystem characters. */ export declare function sanitizeDownloadFileName(value: unknown, fallback?: string): string; /** RFC 6266: readable ASCII fallback plus the exact UTF-8 filename. */ export declare function buildMediaContentDisposition(input: { fileName?: unknown; fallbackFileName: string; disposition?: 'inline' | 'attachment'; }): string; /** The processor changes the container to MP4; keep its name consistent everywhere. */ export declare function processedVideoFileName(value: unknown): string; /** Lifecycle for newly uploaded videos that are normalized server-side. */ export type VideoProcessingStatus = 'processing' | 'ready' | 'failed'; /** Stable, display-safe reasons for a terminal video processing failure. */ export type VideoProcessingErrorCode = 'invalid_video' | 'video_limits_exceeded' | 'video_processing_failed'; export interface MediaAttachment { kind: MediaAttachmentKind; url: string; /** * Server-issued identity for a finalized upload. The send path * uses this to retain temporary canonical media atomically with the message. * Older attachments and forwarded copies may omit it. */ uploadId?: string; mimeType?: string; fileName?: string; sizeBytes?: number; width?: number; height?: number; durationMs?: number; /** Server-generated poster for a normalized video. */ thumbnailUrl?: string; /** Missing means a legacy attachment that is immediately playable. */ processingStatus?: VideoProcessingStatus; processingErrorCode?: VideoProcessingErrorCode; } export declare function inferMediaAttachmentKind(mimeType: string): MediaAttachmentKind; export declare function getStoredFileExtension(input: { mimeType?: string | null; fileName?: string | null; }): string; export declare function normalizeStoredAttachments(value: unknown): MediaAttachment[] | null; export declare function getMessageAttachments(input: { attachments?: unknown; }): MediaAttachment[]; export declare function getPrimaryAttachment(input: { attachments?: unknown; }): MediaAttachment | null; export declare function describeAttachment(attachment: MediaAttachment | null | undefined): string | null;