//#region ../@warlock.js/fs/src/facade/standard-schema.d.ts /** * Minimal, vendor-neutral [Standard Schema](https://standardschema.dev) v1 * interface, declared locally so `@warlock.js/fs` takes **zero dependencies** * (not even a type-only one) to support schema-validated JSON reads. * * Any Standard-Schema-compliant validator satisfies this — `@warlock.js/seal` * (every seal validator is `& StandardSchemaV1`), zod, valibot, etc. — so * `fs.files.getJson(path, { schema })` is validator-agnostic and validates by * calling the schema's own `~standard.validate`, with no runtime import. */ interface StandardSchemaV1 { readonly "~standard": { readonly version: 1; readonly vendor: string; readonly validate: (value: unknown) => StandardSchemaResult | Promise>; }; } /** A Standard Schema validation issue. */ type StandardSchemaIssue = { readonly message: string; readonly path?: ReadonlyArray; }; /** Success carries the (possibly transformed) value; failure carries issues. */ type StandardSchemaResult = { readonly value: Output; readonly issues?: undefined; } | { readonly issues: ReadonlyArray; }; /** * Thrown when a `getJson({ schema })` read fails Standard Schema validation. * Carries the raw issues so callers can inspect what failed. */ declare class JsonSchemaValidationError extends Error { readonly path: string; readonly issues: ReadonlyArray; constructor(path: string, issues: ReadonlyArray); } //#endregion export { JsonSchemaValidationError, StandardSchemaIssue, StandardSchemaResult, StandardSchemaV1 }; //# sourceMappingURL=standard-schema.d.mts.map