@polargold/pg-frontend-vue
    Preparing search index...

    Interface UseJoiValidationOptions<T>

    interface UseJoiValidationOptions<T> {
        buildTranslationKey?: (errorType: string) => string;
        dataToValidate: () => T;
        debounceMs?: number;
        translate: (key: string, params?: Record<string, unknown>) => string;
        validationSchema: ObjectSchema;
    }

    Type Parameters

    • T
    Index
    buildTranslationKey?: (errorType: string) => string

    Builds the translation key passed to translate from a Joi error's type (e.g. "string.empty"). Defaults to luv-autoq-frontend's original convention: VALIDATION.ERROR.STRING_EMPTY.

    dataToValidate: () => T
    debounceMs?: number

    Milliseconds to debounce debouncedValidate. Defaults to 700, matching the source copy.

    translate: (key: string, params?: Record<string, unknown>) => string

    Translates an error's translation key (see buildTranslationKey) into a user-facing message. Replaces a direct useI18n() import - wire this to vue-i18n's t, or anything else, so this package doesn't need a vue-i18n peer dependency for something only some consumers use.

    validationSchema: ObjectSchema