/// <reference types="node" />
import { AgentPlatform, RunConfigs } from '../generated/schema';
export declare class APIError extends Error {
    readonly originalError: any;
    constructor(error: any);
}
export declare class APIClient {
    readonly uri: URL;
    private token;
    private readonly client;
    constructor(uri: URL);
    register(agent: {
        token: string;
        name: string;
        platform: AgentPlatform;
    }): Promise<{
        __typename?: "AgentRegistration" | undefined;
        token: string;
        agent: {
            __typename?: "Agent" | undefined;
            id: string;
            name: string;
            tags: string[];
            org: {
                __typename?: "Org" | undefined;
                slug: string;
            };
        };
    }>;
    acquireBuild(): Promise<{
        __typename?: "Build" | undefined;
        id: string;
        sha: string;
        branch: string;
        number: number;
        path: string;
        user: {
            __typename?: "BuildUser" | undefined;
            id: string;
            displayName: string;
        };
        repo: {
            __typename?: "Repo" | undefined;
            id: string;
            slug: string;
            defaultBranch: string;
            providerType: import("../generated/schema").RepoProviderType;
            providerSource: string;
            org: {
                __typename?: "Org" | undefined;
                id: string;
                slug: string;
            };
        };
        dependencyOf?: {
            __typename?: "Build" | undefined;
            id: string;
            sha: string;
            branch: string;
            repo: {
                __typename?: "Repo" | undefined;
                id: string;
                defaultBranch: string;
                providerType: import("../generated/schema").RepoProviderType;
                providerSource: string;
            };
        } | null | undefined;
    } | null>;
    acquireJob(): Promise<{
        __typename?: "BuildJob" | undefined;
        id: string;
        number: number;
        path: string;
        repo: {
            __typename?: "Repo" | undefined;
            id: string;
            slug: string;
            providerType: import("../generated/schema").RepoProviderType;
            providerSource: string;
        };
        build: {
            __typename?: "Build" | undefined;
            id: string;
            sha: string;
            branch: string;
        };
        docker?: {
            __typename?: "DockerOptions" | undefined;
            image?: string | null | undefined;
            file?: string | null | undefined;
            context?: string | null | undefined;
        } | null | undefined;
        steps: {
            __typename?: "BuildStep" | undefined;
            id: string;
            step: number;
            command: string[];
            path: string;
            name: string;
            dependencies: {
                __typename?: "BuildStep" | undefined;
                id: string;
            }[];
            env: {
                __typename?: "BuildStepEnv" | undefined;
                name: string;
                value: string;
                secret: boolean;
            }[];
        }[];
    } | null>;
    configureBuild(build: string, sha: string, dependencies: string[], config: RunConfigs): Promise<void>;
    configureBuildError(build: string, error: string, { notFound, sha, }: {
        notFound?: boolean;
        sha?: string | null;
    }): Promise<void>;
    start(stepId: string, date: Date): Promise<void>;
    progress(stepId: string, buffer: Buffer): Promise<void>;
    complete(stepId: string, date: Date, success: boolean): Promise<void>;
    upload({ stepId, cwd, path, }: {
        stepId: string;
        cwd: string;
        path: string;
    }): Promise<void>;
    private retry;
    private headers;
}
//# sourceMappingURL=api-client.d.ts.map