types: improve Field injection typing (#8975)

* types: improve inject typing

* types: update
This commit is contained in:
neverland
2021-07-03 20:05:14 +08:00
committed by GitHub
parent 11e856d099
commit 5c080f3a6e
2 changed files with 12 additions and 4 deletions
+8
View File
@@ -1,3 +1,5 @@
import type { Ref } from 'vue';
export type FieldType =
| 'tel'
| 'text'
@@ -37,6 +39,12 @@ export type FieldRule = {
formatter?: (value: any, rule: FieldRule) => string;
};
export type FieldProvide = {
childFieldValue: Ref<(() => unknown) | undefined>;
resetValidation: () => void;
validateWithTrigger: (trigger: FieldValidateTrigger) => void;
};
declare global {
interface EventTarget {
composing?: boolean;