import * as react from 'react'; import { ReactNode, CSSProperties } from 'react'; import { I as ImageViewerProps } from './ImageViewer.types-BaqlDeuo.js'; import { V as VideoViewerProps } from './VideoViewer.types-_AwQ8DQr.js'; import { A as AudioViewerProps } from './AudioViewer.types-CyhmQVQd.js'; import { P as PdfViewerProps } from './PdfViewer.types-_u6vboSl.js'; /** * Resolve what kind of media a source is, from its MIME type (preferred) or its * URL — a file extension, or the type embedded in a `data:` URI. * * Shared by `` to pick the right per-type viewer, and exported so * downstream packages (e.g. fancy-code's file viewer) can make the same * text-vs-media decision without re-deriving the table. */ type MediaKind = "image" | "video" | "audio" | "pdf" | "unknown"; interface ResolveMediaTypeInput { /** MIME type — preferred when known (e.g. `"image/png"`, `"video/mp4"`). */ mime?: string | null; /** * Source URL — used to sniff the kind from a file extension, or from the type * embedded in a `data:` URI, when no `mime` is given. `http(s):` / `data:` / * `blob:` are all accepted (a bare `blob:` URL carries no type, so pass * `mime` alongside it). */ src?: string | null; } /** * Resolve a {@link MediaKind} from a MIME type and/or source URL. MIME wins * when it's conclusive; otherwise the `src` is sniffed (a `data:` URI's * embedded type first, then the file extension). Returns `"unknown"` when * nothing matches — callers treat that as "not previewable media" (e.g. text). */ declare function resolveMediaType({ mime, src }: ResolveMediaTypeInput): MediaKind; interface MediaViewerProps { /** Media source — an `http(s):`, `data:`, or `blob:` URL. */ src: string; /** * MIME type — preferred for picking the viewer. When omitted, the kind is * sniffed from `src` (extension or `data:` URI). Always pass `mime` with a * bare `blob:` URL, which carries no type of its own. */ mime?: string; /** Alt text / label, forwarded as image alt and audio/PDF title. */ alt?: string; /** Force a specific viewer, bypassing detection. */ kind?: MediaKind; /** Extra props for the underlying ``. */ imageProps?: Partial>; /** Extra props for the underlying ``. */ videoProps?: Partial>; /** Extra props for the underlying ``. */ audioProps?: Partial>; /** Extra props for the underlying ``. */ pdfProps?: Partial>; /** Rendered for unknown / unpreviewable types (default: a download card). */ fallback?: ReactNode; /** Fired when the chosen viewer reports a load error. */ onError?: () => void; /** Additional CSS classes, forwarded to the chosen viewer. */ className?: string; /** Inline styles, forwarded to the chosen viewer. */ style?: CSSProperties; } /** * Renders the right viewer for a media file, picked from its `mime` (preferred) * or `src` — image, video, audio, or PDF — and a download fallback for anything * else. SVG renders through ``. The single entry point for showing * a file from a tree/workspace when you don't know its type ahead of time. * * ```tsx * * ``` */ declare const MediaViewer: react.ForwardRefExoticComponent>; export { type MediaKind as M, type ResolveMediaTypeInput as R, MediaViewer as a, type MediaViewerProps as b, resolveMediaType as r };