import type { CloudConfig, EnvironmentType } from '@ts-cloud/core';
import type { ControlPlaneActor, ControlPlaneEnvironment, ControlPlaneOperation, ControlPlaneOrganization, ControlPlaneProject, JsonValue } from '../control-plane';
import type { DashboardUser } from './dashboard-auth';
import { ControlPlaneStore } from '../control-plane';
export interface DashboardControlPlane {
    store: ControlPlaneStore;
    organization: ControlPlaneOrganization;
    project: ControlPlaneProject;
    environments: Map<string, ControlPlaneEnvironment>;
    reconciliation: {
        requeued: number;
        failed: number;
    };
}
export interface TrackDashboardOperationInput<T extends {
    ok: boolean;
}> {
    controlPlane: DashboardControlPlane;
    environment: EnvironmentType;
    actor: DashboardUser;
    kind: string;
    resourceSlug?: string;
    input?: JsonValue;
    execute: () => Promise<T>;
}
export interface TrackedDashboardOperationResult<T extends {
    ok: boolean;
}> {
    result: T;
    operation: ControlPlaneOperation;
}
export declare function ensureDashboardActor(store: ControlPlaneStore, user: DashboardUser): ControlPlaneActor;
export declare function initializeDashboardControlPlane(cwd: string, config: CloudConfig): DashboardControlPlane;
export declare function synchronizeDashboardUsers(controlPlane: DashboardControlPlane, users: readonly DashboardUser[]): void;
export declare function trackDashboardOperation<T extends {
    ok: boolean;
}>(input: TrackDashboardOperationInput<T>): Promise<TrackedDashboardOperationResult<T>>;
