/** * A basic i18n translation function type. */ export type i18nTranslation = (key: string, options?: Record) => string; /** * Minimal Yup instance interface exposing basic builders. */ export interface YupInstance { string: () => YupString; number: () => YupNumber; boolean: () => YupBoolean; email: () => YupString; object: >(schema: T) => YupObject; } /** * Minimal Yup string schema. */ export interface YupString { required: (message?: string) => YupString; email: (message?: string) => YupString; typeError: (message?: string) => YupString; matches: (regex: RegExp, message?: string | { message?: string; excludeEmptyString?: boolean; }) => YupString; } /** * Minimal Yup number schema. */ export interface YupNumber { required: (message?: string) => YupNumber; typeError: (message?: string) => YupNumber; } /** * Minimal Yup boolean schema. */ export interface YupBoolean { required: (message?: string) => YupBoolean; oneOf: (values: any[], message?: string) => YupBoolean; typeError: (message?: string) => YupBoolean; } /** * Minimal Yup object schema. */ export interface YupObject { shape: (fields: T) => YupObject; } export type ValidationSchema = YupObject | YupString | YupNumber | YupBoolean; export interface ValidationSchemaObj { type?: 'string' | 'number' | 'boolean' | 'object'; length?: { min?: number; max?: number; }; required?: { enabled: boolean; message: string; }; regex?: { enabled: boolean; message: string; }; }