import { type ResourceNode } from "../core.js"; /** * A resource file that failed to import — its path relative to the repo root * and the reason (a `define*` slug error, a `script()` body-lowering error, a * transpile/parse error, …). Collected by `loadResourcesCollecting` so a check * can report every offending file at once. */ export type LoadError = { file: string; message: string; }; /** * Reset the registry, import every resource module under `root` (which registers * each define*'d resource), and return the registered nodes. * * Fail-fast: re-throws on the FIRST file that fails. Use this where a single * clear error is enough and the caller just needs the whole tree or nothing — * `import` and `pull`'s state adoption. The offline validation path (`check` / * `plan` / `deploy`) instead uses `loadResourcesCollecting`, which reports every * offending file in one pass rather than one-per-re-run. */ export declare function loadResources(root: string): Promise; /** * Like `loadResources`, but non-throwing: import every resource file, collect * each file's failure instead of stopping at the first, and return whatever * registered alongside all the errors. Powers the offline validation path * shared by `cdk check`, `plan`, and `deploy` (which fold these errors into the * compile result via `withLoadErrors`), so every body / slug / import violation * surfaces in one pass rather than one file per re-run. * * Also returns `files` — each resource id mapped to the repo-relative path of * the file that declared it, which `cdk info` prints. The attribution itself is * `core.ts`'s (it reads the call stack); all this adds is turning the absolute * paths into repo-relative ones and mapping a workflow file's temp twin back to * the source the user wrote. * * Note: a file that throws mid-module still aborts ITS OWN later `define*` * calls — that's inherent to JS module evaluation, so we surface the first * error per file, across all files. */ export declare function loadResourcesCollecting(root: string): Promise<{ nodes: ResourceNode[]; errors: LoadError[]; files: Record; }>; //# sourceMappingURL=load.d.ts.map