import { ParsedField, ParsedSchema, SchemaValidation } from "./types.mjs"; import { SchemaProvider } from "./schema-provider.mjs"; //#region src/logic.d.ts declare function parseSchema(schemaProvider: SchemaProvider): ParsedSchema; declare function validateSchema(schemaProvider: SchemaProvider, values: any): SchemaValidation; declare function getDefaultValues(schemaProvider: SchemaProvider): Record; /** * Recursively remove empty values from an object (null, undefined, '') * Used in AutoForm before calling the resolver to prevent empty values from being validated. * This is necessary because zod's optional() allows undefined, but form fields default to * empty strings even when untouched. These defaults makes the optional() unusable. * and cause validation issues in react-hook-form. */ declare function removeEmptyValues>(values: T): Partial; declare function replaceEmptyValue>(values: T): T; /** * Sort the fields by order. * If no order is set, the field will be sorted based on the order in the schema. */ declare function sortFieldsByOrder(fields: ParsedField[] | undefined): ParsedField[]; //#endregion export { getDefaultValues, parseSchema, removeEmptyValues, replaceEmptyValue, sortFieldsByOrder, validateSchema }; //# sourceMappingURL=logic.d.mts.map