import dayjs from "dayjs";
import PQueue from "p-queue";
import { type IBuild, type IUser } from "../../entities";
import type { BuildPlatform, BuildStatus, DeployStatus } from "../../interfaces/SystemTypes";
export declare let queue: PQueue<import("p-queue/dist/priority-queue").default, import("p-queue").DefaultAddOptions>;
export type StartBuildParams = {
    /**
     * App's slug
     */
    appSlug: string;
    /**
     * Select a git branch to pull source code & build
     */
    gitBranch: string;
    /**
     * Build tag is also an container image's tag
     */
    buildTag?: string;
    /**
     * An incremental number of build
     */
    buildNumber?: number;
    /**
     * ID of the author
     * - `If passing "userId", no need to pass "user" and vice versa.`
     */
    userId?: string;
    /**
     * {User} instance of the author
     * - `If passing "user", no need to pass "userId" and vice versa.`
     */
    user?: IUser;
    /**
     * Slug of the Container Registry
     */
    registrySlug: string;
    /**
     * Select the deploy environment to build image, in this case, this info is using for selecting "Dockerfile"
     * of specific deploy environment only, for example: "Dockerfile.dev" or "Dockerfile.prod",
     * if you don't specify "env", a default "Dockerfile" will be selected.
     * - **[OPTIONAL] SHOULD NOT rely on this!**
     * - A build should be able to used for any deploy environments.
     */
    env?: string;
    /**
     * Path to the source code directory
     * * [OPTIONAL] Only apply for CLI command, has no effects on API call
     */
    buildDir?: string;
    /**
     * Enable async to watch the build process
     * @default true
     */
    buildWatch?: boolean;
    /**
     * Targeted platform arch: linux/arm64, linux/amd64,...
     */
    platforms?: BuildPlatform[];
    /**
     * Build arguments
     */
    args?: {
        name: string;
        value: string;
    }[];
    /**
     * CLI version of client user
     */
    cliVersion?: string;
    /**
     * Current DXUP server version
     */
    serverVersion?: string;
    /**
     * Current DXUP server location
     */
    serverLocation?: string;
    /**
     * Enable debug mode
     *
     * @default false
     */
    isDebugging?: boolean;
    /**
     * If `TRUE`, skip trigger webhook notification & process deploy this build
     *
     * @default false
     */
    shouldDeploy?: boolean;
    /**
     * Revision message
     */
    message?: string;
};
export type RerunBuildParams = Pick<StartBuildParams, "platforms" | "args" | "registrySlug" | "buildTag" | "buildWatch">;
export type StartBuildResult = {
    SOCKET_ROOM: string;
    build: IBuild;
    imageURL: string;
    buildImage: string;
    startTime: dayjs.Dayjs;
    builder: string;
};
export declare function testBuild(): Promise<void>;
/**
 * Save build log content to database
 */
export declare function saveLogs(buildSlug: string, logs: string): Promise<IBuild>;
/**
 * Stop the build process.
 */
export declare const stopBuild: (projectSlug: string, appSlug: string, buildSlug: string, status?: BuildStatus, deployStatus?: DeployStatus) => Promise<IBuild | {
    error: any;
}>;
export declare function startBuild(params: StartBuildParams, options?: {
    onSucceed?: (build: IBuild) => void;
    onError?: (msg: string) => void;
}): Promise<StartBuildResult>;
//# sourceMappingURL=build.d.ts.map