import type { ManagementApiClient } from "@prisma/management-api-sdk";
import { Result } from "better-result";
import type { BuildStrategy } from "./build-strategy.ts";
import type { DeployInteraction, DeployProgress, DestroyAppProgress, DestroyDeploymentInteraction, DestroyDeploymentProgress, PromoteProgress, UpdateEnvProgress } from "./callbacks.ts";
import { type ApiRequestError, type DeployError, type DestroyAppError, type DestroyDeploymentError, type PromoteError, type UpdateEnvError } from "./errors.ts";
import type { AppDetail, AppInfo, CreateProjectResult, DeploymentDetail, DeploymentInfo, PortMapping, ProjectInfo, ResolvedConfig } from "./types.ts";
export interface DeployOptions {
    strategy: BuildStrategy;
    projectId?: string;
    appId?: string;
    appName?: string;
    region?: string;
    envVars?: Record<string, string | null>;
    portMapping?: PortMapping;
    timeoutSeconds?: number;
    pollIntervalMs?: number;
    signal?: AbortSignal;
    interaction?: DeployInteraction;
    progress?: DeployProgress;
    skipPromote?: boolean;
    destroyOldDeployment?: boolean;
}
export interface UpdateEnvOptions {
    projectId?: string;
    appId?: string;
    envVars?: Record<string, string | null>;
    portMapping?: PortMapping;
    timeoutSeconds?: number;
    pollIntervalMs?: number;
    signal?: AbortSignal;
    interaction?: DeployInteraction;
    progress?: UpdateEnvProgress;
}
export interface DestroyDeploymentOptions {
    deploymentId?: string;
    appId?: string;
    projectId?: string;
    timeoutSeconds?: number;
    pollIntervalMs?: number;
    signal?: AbortSignal;
    interaction?: DestroyDeploymentInteraction;
    progress?: DestroyDeploymentProgress;
}
export interface DestroyAppOptions {
    appId: string;
    keepApp?: boolean;
    timeoutSeconds?: number;
    pollIntervalMs?: number;
    signal?: AbortSignal;
    progress?: DestroyAppProgress;
}
export interface ListAppsOptions {
    projectId: string;
    signal?: AbortSignal;
}
export interface CreateAppOptions {
    projectId: string;
    appName: string;
    region?: string;
    signal?: AbortSignal;
}
export interface ShowAppOptions {
    appId: string;
    signal?: AbortSignal;
}
export interface DeleteAppOptions {
    appId: string;
    signal?: AbortSignal;
}
export interface CreateProjectOptions {
    name: string;
    createDatabase?: boolean;
    region?: string;
    signal?: AbortSignal;
}
export interface ListProjectsOptions {
    signal?: AbortSignal;
}
export interface ListDeploymentsOptions {
    appId: string;
    signal?: AbortSignal;
}
export interface ShowDeploymentOptions {
    deploymentId: string;
    signal?: AbortSignal;
}
export interface StartDeploymentOptions {
    deploymentId: string;
    signal?: AbortSignal;
}
export interface StopDeploymentOptions {
    deploymentId: string;
    signal?: AbortSignal;
}
export interface DeleteDeploymentOptions {
    deploymentId: string;
    signal?: AbortSignal;
}
export interface PromoteOptions {
    appId: string;
    deploymentId?: string;
    timeoutSeconds?: number;
    pollIntervalMs?: number;
    signal?: AbortSignal;
    interaction?: DestroyDeploymentInteraction;
    progress?: PromoteProgress;
}
export interface DeployResult {
    projectId: string;
    appId: string;
    appName: string;
    region: string;
    deploymentId: string;
    deploymentEndpointDomain: string;
    appEndpointDomain: string | null;
    promoted: boolean;
    previousDeploymentId: string | null;
    previousDeploymentAction: "stopped" | "destroyed" | "still-active" | null;
    resolvedConfig: ResolvedConfig;
}
export interface PromoteResult {
    appId: string;
    deploymentId: string;
    appEndpointDomain: string;
    deploymentStarted: boolean;
}
export interface UpdateEnvResult {
    projectId: string;
    appId: string;
    deploymentId: string;
    deploymentUrl: string;
    resolvedConfig: ResolvedConfig;
}
export interface DestroyDeploymentResult {
    deploymentId: string;
    previousStatus: string;
    stopped: boolean;
    deleted: boolean;
}
export interface DestroyAppResult {
    appId: string;
    deletedDeploymentIds: string[];
    appDeleted: boolean;
}
export declare class ComputeClient {
    #private;
    constructor(managementApiClient: ManagementApiClient);
    deploy(options: DeployOptions): Promise<Result<DeployResult, DeployError>>;
    updateEnv(options: UpdateEnvOptions): Promise<Result<UpdateEnvResult, UpdateEnvError>>;
    destroyDeployment(options: DestroyDeploymentOptions): Promise<Result<DestroyDeploymentResult, DestroyDeploymentError>>;
    destroyApp(options: DestroyAppOptions): Promise<Result<DestroyAppResult, DestroyAppError>>;
    createProject(options: CreateProjectOptions): Promise<Result<CreateProjectResult, ApiRequestError>>;
    listProjects(options?: ListProjectsOptions): Promise<Result<ProjectInfo[], ApiRequestError>>;
    listApps(options: ListAppsOptions): Promise<Result<AppInfo[], ApiRequestError>>;
    createApp(options: CreateAppOptions): Promise<Result<AppInfo, ApiRequestError>>;
    showApp(options: ShowAppOptions): Promise<Result<AppDetail, ApiRequestError>>;
    deleteApp(options: DeleteAppOptions): Promise<Result<void, ApiRequestError>>;
    listDeployments(options: ListDeploymentsOptions): Promise<Result<DeploymentInfo[], ApiRequestError>>;
    showDeployment(options: ShowDeploymentOptions): Promise<Result<DeploymentDetail, ApiRequestError>>;
    startDeployment(options: StartDeploymentOptions): Promise<Result<void, ApiRequestError>>;
    stopDeployment(options: StopDeploymentOptions): Promise<Result<void, ApiRequestError>>;
    deleteDeployment(options: DeleteDeploymentOptions): Promise<Result<void, ApiRequestError>>;
    promote(options: PromoteOptions): Promise<Result<PromoteResult, PromoteError>>;
}
//# sourceMappingURL=compute-client.d.ts.map