import type { PreviewFamily } from '../services/parsing/formatDefinitions'; import { type PreviewKind } from '../services/parsing/formatDefinitions'; import type { ParsedOfficeFile } from '../services/preview'; import type { OfficeCapabilities, OfficeDocumentModel, OfficeDocumentRuntime, OfficeDocumentSnapshot, OfficeDocumentSource, OfficeFormatId, OfficeJsonValue, OfficeResourceRef, OfficeSourceMap, OfficeWarning } from './types'; /** 由解析会话提供的物化模型适配输入。 */ export type OfficeDocumentSnapshotInput = Readonly<{ /** 当前解析会话标识。 */ sessionId: string; /** 原始文件对象。 */ file: File; /** 现有格式解析器产出的完整模型。 */ parsed: ParsedOfficeFile; }>; /** 构造 Source 模式快照所需的可序列化描述。 */ export type OfficeSourceSnapshotInput = Readonly<{ /** 当前解析会话标识。 */ sessionId: string; /** 原始文件名。 */ fileName?: string; /** 原始文件大小。 */ fileSize?: number; /** 当前 Source 对应的预览格式。 */ format: OfficeFormatId; /** Source 所属的预览界面族。 */ family: PreviewFamily; /** Source 当前实际可用的能力。 */ capabilities: OfficeCapabilities; /** Source 使用的资源引用。 */ resources?: readonly OfficeResourceRef[]; /** Source 解析阶段产生的可恢复警告。 */ warnings?: readonly OfficeWarning[]; /** 语义节点到源文件位置的映射。 */ sourceMap?: OfficeSourceMap; /** 格式插件提供的可序列化扩展数据。 */ extensionData?: Readonly>; }>; /** 依据格式和当前渲染能力生成统一能力描述。 */ export declare function getOfficeCapabilities(format: PreviewKind, available?: Partial): OfficeCapabilities; /** 从模型或 Source 摘要提取不含运行时对象的资源引用。 */ export declare function collectOfficeResourceRefs(value: unknown): readonly OfficeResourceRef[]; /** 将各格式的警告对象收敛为可序列化的 Core 警告。 */ export declare function normalizeOfficeWarnings(warnings: unknown): readonly OfficeWarning[]; /** 从现有物化解析结果生成可跨 Worker 传输的语义快照。 */ export declare function createOfficeDocumentSnapshot(input: OfficeDocumentSnapshotInput): OfficeDocumentSnapshot; /** 将物化模型和语义快照绑定为会话运行时对象。 */ export declare function createOfficeDocumentRuntime(input: OfficeDocumentSnapshotInput): OfficeDocumentRuntime; /** 从 Source 描述生成不携带运行时对象的语义快照。 */ export declare function createOfficeSourceSnapshot(input: OfficeSourceSnapshotInput): OfficeDocumentSnapshot; /** 将公开快照与外部 Source 绑定为运行时对象。 */ export declare function createOfficeSourceRuntime(snapshot: OfficeDocumentSnapshot, source: TSource): OfficeDocumentRuntime; /** 从运行时对象读取物化模型;Source 模式返回 undefined。 */ export declare function getOfficeDocumentModel(runtime: OfficeDocumentRuntime): TModel | undefined;