import { type ObjectShape } from "@kuus/yup"; /** * Encode form * * Takes a record of yup validations and outputs a `yup` schema with encoded * names (antispam technique) and a record of the encoded/decoded input `name`s. * * We skip the names prefixed wth an underscore which are considered programmatic * form data not created by user input. * * FIXME: types https://github.com/jquense/yup/issues/1700 */ export declare let encodeForm: (validationRules: T) => { encodedSchema: import("@kuus/yup").ObjectSchema<{ [x: string]: T[keyof T] extends import("@kuus/yup").ISchema ? T[keyof T]["__outputType"] : T[keyof T] extends { readonly key: string; readonly isContext: boolean; readonly isValue: boolean; readonly isSibling: boolean; readonly path: any; readonly getter: (data: unknown) => unknown; readonly map?: ((value: unknown) => infer T_1) | undefined; readonly __isYupRef: boolean; getValue(value: any, parent?: {}, context?: {}): infer T_1; cast(value: any, options?: { parent?: {}; context?: {}; }): infer T_1; resolve(): /*elided*/ any; describe(): import("@kuus/yup").SchemaRefDescription; toString(): string; } ? T_1 : unknown; }, import("@kuus/yup").AnyObject, { [x: string]: T[keyof T] extends import("@kuus/yup").ISchema ? T[keyof T]["__default"] : undefined; }, "">; encodedNames: Record; }; /** * Decode form data * * This function is meant to be used inside an api endpoint to gather an encoded * form submit data and transform it to the decoded desired json data. * * Here too we skip encoding/decoding process for names prefixed wth an underscore * which are considered programmatic form data not created by user input. */ export declare let decodeForm: = Record, FormData extends Record = Record>(formData: FormData) => ReturnAs;