import type { MutableRefObject, ReactNode } from 'react'; import React from 'react'; import type { OfficeDocumentRuntime } from '../core/types'; import type { WordPageNavigationController } from '../formats/word-pages/types'; import type { OfficeViewerPluginAdapter } from '../plugins/viewerTypes'; import type { WordRevisionMode } from '../services/annotations/types'; import type { OfficeFileViewerPreviewState } from '../services/parsing/internalTypes'; import type { OfficeFileViewerPresentationMediaOptions } from '../services/presentation/mediaTypes'; import type { OfficeFileViewerPresentationTransitions, PresentationNavigationIntent } from '../services/presentation/transitionTypes'; import type { SpreadsheetViewMode } from '../services/spreadsheet/viewMode'; /** 演示文稿 Viewer 可以消费的物化或按需预览。 */ type PresentationPreview = Extract; /** 电子表格 Viewer 可以消费的物化或按需预览。 */ type SpreadsheetPreview = Extract; /** DOCX Viewer 可以消费的物化或按需预览。 */ type DocxPreview = Extract; /** DOC/WPS Viewer 可以消费的物化或按需预览。 */ type DocPreview = Extract; /** 预览舞台所有互斥的可渲染分支。 */ export type OfficePreviewStageState = { kind: 'empty'; } | { kind: 'loading'; /** 当前解析阶段对应的提示。 */ tip?: string; } | { kind: 'error'; /** 阻止继续预览的错误说明。 */ message: string; /** 最近文件来源仍可用时触发重新加载。 */ retry?: () => void; } | { kind: 'plugin'; /** 外部插件标识。 */ pluginId: string; /** 外部插件交付的运行时内容。 */ runtime: OfficeDocumentRuntime; /** 当前文件名称。 */ fileName: string; /** 与插件 ID 对应的 React Renderer。 */ adapter?: OfficeViewerPluginAdapter; } | { kind: 'presentation'; /** 当前演示文稿预览。 */ preview: PresentationPreview; /** 当前选中的幻灯片索引。 */ activeIndex: number; /** 当前预览缩放比例。 */ zoom: number; /** 演讲者备注面板是否展开。 */ showSpeakerNotes: boolean; /** 演示文稿媒体读取配置。 */ mediaOptions?: false | OfficeFileViewerPresentationMediaOptions; /** 是否按源文件播放页级切换。 */ transitions: OfficeFileViewerPresentationTransitions; /** 最近一次工具栏翻页产生的切换意图。 */ transitionIntent?: PresentationNavigationIntent; } | { kind: 'spreadsheet'; /** 当前电子表格预览。 */ preview: SpreadsheetPreview; /** 当前选中的工作表标识。 */ activeSheetId?: string; /** 当前预览缩放比例。 */ zoom: number; /** 当前电子表格采用的显示模式。 */ viewMode: SpreadsheetViewMode; } | { kind: 'docx'; /** 当前 DOCX 预览。 */ preview: DocxPreview; /** 当前预览缩放比例。 */ zoom: number; /** 文档大纲是否展开。 */ showOutline: boolean; /** 当前采用的 Word 修订内容投影模式。 */ wordRevisionMode: WordRevisionMode; } | { kind: 'doc'; /** 当前 DOC/WPS 预览。 */ preview: DocPreview; /** 当前预览缩放比例。 */ zoom: number; /** 文档大纲是否展开。 */ showOutline: boolean; /** 当前采用的 Word 修订内容投影模式。 */ wordRevisionMode: WordRevisionMode; }; /** 预览舞台属性。 */ type OfficePreviewStageProps = { /** 当前互斥舞台状态。 */ state: OfficePreviewStageState; /** 关闭文字文档大纲。 */ onCloseWordOutline: () => void; /** 搜索启用时打开文字文档查找侧栏。 */ onOpenSearch?: () => void; /** 选择指定幻灯片。 */ onSelectSlide: (index: number) => void; /** 选择指定工作表。 */ onSelectSheet: (sheetId: string) => void; slots?: { loading?: ReactNode; empty?: ReactNode; error?: ReactNode; }; pageNavigationControllerRef?: MutableRefObject; /** 插件 Renderer 自身失败时交回宿主的诊断回调。 */ onPluginError?: (error: unknown) => void; }; /** 根据显式分支选择具体预览器,并保留各格式的懒加载边界。 */ declare function OfficePreviewStageComponent({ state, onCloseWordOutline, onOpenSearch, onSelectSlide, onSelectSheet, slots, pageNavigationControllerRef, onPluginError, }: OfficePreviewStageProps): string | number | boolean | React.JSX.Element | Iterable; export declare const OfficePreviewStage: React.MemoExoticComponent; export {};