import type { PortMapping } from "./types.ts"; /** * The result of executing a build strategy. */ export interface BuildArtifact { /** Absolute path to the directory containing the built files. */ directory: string; /** Entrypoint file path, relative to `directory`, using posix separators. */ entrypoint: string; /** * Default port mapping for the application. Used as the port mapping * when deploying to a newly created service and the user did not provide * an explicit --http-port. */ defaultPortMapping?: PortMapping; /** * Optional cleanup callback. Called by the core after the archive has been * created and the artifact directory is no longer needed. Strategies that * create temporary output directories (e.g., BunBuild) use this to clean up. */ cleanup?(): Promise; } /** * A build strategy produces a deployable artifact. */ export interface BuildStrategy { canBuild(signal?: AbortSignal): Promise; execute(signal?: AbortSignal): Promise; } /** * Reads directly from a pre-built application directory without copying. * Validates the entrypoint exists. */ export declare class PreBuilt implements BuildStrategy { #private; constructor(options: { appPath: string; entrypoint: string; }); canBuild(_signal?: AbortSignal): Promise; execute(signal?: AbortSignal): Promise; } /** * True if any of `filenames` exists at the root of `appPath`. Swallows * readdir errors (missing/unreadable dir) and returns false. */ export declare function hasRootFile(appPath: string, filenames: readonly string[], signal?: AbortSignal): Promise; /** * True if any of `packageNames` is listed in `package.json`'s `dependencies` * or `devDependencies`. Swallows missing-file / invalid-JSON errors and * returns false. */ export declare function hasPackageDependency(appPath: string, packageNames: readonly string[], signal?: AbortSignal): Promise; /** * Run a package's CLI inside `appPath`. Tries the project-local bin first, * then `npx `, then `bunx `. Each candidate that fails * with ENOENT is skipped; other failures (e.g., build errors) re-throw * with stderr surfaced. * * Throws with `missingMessage` if none of the launchers is available. */ export declare function runPackageCli(opts: { appPath: string; /** Executable name, e.g. "astro", "next", "nuxt", "vite". */ cliName: string; /** Args passed to the CLI, e.g. ["build"]. */ args: string[]; /** Prefix used when surfacing a build failure, e.g. "Astro". */ failurePrefix: string; /** Thrown when no launcher is available. */ missingMessage: string; /** Extra environment merged over `process.env` for the build child. */ env?: NodeJS.ProcessEnv; /** Per-line tap for build output (stdout/stderr). */ onOutput?: (line: string, source: "stdout" | "stderr") => void; signal?: AbortSignal; }): Promise; //# sourceMappingURL=build-strategy.d.ts.map