export type MediaKind = "image" | "video" | "audio" | "youtube" | "pdf" | "doc" | "text" | "spreadsheet" | "presentation" | "archive" | "file"; export interface MediaItem { /** Unique id of the item, used as the React key and for tile selection. */ key: string; /** Chooses the viewer: image, video, audio, YouTube embed or a document stage. */ kind: MediaKind; /** Fetchable url; for `youtube` it is the video id instead. */ src: string; /** Thumbnail url for the tile strip; null shows a kind icon instead. */ thumb: string | null; /** 1-based position within the item's kind, used in tile names such as "image 2". */ ordinal: number; /** Date string shown as the uploaded date in the details line. */ uploadedAt?: string | null; /** Size in bytes, shown beside the file type in the details line. */ fileSize?: number | null; /** Accessible name of the player or stage for this item; falls back to the viewer `title`. */ name?: string | null; } export interface MediaFile { /** Stored path passed to `resolveUrl`; an absolute blob:, data: or http(s): url is used as is. */ path: string; /** Date string shown as the uploaded date in the details line. */ uploadedAt?: string | null; /** Size in bytes, shown beside the file type in the details line. */ fileSize?: number | null; } export type MediaSource = string | MediaFile; export interface MediaSources { /** Image paths or files, in display order. */ photos: MediaSource[]; /** Video paths or files, in display order. */ videos: MediaSource[]; /** YouTube video ids, not urls. */ youtubeVideoIds: string[]; } export interface ViewerFile { /** Stored path passed to `resolveUrl`, or an absolute url used as is; also drives kind detection when `name` has no known extension. */ url: string; /** File name; picks the viewer kind before the url does and names the stage. */ name?: string | null; /** Date string shown as the uploaded date in the details line. */ uploadedAt?: string | null; /** Size in bytes, shown beside the file type in the details line. */ fileSize?: number | null; } export type FileKind = Exclude; export interface PreviewPlan { /** Indexes into `items` to show as preview tiles, in order. */ tiles: number[]; /** How many items are left out, for a "+N more" tile. */ hidden: number; } /** Resolves an app-stored path to a fetchable url; the host app owns base-url/CDN logic. */ export type ResolveUrl = (path: string) => string; /** Lowest image zoom, in percent. */ export declare const MIN_ZOOM = 25; /** Highest image zoom, in percent. */ export declare const MAX_ZOOM = 400; /** Percent added or removed by one zoom-in or zoom-out press. */ export declare const ZOOM_STEP = 25; /** Rates offered in the playback-speed menu. */ export declare const PLAYBACK_SPEEDS: readonly [0.5, 0.75, 1, 1.25, 1.5, 2]; /** Seconds skipped by the rewind and forward buttons and their J / L keys. */ export declare const SEEK_STEP_SECONDS = 10; /** Passes an already-absolute url through untouched; only a bare stored path goes through resolveUrl. */ export declare const resolveMediaUrl: (path: string, resolveUrl: ResolveUrl) => string; export declare const isUnsupportedImageSrc: (src: string) => boolean; export declare const isUnsupportedVideoSrc: (src: string) => boolean; /** Picks the viewer kind from the file name first, falling back to the url — bare `.doc` is not `doc`. */ export declare const fileKind: (url: string, name?: string | null) => FileKind; export declare const youtubeThumb: (videoId: string) => string; export declare const youtubeEmbed: (videoId: string) => string; export declare const youtubeWatch: (videoId: string) => string; export declare const asFile: (source: MediaSource) => MediaFile; /** Builds ordered viewer items from DB-backed photos/videos/YouTube ids; ordinal restarts per group. */ export declare function buildMediaItems(sources: MediaSources, resolveUrl: ResolveUrl): MediaItem[]; /** Builds viewer items from a flat file list; ordinal numbering is per-kind, not per-list-position. */ export declare function buildFileItems(files: ViewerFile[], resolveUrl: ResolveUrl): MediaItem[]; export declare function countMedia(items: MediaItem[]): Record; export declare function planPreview(items: MediaItem[], slots: number): PreviewPlan; export declare const wrapIndex: (index: number, length: number) => number; export declare const clampZoom: (zoom: number) => number; export declare function formatClock(totalSeconds: number): string; export declare function mediaLink(item: MediaItem, atSeconds?: number): string; export declare function formatFileSize(bytes: number): string; export declare function formatUploadedDate(value: string): string; export declare function fileTypeLabel(src: string): string | null; /** True while the event target is a text field or slider, so keyboard shortcuts stay out of its way. */ export declare function isTypingTarget(target: EventTarget | null): boolean;