import { Patch } from "@valbuild/core/patch"; import { ValSourceFileHandler } from "./ValSourceFileHandler.js"; import { IValFSHost } from "./ValFSHost.js"; import { SerializedModuleContent } from "./SerializedModuleContent.js"; import { ModuleFilePath, ModulePath, extractValModules } from "@valbuild/core"; export declare function createService(projectRoot: string, host?: IValFSHost): Promise; type ExtractedModules = Awaited>; export declare class Service { readonly sourceFileHandler: ValSourceFileHandler; private readonly extracted; readonly projectRoot: string; constructor(projectRoot: string, sourceFileHandler: ValSourceFileHandler, extracted: ExtractedModules); /** * The module file paths that are registered in the project's val.modules. */ getModuleFilePaths(): ModuleFilePath[]; /** * Everything that is wrong with how the project's modules are DECLARED, as * opposed to what is in them. * * A module that failed to load is here, and so is a rule that spans the whole * set — "one settings module, at the root" cannot be checked while looking at * a single module, so `extractValModules` appends it with the offending path. * `get` only surfaces these when the module is missing entirely, which a * misplaced settings module is not: `val validate` reads them from here and * reports them against the file. */ getModuleErrors(): { message: string; path?: ModuleFilePath; }[]; private serializedSchemaOf; get(moduleFilePath: ModuleFilePath, modulePath: ModulePath, options?: { validate: boolean; }): Promise; /** * Applies a patch to a module's files. * * A `.jsonValues()` entry's content is not in the `.val.ts` — that file holds * only `c.json(() => import("./x.val.json"))` — so an op whose path descends * into an entry has to be replayed against the backing `*.val.json` instead. * That routing is the same one the Studio's commit flow does in * `ValOps.prepare`; both classify with {@link classifyJsonValuesOp} and rebase * with {@link rebaseContentOp}, so a CLI fix and a Studio publish write the * same file the same way. */ patch(moduleFilePath: ModuleFilePath, patch: Patch): Promise; /** Replays content ops against one `.jsonValues()` entry's `*.val.json`. */ private patchJsonValuesEntry; dispose(): void; } export {};