/** 外部状态发生变化时触发的监听函数。 */ type StoreChangeListener = () => void; /** 组件内部订阅所需的最小外部状态协议。 */ type ExternalStore = { /** 返回当前不可变快照;数据未变化时必须保持对象引用稳定。 */ getSnapshot(): TSnapshot; /** 监听快照变化,并返回取消订阅函数。 */ subscribe(listener: StoreChangeListener): () => void; }; /** 订阅可选数据源,并为所有 Office 格式统一稳定函数引用和版本兼容逻辑。 */ export declare function useExternalStoreSnapshot(source: ExternalStore): TSnapshot; export declare function useExternalStoreSnapshot(source: ExternalStore | undefined, fallbackSnapshot: TSnapshot): TSnapshot; export declare function useExternalStoreSnapshot(source: ExternalStore | undefined): TSnapshot | undefined; /** 只订阅外部快照中实际使用的派生值,兼容 React 16.9 至 React 18。 */ export declare function useExternalStoreSelector(source: ExternalStore | undefined, selector: (snapshot: TSnapshot) => TSelection, fallbackSelection: TSelection, isEqual?: (current: TSelection, next: TSelection) => boolean): TSelection; export {};