/** * The shared current-space store (API §12.2). ONE reactive resolver per Shell, so * useCurrentSpace / useApps / useSpaces.selected all observe the SAME selected * space: a `switch` in any window re-themes every consumer in this window at once, * with a manual optimistic override applied ahead of the round-trip (§1.6). This * closes the same-window cross-hook divergence; cross-WINDOW liveness still waits * on the memory-shape move (§12 flag). */ import type { Shell, SpaceNode } from '@astrale-os/shell'; export interface CurrentSpaceSnapshot { readonly space: SpaceNode | null; readonly pending: boolean; readonly error: unknown; } export declare const IDLE_SNAPSHOT: CurrentSpaceSnapshot; export declare const idleSnapshot: () => CurrentSpaceSnapshot; export declare const noopSubscribe: () => (() => void); export interface CurrentSpaceStore { subscribe(cb: () => void): () => void; getSnapshot(): CurrentSpaceSnapshot; /** Kick a first load if the confirmed value was never fetched. */ ensure(): void; /** Refetch the confirmed selected space; resolves when it lands. */ refresh(): Promise; /** Apply an optimistic override (a switch in flight) — every consumer re-renders. */ setOptimistic(space: SpaceNode | null): void; /** Drop the optimistic override, revealing confirmed truth again. */ clearOptimistic(): void; } /** The one current-space store for a Shell (created on first touch). */ export declare function currentSpaceStore(shell: Shell): CurrentSpaceStore; //# sourceMappingURL=current-space.store.d.ts.map