import type { ErrorObject, ValidateFunction } from "ajv/dist/2020.js"; /** * Look-aside validators keyed by `block.type`. Populated by the caller * (validate-block-kit.ts) with one compiled validator per block def, so we * can re-validate a misbehaving block against just its discriminator-matched * branch and report focused errors instead of the full oneOf cascade. */ export type FocusValidators = ReadonlyMap; /** * Format AJV errors with normalized paths and friendly per-keyword messages. * * When a block fails its `oneOf` evaluation, AJV reports a failure against * every branch (~80 errors for a single typo). We collapse this by * re-validating each offending block against just the schema branch matching * its declared `type`, replacing the union noise with the real reason that * specific block didn't validate. Blocks whose `type` isn't a recognized block * kind fall back to the raw (deduplicated) AJV output. * * @param errors - the raw `validator.errors` array from AJV * @param root - the (normalized) input AJV ran against — used to read each * block's `type` so we can pick the focused branch validator * @param target - validation target, controls path-normalization rooting * @param focusValidators - per-block-type compiled validators */ export declare function formatAjvErrors(errors: readonly ErrorObject[], root: unknown, target: "blocks" | "modal" | "home", focusValidators: FocusValidators): string[]; //# sourceMappingURL=format-ajv-errors.d.ts.map