import type { ResourceNode } from "../core.js"; export type SourceFile = { path: string; content: string; }; /** * The lockfile the hosting build needs, checked at UPLOAD time rather than at * define time. * * It is a real requirement — Cargo Hosting builds a bundle with `npm ci`, which * cannot run without it — but it is a requirement of deploying, not of * declaring. Asserting it in `defineApp`/`defineWorker` meant a freshly * scaffolded project could not even be loaded, so `plan` reported an error * about a file the user had no way to have yet. Here, `plan` works on a fresh * scaffold and `deploy` still refuses to upload something that cannot build. */ export declare function assertBundleInstalled(root: string, label: string): void; /** * The same check across every bundle an apply is about to upload, so a run that * cannot finish does not start. * * Asserting inside each executor is not enough on its own: `apply` walks the * plan in dependency order and persists after each resource, so a worker that * fails at position 15 leaves the 14 resources before it created. The bundles * are knowable up front, so they are checked up front. */ export declare function assertBundlesInstalled(nodes: readonly ResourceNode[]): void; /** All uploadable source files under `root`, paths relative to `root`. */ export declare function readBundle(root: string): SourceFile[]; /** * Fail at define time (not after a multi-minute server build) when a worker/app * bundle is missing a file the hosting build requires. `label` names the kind in * the error message. When `anyOf` is provided, at least one of those files must * also exist — used for entrypoints that may live at more than one path (e.g. a * worker's `src/index.ts` TS source or a pre-built `index.js`). */ export declare function assertBundleFiles(root: string, label: string, required: string[], anyOf?: string[]): void; /** A content hash over the whole bundle — changes when any file changes. */ export declare function bundleHash(root: string): string; //# sourceMappingURL=bundle.d.ts.map