mhz-helpers 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,16 @@
1
1
  import { Ref } from 'vue';
2
2
  import { RuleItem } from 'async-validator';
3
+ type TLocale = 'ru' | 'en';
3
4
  export declare function useValidator<T>(formData: Ref<T>, rules: Partial<{
4
- [fieldName in keyof T]: RuleItem[] | false;
5
- }>): {
5
+ [fieldName in keyof T]: (RuleItem | ((locale: TLocale) => RuleItem))[];
6
+ }>, locale?: TLocale): {
6
7
  error: (field: string) => string | undefined;
7
8
  errors: import('vue').ComputedRef<Record<string, import('async-validator').ValidateError[]> | undefined>;
8
9
  isValid: () => boolean;
9
10
  };
10
- export declare function required(lang?: string): RuleItem;
11
- export declare function email(lang?: string): RuleItem;
12
- export declare function letters(lang?: string): RuleItem;
13
- export declare function min(value: number, lang?: string): RuleItem;
14
- export declare function max(value: number, lang?: string): RuleItem;
11
+ export declare function required(locale?: TLocale): RuleItem;
12
+ export declare function email(locale?: TLocale): RuleItem;
13
+ export declare function letters(locale?: TLocale): RuleItem;
14
+ export declare function min(value: number, locale?: TLocale): RuleItem;
15
+ export declare function max(value: number, locale?: TLocale): RuleItem;
16
+ export {};
@@ -8,5 +8,5 @@ interface NodeWithProps {
8
8
  export declare function dataTest(value: string): string;
9
9
  export declare function removeDataTest(node: NodeWithProps): void;
10
10
  export declare function wait(time?: number): Promise<void>;
11
- export declare function withSetup<T>(composable: () => T): void;
11
+ export declare function withSetup<T>(composable: () => Promise<T>): Promise<void>;
12
12
  export {};