import { DiffSetsResult, List, StringReplace, StringifyPossibleTypes } from "@re-do/utils"; import { ExtractableDefinition } from "./internal.js"; import { ParseContext } from "./parser.js"; import { Shallow } from "./shallow/shallow.js"; export declare const stringifyDefinition: (def: unknown) => string; export declare const definitionTypeError: (definition: unknown, path: string[]) => string; export declare const stringifyPathContext: (path: string[], trailingSpace?: boolean) => string; export declare const definitionTypeErrorTemplate = "Definitions must be strings, numbers, or objects."; export declare type DefinitionTypeError = typeof definitionTypeErrorTemplate; export declare const getBaseTypeName: (definition: string) => string; export declare const baseUnknownTypeError = "Unable to determine the type of '@def'@context."; export declare type UnknownTypeError = StringReplace, "@context", "">; export declare const unknownTypeError: (def: Definition, path: string[]) => string; export declare type OrTypeErrors = Record; export declare type OrErrorArgs = BaseAssignmentArgs & { orErrors: OrTypeErrors; }; export declare const orValidationErrorTemplate = "@valueType is not assignable to any of @def:\n@errors"; export declare const orValidationError: ({ def, valueType, orErrors }: OrErrorArgs) => string; export declare type BaseParseArgs = { def: unknown; ctx: ParseContext; }; export declare const shallowCycleErrorTemplate = "@def references a shallow cycle: @resolutions."; export declare type ShallowCycleError = StringReplace, "@resolutions", StringifyPossibleTypes>; export declare const shallowCycleError: ({ def, ctx }: BaseParseArgs) => string; export declare type ValidationErrorMessage = UnknownTypeError | ShallowCycleError | DefinitionTypeError; export declare type InferrableValidationErrorMessage = E extends ValidationErrorMessage ? E : never; export declare type ValidationErrors = Record; export declare type ValidationErrorArgs = { path: string[]; } & ({ message: string; } | BaseAssignmentArgs); export declare const validationError: (args: ValidationErrorArgs) => { [x: string]: string; }; export declare type BaseAssignmentArgs = { def: DefType; valueType: AssignmentType; }; export declare const requiredCycleErrorTemplate: string; export declare const isRequiredCycleError: (value: unknown) => false | RegExpMatchArray | null; export declare const generateRequiredCycleError: ({ def, ctx: { seen } }: BaseParseArgs) => string; export declare const unassignableError: ({ def, valueType }: BaseAssignmentArgs) => string; export declare const tupleLengthError: ({ def, valueType }: BaseAssignmentArgs) => string; export declare const mismatchedKeysError: (keyErrors: DiffSetsResult) => string; export declare const valueGenerationError: ({ def, ctx: { path } }: BaseParseArgs) => string; export declare const stringifyErrors: (errors: ValidationErrors) => string;