import type { Channel } from "@opengeni/sdk"; import type { SessionClientLike } from "../client.js"; export type ChannelCacheSnapshot = Readonly<{ channels: readonly Channel[]; ready: boolean; }>; export type ChannelCacheStore = Readonly<{ getSnapshot: () => ChannelCacheSnapshot; subscribe: (listener: () => void) => () => void; beginLoad: () => number; acceptLoad: (ticket: number, channels: readonly Channel[]) => void; publishCreated: (channel: Channel) => void; }>; /** * One client/workspace cache shared by every useChannels consumer. * * List reads are ticketed so an older request cannot erase a newer result. * A successful create remains layered over the latest server snapshot until a * list request that started after that success reconciles it. Requests already * in flight cannot make the project disappear between create and session start. */ export declare function createChannelCacheStore(): ChannelCacheStore; export declare function channelCacheFor(client: SessionClientLike, workspaceId: string): ChannelCacheStore;