aboutsummaryrefslogtreecommitdiffstats
path: root/src/@types
diff options
context:
space:
mode:
Diffstat (limited to 'src/@types')
-rw-r--r--src/@types/mobx-form.types.ts20
-rw-r--r--src/@types/mobx-react-form.d.ts1
2 files changed, 21 insertions, 0 deletions
diff --git a/src/@types/mobx-form.types.ts b/src/@types/mobx-form.types.ts
index 6bc20f5e1..7caddc9e4 100644
--- a/src/@types/mobx-form.types.ts
+++ b/src/@types/mobx-form.types.ts
@@ -1,3 +1,6 @@
1import { ChangeEventHandler, FocusEventHandler } from 'react';
2import { GlobalError } from './ferdium-components.types';
3
1export interface FormFieldOptions { 4export interface FormFieldOptions {
2 value?: string; 5 value?: string;
3 label?: string; 6 label?: string;
@@ -18,3 +21,20 @@ export interface FormFields {
18 }; 21 };
19 }; 22 };
20} 23}
24
25export interface Field extends Partial<Listeners> {
26 id?: string;
27 type?: string;
28 name?: string;
29 value: string;
30 label?: string;
31 placeholder?: string;
32 disabled?: boolean;
33 error?: GlobalError | string;
34}
35
36export interface Listeners {
37 onChange?: ChangeEventHandler<HTMLInputElement>;
38 onBlur?: FocusEventHandler<HTMLElement>;
39 onFocus?: FocusEventHandler<HTMLElement>;
40}
diff --git a/src/@types/mobx-react-form.d.ts b/src/@types/mobx-react-form.d.ts
new file mode 100644
index 000000000..4e19dc1c2
--- /dev/null
+++ b/src/@types/mobx-react-form.d.ts
@@ -0,0 +1 @@
declare module 'mobx-react-form';