import { MaybeComputedRef } from '@vueuse/shared'; import { ValidateError, ValidateOption, Rules } from 'async-validator'; import { Ref } from 'vue-demi'; type AsyncValidatorError = Error & { errors: ValidateError[]; fields: Record; }; interface UseAsyncValidatorReturn { pass: Ref; errorInfo: Ref; isFinished: Ref; errors: Ref; errorFields: Ref; } interface UseAsyncValidatorOptions { /** * @see https://github.com/yiminghe/async-validator#options */ validateOption?: ValidateOption; } /** * Wrapper for async-validator. * * @see https://vueuse.org/useAsyncValidator * @see https://github.com/yiminghe/async-validator */ declare function useAsyncValidator(value: MaybeComputedRef>, rules: MaybeComputedRef, options?: UseAsyncValidatorOptions): UseAsyncValidatorReturn & PromiseLike; export { AsyncValidatorError, UseAsyncValidatorOptions, UseAsyncValidatorReturn, useAsyncValidator };