import { type TrustedModules } from "./trustedModules.js"; declare const validatedClosureBrand: unique symbol; export type ValidatedClosure = { readonly [validatedClosureBrand]: true; }; type ValidatedModule = { source: string; /** POSIX path relative to root; where the mirror writes the file. */ relPath: string; /** True for a trusted module and every `.agency` file reachable from * one: mirrored for the typechecker, never compiled. */ trusted: boolean; /** Each import specifier this module writes that resolved to a trusted * module, mapped to that module's absolute compiled path. The compiler * rewrites those imports to these paths. */ trustedImports: Record; }; type ValidatedClosureData = { /** realpath of dir, or null when dir was "": no local root, so any local * import anywhere in the closure is a validation error. "" is never * resolved to the current working directory. */ root: string | null; /** Module id → validated content. File ids are absolute paths; a string * entry uses a private generated id. */ modules: Record; entryModuleId: string; }; export declare class ClosureValidationError extends Error { readonly violations: string[]; constructor(violations: string[]); } export type SourceClosureEntry = { source: string; }; export type FileClosureEntry = { file: string; }; export type ClosureEntry = SourceClosureEntry | FileClosureEntry; export type ValidateClosureArgs = { entry: ClosureEntry; dir: string; /** Resolved trusted modules (real paths). Absent or empty: every import * is checked, as before trusted modules existed. */ trustedModules?: TrustedModules[]; }; /** Compiler-internal accessor for validated source preparation and compilation. * Not a package export. */ export declare function openValidatedClosure(closure: ValidatedClosure): ValidatedClosureData; /** Add a compiler-generated adapter without reopening any validated source. * Its local imports must name files already in the snapshot. */ export declare function withGeneratedEntry(closure: ValidatedClosure, source: string): ValidatedClosure; /** Test-only projection: names only, never source or mirror layout. */ export declare function snapshotValidatedClosureForTest(closure: ValidatedClosure): { root: string | null; moduleRelativePaths: string[]; trustedRelativePaths: string[]; trustedImports: Record>; }; export declare function validateClosure(args: ValidateClosureArgs): ValidatedClosure; export {};