-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypings.d.ts
91 lines (89 loc) · 2.34 KB
/
typings.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import { TableFilterType } from '@/common';
import { ButtonProps, FormInstance } from 'antd';
import { AxiosResponse } from 'axios';
import { Rule } from 'rc-field-form/lib/interface';
import React, { ReactElement } from 'react';
export = componentData;
export as namespace componentData;
declare namespace componentData {
interface InfoCardProp {
data: any;
onClick?: React.MouseEventHandler<HTMLDivElement>;
}
interface CustomTableAction {
key: string;
text: string;
icon?: ReactElement;
btnProps?: ButtonProps;
hooks: componentData.DialogFormHooks | any;
apiParamKeys: (record: any) => any;
type: 'dialog' | 'api';
hidden?: (record: any) => boolean;
}
interface CustomFormHooks {
form?: JSX.Element;
validateFields: () => Promise<void>;
validatedContainer: {
validated: boolean;
};
formRef: FormInstance<any>;
setPropData: any;
setErrData: React.Dispatch<
React.SetStateAction<apiInterface.ErrData | null | undefined>
>;
}
interface DialogFormHooks {
visible: boolean;
setVisible: React.Dispatch<boolean>;
DialogForm: JSX.Element;
setForm: <T>(data: T) => void;
}
interface MuitActionDialogHooks {
visible: boolean;
setVisible: React.Dispatch<boolean>;
MuitActionDialog: JSX.Element;
updateDefaultFormData: (data: any) => void;
}
interface PropData {
key: string;
name: string;
type: TableFilterType;
rules?: Rule[];
selectData?:
| apiInterface.Enum[]
| ((params?: any) => Promise<AxiosResponse<apiInterface.Response>>)
| any;
selectRequestParams?: any,
searchOption?: {
keyProp: string;
labelProp: string;
};
default?: any;
holder?: string;
holderList?: [string, string];
timeRange?: {
rangeStartProp: string;
rangeEndProp: string;
};
hidden?: boolean;
}
interface OnFormChange {
(formData: any): void;
}
interface CustomFormProp {
propData: PropData[];
onChange: OnFormChange;
}
interface CustomFormDialogProp extends CustomFormProp {
title: string;
visible: boolean;
onOk: (e: React.MouseEvent<HTMLElement, MouseEvent>) => any;
onCancel?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => any;
}
interface MuitActionProp {
key: string;
value: string;
propData: PropData[];
api: any;
}
}