import type { ValidationErrors } from './index.js'; import type { AnyZodObject, ZodFormattedError } from 'zod'; import type { Writable } from 'svelte/store'; /** * A tree structure where the existence of a node means that its not a leaf. * Used in error mapping to determine whether to add errors to an _error field * (as in arrays and objects), or directly on the field itself. */ export type ErrorShape = { [K in string]: ErrorShape; }; export declare function errorShape(schema: AnyZodObject): ErrorShape; export declare function mapErrors(obj: ZodFormattedError, errorShape: ErrorShape | undefined, inObject?: boolean): ValidationErrors; export declare function flattenErrors(errors: ValidationErrors): { path: string; messages: string[]; }[]; export declare function clearErrors(Errors: Writable>, options: { undefinePath: string[] | null; clearFormLevelErrors: boolean; }): void;