import type { ComposeApplicationRecord, ComposeParseResult, ComposeServiceState, ComposeTemplate } from '../compose';
import type { ApplicationArtifactRecord, ApplicationDraftRecord, RegistryConnection } from '../onboarding';
import type { CreatePreviewDefinitionInput, PreviewDefinition, PreviewInstance } from '../preview';
import type { QueueConcurrencyLimits } from '../queue';
import type { ReleaseArtifact, ReleaseDeployableKind, ReleaseRecord, ReleaseStrategy, ReleaseStrategyCapability, ReleaseTransition } from '../release';
import type { ApiApplicationCreateRequest, ApiApplicationCreateResponse, ApiApplicationDetectionRequest, ApiApplicationDetectionResponse, ApiApplicationDraftCreateRequest, ApiApplicationDraftUpdateRequest, ApiApplicationPlanRequest, ApiApplicationPlanResponse, ApiDeploymentRequest, ApiOperationLogsResponse, ApiOperationResponse, ApiPage, ApiQueueOperation, ApiQueueSettingsResponse, ApiRegistryConnectionCreateRequest, ApiRegistryConnectionUpdateRequest } from './types';
export interface TsCloudClientOptions {
    baseUrl: string;
    token: string;
    fetch?: typeof globalThis.fetch;
}
export declare class TsCloudApiError extends Error {
    readonly status: number;
    readonly code: string;
    readonly requestId?: string | undefined;
    constructor(status: number, code: string, message: string, requestId?: string | undefined);
}
export declare class TsCloudClient {
    private readonly options;
    private readonly baseUrl;
    private readonly fetchFn;
    constructor(options: TsCloudClientOptions);
    private request;
    listProjects(options?: {
        limit?: number;
        cursor?: string;
    }): Promise<ApiPage<Record<string, unknown>>>;
    listEnvironments(projectId: string, options?: {
        limit?: number;
        cursor?: string;
    }): Promise<ApiPage<Record<string, unknown>>>;
    listServices(projectId: string, environmentId?: string): Promise<ApiPage<Record<string, unknown>>>;
    listOperations(projectId?: string): Promise<ApiPage<Record<string, unknown>>>;
    listComposeTemplates(): Promise<ApiPage<ComposeTemplate>>;
    listComposeApplications(projectId: string, environmentId?: string): Promise<ApiPage<ComposeApplicationRecord & {
        services: ComposeServiceState[];
    }>>;
    previewCompose(input: {
        source: string;
        name: string;
        slug?: string;
        projectId: string;
        environmentId: string;
    }): Promise<{
        result: ComposeParseResult;
        requestId: string;
    }>;
    createComposeApplication(input: {
        source?: string;
        templateId?: string;
        templateVersion?: string;
        inputs?: Record<string, string>;
        name: string;
        slug?: string;
        projectId: string;
        environmentId: string;
    }): Promise<{
        application: ComposeApplicationRecord;
        diagnostics: ComposeParseResult['diagnostics'];
        requestId: string;
    }>;
    composeServices(applicationId: string): Promise<{
        application: ComposeApplicationRecord;
        services: ComposeServiceState[];
        requestId: string;
    }>;
    composeAction(applicationId: string, action: 'deploy' | 'redeploy' | 'start' | 'stop' | 'scale' | 'delete', input?: {
        service?: string;
        replicas?: number;
        removeVolumes?: boolean;
        confirm?: string;
    }): Promise<ApiOperationResponse>;
    releaseCapabilities(kind: ReleaseDeployableKind, input?: {
        health?: boolean;
        replicas?: number;
    }): Promise<{
        capabilities: ReleaseStrategyCapability[];
        requestId: string;
    }>;
    listReleases(projectId: string, input?: {
        environmentId?: string;
        resourceId?: string;
    }): Promise<ApiPage<ReleaseRecord & {
        artifact: ReleaseArtifact;
        transitions: ReleaseTransition[];
    }>>;
    createReleaseArtifact(input: {
        digest: string;
        kind: ReleaseDeployableKind;
        uri: string;
        size: number;
        mediaType?: string;
        provenance?: unknown;
        attestation?: unknown;
    }): Promise<{
        artifact: ReleaseArtifact;
        requestId: string;
    }>;
    createRelease(input: {
        projectId: string;
        environmentId: string;
        resourceId: string;
        artifactId: string;
        kind: ReleaseDeployableKind;
        sourceSha?: string;
        config?: unknown;
        manifest?: unknown;
        strategy: ReleaseStrategy;
        healthGate?: unknown;
        approvalRequired?: boolean;
    }): Promise<{
        release: ReleaseRecord;
        requestId: string;
    }>;
    releaseAction(releaseId: string, action: 'promote' | 'approve' | 'activate' | 'rollback' | 'health' | 'pin', input?: Record<string, unknown>): Promise<Record<string, unknown>>;
    createDeployment(input: ApiDeploymentRequest, idempotencyKey: string): Promise<ApiOperationResponse>;
    detectApplication(input: ApiApplicationDetectionRequest): Promise<ApiApplicationDetectionResponse>;
    planApplication(input: ApiApplicationPlanRequest): Promise<ApiApplicationPlanResponse>;
    listApplicationDrafts(projectId: string): Promise<ApiPage<ApplicationDraftRecord>>;
    createApplicationDraft(input: ApiApplicationDraftCreateRequest): Promise<{
        draft: ApplicationDraftRecord;
        requestId: string;
    }>;
    updateApplicationDraft(input: ApiApplicationDraftUpdateRequest): Promise<{
        draft: ApplicationDraftRecord;
        requestId: string;
    }>;
    createApplication(input: ApiApplicationCreateRequest, idempotencyKey: string): Promise<ApiApplicationCreateResponse>;
    uploadApplicationArtifact(projectId: string, filename: string, body: Blob | ArrayBuffer): Promise<{
        artifact: ApplicationArtifactRecord;
        requestId: string;
    }>;
    listRegistryConnections(): Promise<ApiPage<RegistryConnection>>;
    createRegistryConnection(input: ApiRegistryConnectionCreateRequest): Promise<{
        registry: RegistryConnection;
        requestId: string;
    }>;
    updateRegistryConnection(input: ApiRegistryConnectionUpdateRequest): Promise<{
        registry: RegistryConnection;
        requestId: string;
    }>;
    disconnectRegistryConnection(id: string): Promise<{
        registry: RegistryConnection;
        requestId: string;
    }>;
    listQueue(input?: {
        projectId?: string;
        state?: string;
        limit?: number;
        cursor?: string;
    }): Promise<ApiPage<ApiQueueOperation>>;
    operationLogs(operationId: string, input?: {
        after?: number;
        limit?: number;
    }): Promise<ApiOperationLogsResponse>;
    streamOperationLogs(operationId: string, after?: number): Promise<Response>;
    cancelOperation(operationId: string): Promise<{
        operation: ApiOperationResponse['operation'];
        requestId: string;
    }>;
    retryOperation(operationId: string, errorClass: string, delayMs?: number): Promise<{
        operation: ApiOperationResponse['operation'];
        requestId: string;
    }>;
    queueSettings(): Promise<ApiQueueSettingsResponse>;
    updateQueueSettings(concurrency: Partial<QueueConcurrencyLimits>): Promise<ApiQueueSettingsResponse>;
    listPreviews(projectId?: string): Promise<ApiPage<PreviewInstance>>;
    listPreviewDefinitions(projectId: string): Promise<ApiPage<PreviewDefinition>>;
    createPreviewDefinition(input: CreatePreviewDefinitionInput): Promise<{
        definition: PreviewDefinition;
        requestId: string;
    }>;
    createPreview(input: {
        definitionId: string;
        repository?: string;
        branch: string;
        pullRequestNumber?: number;
        fork?: boolean;
        commitSha: string;
    }): Promise<{
        preview: PreviewInstance;
        operation: ApiOperationResponse['operation'];
        requestId: string;
    }>;
    destroyPreview(previewId: string, confirm: string): Promise<{
        operation: ApiOperationResponse['operation'];
        requestId: string;
    }>;
    extendPreview(previewId: string, hours: number): Promise<{
        preview: PreviewInstance;
        requestId: string;
    }>;
    rebuildPreview(previewId: string): Promise<{
        operation: ApiOperationResponse['operation'];
        requestId: string;
    }>;
}
