export type PageScopeSetupOptions = { commands?: () => Record void>; /** 非 subscribe 的清理(重置模块 flag、storeRef 等) */ onLeave?: () => void; }; export type PageScope = { readonly sessionId: string; setup(store: any, options?: PageScopeSetupOptions): void; subscribe(selector: (state: any) => T, listener: (value: T, prevValue: T) => void): void; }; /** 路由离开时在清 store 之前调用 */ export declare function runPageScopeCleanups(sessionId: string): void; export declare function createPageScope(sessionId: string): PageScope;