import type { FileNode } from '../../types'; import { type FileProcessResult } from '../FileTypeProcessor'; import type { ContentState } from './types'; export interface UsePreviewContentResult { /** 文件类型 + 数据源处理结果,未就绪时为 null */ processResult: FileProcessResult | null; /** 文本/代码内容加载状态机 */ contentState: ContentState; } /** * 预览内容加载 hook * * 串联以下副作用,集中管理生命周期: * 1. `file` 变化时跑 `fileTypeProcessor.processFile` 得到类型 + 数据源 * 2. 仅文本/代码类需要拉取原文,按 dataSource 优先 content -> previewUrl 加载 * 3. 卸载或文件变化时回收 Blob URL(`cleanupResult`) * * 当 `customContent` 存在时短路所有逻辑,由调用方直接渲染外部内容。 */ export declare const usePreviewContent: (file: FileNode, customContent: React.ReactNode | undefined, locale?: Record) => UsePreviewContentResult;