import { SessionSummary, WorkspaceSummary } from "../../types/hub.mjs"; //#region src/web/lib/cloudHub.d.ts /** The cloud lists what its org owns; the client asks again on this cadence. */ export declare const CLOUD_HUB_POLL_MS = 15000; /** What a Po Cloud org answers, keyed in the runtime namespace of the host record that reaches it. */ export interface CloudHubSnapshot { workspaces: WorkspaceSummary[]; sessions: SessionSummary[]; } /** The caller owns credentials: it adds the session cookie and org header, never this module. */ export type CloudHubFetch = (url: string, init?: { method?: string; headers?: Record; body?: string; signal?: AbortSignal; }) => Promise; export interface CloudHubOptions { /** The canonical host UUID the views are qualified with. */ hostId: string; /** HTTPS origin of the Po Cloud worker. */ origin: string; fetch: CloudHubFetch; } /** * Lists a Po Cloud org's workspaces and sessions over plain HTTP. DOM-free: phones and the desktop * inject their own fetch, which carries the identity cookie and `x-po-org`. */ export declare function createCloudHub(options: CloudHubOptions): { list: (signal?: AbortSignal) => Promise; /** Starts a cloud session in one of this org's workspaces and returns its qualified id. */ createSession(workspaceId: string, name?: string): Promise; /** Deletes one cloud session; both ids may be qualified. */ deleteSession(workspaceId: string, sessionId: string): Promise; /** * Lists now, then again every interval until stopped. A failed round reports and keeps polling. * `subscribe` hands out a refresh that lists at once, for a host that says when its list changed. */ poll(handlers: { onSnapshot(snapshot: CloudHubSnapshot): void; onError?(error: Error): void; intervalMs?: number; subscribe?(refresh: () => void): () => void; }): () => void; }; export type CloudHub = ReturnType; //#endregion //# sourceMappingURL=cloudHub.d.mts.map