import React, { type FC } from 'react'; import { type MarkdownEditorProps } from '../../MarkdownEditor'; import type { FileNode } from '../types'; /** * PreviewComponent 组件属性 */ export interface PreviewComponentProps { /** 文件数据 */ file: FileNode; /** 自定义预览内容 */ customContent?: React.ReactNode; /** 自定义头部 */ customHeader?: React.ReactNode; /** 自定义操作按钮 */ customActions?: React.ReactNode; /** 返回回调 */ onBack?: () => void; /** 下载回调 */ onDownload?: (file: FileNode) => void; /** 分享回调 */ onShare?: (file: FileNode, options?: { anchorEl?: HTMLElement; origin?: string; }) => void; /** 定位回调 */ onLocate?: (file: FileNode) => void; /** Markdown 编辑器配置 */ markdownEditorProps?: Partial>; /** 头部文件信息覆盖 */ headerFileOverride?: Partial; } /** * 文件预览组件 * * 渲染管线: * 1. `customContent` 优先 → 自定义节点 * 2. 文件 `loading` → 流式占位 * 3. `usePreviewContent` 未就绪 → Spin 占位 * 4. 内容加载错误 → Alert 占位 * 5. `canPreview === false` → `UnsupportedFileCard` * 6. 文本/代码 → `MarkdownEditor`(HTML 子类型走 `HtmlPreview`,支持 preview/code 切换) * 7. 图片/视频/音频/PDF → `MediaPreview` * 8. 其它 → 通用占位(含可选下载) */ export declare const PreviewComponent: FC;