UNPKG

@volverjs/form-vue

Version:

Vue 3 Forms with @volverjs/ui-vue

65 lines (64 loc) 3.35 kB
import { DeepReadonly, InjectionKey, Ref, SlotsType } from 'vue'; import { FormSchema, InjectedFormData, InjectedFormWrapperData, Path, InferFormattedError, InferSchema } from './types'; export declare function defineFormWrapper<Schema extends FormSchema, Type = undefined>(formProvideKey: InjectionKey<InjectedFormData<Schema, Type>>, wrapperProvideKey: InjectionKey<InjectedFormWrapperData<Schema>>): import('vue').DefineComponent<import('vue').ExtractPropTypes<{ name: { type: StringConstructor; required: true; }; tag: { type: StringConstructor; default: undefined; }; readonly: { type: BooleanConstructor; default: boolean; }; }>, { errors: Readonly<Ref<DeepReadonly<InferFormattedError<Schema>> | undefined, DeepReadonly<InferFormattedError<Schema>> | undefined>> | undefined; fields: Ref<Map<string, Path<InferSchema<Schema>>>, Map<string, Path<InferSchema<Schema>>>>; fieldsErrors: Ref<Map<string, InferFormattedError<Schema>>, Map<string, InferFormattedError<Schema>>>; formData: Ref<(undefined extends Type ? Partial<InferSchema<Schema>> : Type) | undefined, (undefined extends Type ? Partial<InferSchema<Schema>> : Type) | undefined> | undefined; invalid: import('vue').ComputedRef<boolean>; readonly: import('vue').ComputedRef<boolean>; clear: (() => void) | undefined; reset: (() => void) | undefined; submit: (() => Promise<boolean>) | undefined; validate: ((formData?: (undefined extends Type ? Partial<InferSchema<Schema>> : Type) | undefined, options?: { fields?: Set<Path<InferSchema<Schema>>> | undefined; superRefine?: ((arg: InferSchema<Schema>, ctx: import('./types').RefinementCtx<Schema>) => void | Promise<void>) | undefined; } | undefined) => Promise<boolean>) | undefined; validateWrapper: () => Promise<boolean>; }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("invalid" | "valid")[], "invalid" | "valid", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{ name: { type: StringConstructor; required: true; }; tag: { type: StringConstructor; default: undefined; }; readonly: { type: BooleanConstructor; default: boolean; }; }>> & Readonly<{ onInvalid?: ((...args: any[]) => any) | undefined; onValid?: ((...args: any[]) => any) | undefined; }>, { readonly: boolean; tag: string; }, SlotsType<{ default: { errors?: DeepReadonly<InferFormattedError<Schema>>; fieldsErrors: Map<string, InferFormattedError<Schema>>; formData?: undefined extends Type ? Partial<InferSchema<Schema>> : Type; formErrors?: DeepReadonly<InferFormattedError<Schema>>; invalid: boolean; readonly: boolean; clear?: InjectedFormData<Schema, Type>["clear"]; reset?: InjectedFormData<Schema, Type>["reset"]; submit?: InjectedFormData<Schema, Type>["submit"]; validate?: InjectedFormData<Schema, Type>["validate"]; validateWrapper?: () => Promise<boolean>; }; }>, {}, {}, "invalid" | "reset" | "readonly" | "clear" | "errors" | "validate" | "submit" | "tag" | "formData" | "fields" | "fieldsErrors" | "validateWrapper", import('vue').ComponentProvideOptions, true, {}, any>;