import type { MediaItem } from "../mediaItems"; /** Result of the host app resolving a document item to a fetchable url (and, for DOCX, a Blob). */ export type DocumentResolution = { status: "loading"; } | { status: "ready"; url: string; blob?: Blob; } | { status: "missing"; } | { status: "error"; }; /** Host-supplied resolver, called every render like a hook-shaped prop — no default, no built-in fetch. */ export type ResolveDocument = (item: MediaItem) => DocumentResolution; /** All copy shown by the document stage, merged over `defaultMediaDocumentStageLabels`. */ export interface MediaDocumentStageLabels { /** Download button's accessible name on every status panel. */ download: string; /** Headline shown for a kind with no inline preview (spreadsheet, presentation, archive, non-docx doc). */ noPreview: string; /** Hint text under `noPreview`, prompting a download instead. */ noPreviewHint: string; /** Spinner label while `resolveDocument` reports `status: "loading"`, and while fetching a text file. */ loadingFile: string; /** Shown when `resolveDocument` reports `status: "missing"` or `"error"`, or a docx resolves with no blob. */ fileError: string; /** Shown when a text/code file fails to fetch for preview. */ textLoadError: string; } export declare const defaultMediaDocumentStageLabels: MediaDocumentStageLabels; /** Props for the pdf/doc/text/spreadsheet/presentation/archive/file stage. */ export interface MediaDocumentStageProps { /** The document item to render; changing `item.key` resets internal render-failure state. */ item: MediaItem; /** Accessible name / display label for the file. */ label: string; /** Resolves `item` to a url/blob; the host app owns its own data-fetching pipeline. */ resolveDocument: ResolveDocument; /** Overrides for any of `defaultMediaDocumentStageLabels`, merged over the defaults. */ labels?: Partial; }