/**
 * Deployment Status Store
 *
 * External store (useSyncExternalStore-compatible) that holds the shared
 * deployment state keyed by targetId. Multiple components subscribed to
 * the same targetId see the same state — fixes the node/drawer-out-of-sync
 * bug and makes page-refresh hydration trivial.
 *
 * Mutation paths (deploy/stop/poll) go through server actions that wrap
 * use cases — this module stores state only and never contains business
 * logic.
 */
import type { DeploymentState } from '../../../../packages/core/src/domain/generated/output.js';
import type { DeploymentStatus, DeploymentStatusEntry } from '../../../../packages/core/src/application/ports/output/services/deployment-service.interface.js';
export interface DeploymentEntryState {
    status: DeploymentState | null;
    url: string | null;
    targetType: string | null;
    /** Whether mount-hydration (listDeployments / getDeploymentStatus) has completed for this targetId. */
    hydrated: boolean;
    deployLoading: boolean;
    stopLoading: boolean;
    deployError: string | null;
}
export declare const EMPTY_ENTRY: DeploymentEntryState;
type Listener = () => void;
export declare class DeploymentStatusStore {
    private entries;
    private listeners;
    private globalListeners;
    /**
     * Set true after the first SSR seed runs. Because `ListDeploymentsUseCase`
     * returns the full universe of currently-tracked deployments, any
     * targetId NOT present in that list is definitively idle — there is no
     * need to fire a per-node `getDeploymentStatus` server action on mount.
     * Without this flag, every canvas node (most of which have no
     * deployment) was triggering one POST /control-center on initial render,
     * producing the burst of 30+ server-action calls observed on dashboard
     * load.
     */
    private fullyHydrated;
    /** Has the store been seeded at least once from SSR? */
    isFullyHydrated(): boolean;
    /** Seed the store from SSR data (ListDeploymentsUseCase output). */
    hydrate(entries: DeploymentStatusEntry[]): void;
    getEntry(targetId: string): DeploymentEntryState;
    update(targetId: string, patch: Partial<DeploymentEntryState>): void;
    /** Apply a status snapshot (from a server action result) to a targetId. */
    setStatus(targetId: string, status: DeploymentStatus | null): void;
    subscribe(targetId: string, listener: Listener): () => void;
    subscribeAll(listener: Listener): () => void;
    private notify;
}
export {};
//# sourceMappingURL=deployment-status-store.d.ts.map