@punkbit/test24jan
Version:
A standalone package for Fleek Agents AI user-interface
20 lines (19 loc) • 851 B
TypeScript
import type { FieldError, FieldErrorsImpl, Merge } from 'react-hook-form';
import type { Character } from './types';
import type { CharacterfileSchema, CharacterFormSchema } from './schema';
import type { ZodError } from 'zod';
type TransformedItem = {
label: string;
message: string;
type: string;
};
export type FormError = Merge<FieldError, FieldErrorsImpl<CharacterFormSchema['settings']>>;
export declare const transformErrors: (errors: FormError | undefined) => TransformedItem[];
export type FormattedError = {
path: string;
message: string;
};
export declare const formatZodError: (error: ZodError) => FormattedError[];
export declare const transformCharacterToSchema: (data: CharacterfileSchema) => CharacterFormSchema;
export declare const transformSchemaToCharacter: (data: CharacterFormSchema) => Character;
export {};