-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
272 lines (238 loc) · 7.78 KB
/
index.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
/* eslint-disable @typescript-eslint/no-explicit-any */
interface AccordionConstructorProps extends ComponentConstructorProps {
header: Partial<ComponentConstructorProps>;
icon: Partial<ComponentConstructorProps>;
dropdown: Partial<ComponentConstructorProps>;
content: Partial<ComponentConstructorProps>;
isOpen: boolean;
}
interface AvatarConstructorProps extends ComponentConstructorProps {
description: Partial<ComponentConstructorProps>;
image: Partial<ComponentConstructorProps>;
imageWrapper: Partial<ComponentConstructorProps>;
name: Partial<ComponentConstructorProps>;
textWrapper: Partial<ComponentConstructorProps>;
}
interface CheckboxConstructorProps extends ComponentConstructorProps {
border: Partial<ComponentConstructorProps>;
icon: Partial<ComponentConstructorProps>;
field: Partial<ComponentConstructorProps>;
label: Partial<ComponentConstructorProps>;
}
interface ComponentConstructorProps {
attributes: { [name: string]: string | boolean };
children: { [name: string]: Component | number | string };
className: string;
events: {
[name: string]: (instance: Component, event: Event) => unknown;
};
innerHTML: string | number;
parent: Component;
state: { [key: string]: any };
style: Partial<CSSStyleDeclaration> | ResponsiveObject<Partial<CSSStyleDeclaration>>;
tagName: string;
}
interface DrawerConstructorProps extends ComponentConstructorProps {
body: Partial<ComponentConstructorProps>;
btClose: Partial<ComponentConstructorProps>;
content: Partial<ComponentConstructorProps>;
footer: Partial<ComponentConstructorProps>;
header: Partial<ComponentConstructorProps>;
overlay: Partial<ComponentConstructorProps>;
}
interface HeaderConstructorProps extends ComponentConstructorProps {
leftContent: Partial<ComponentConstructorProps>;
centerContent: Partial<ComponentConstructorProps>;
rightContent: Partial<ComponentConstructorProps>;
container: Partial<ComponentConstructorProps>;
}
interface InputConstructorProps extends ComponentConstructorProps {
fieldWrapper: Partial<ComponentConstructorProps>;
field: Partial<ComponentConstructorProps>;
label: Partial<ComponentConstructorProps>;
leftSlot: Partial<ComponentConstructorProps>;
rightSlot: Partial<ComponentConstructorProps>;
}
interface ModalConstructorProps extends ComponentConstructorProps {
body: Partial<ComponentConstructorProps>;
btClose: Partial<ComponentConstructorProps>;
content: Partial<ComponentConstructorProps>;
footer: Partial<ComponentConstructorProps>;
header: Partial<ComponentConstructorProps>;
overlay: Partial<ComponentConstructorProps>;
}
interface ProgressConstructorProps extends ComponentConstructorProps {
fill: Partial<ComponentConstructorProps>;
value: Partial<ComponentConstructorProps>;
}
interface RadioConstructorProps extends ComponentConstructorProps {
border: Partial<ComponentConstructorProps>;
icon: Partial<ComponentConstructorProps>;
field: Partial<ComponentConstructorProps>;
label: Partial<ComponentConstructorProps>;
}
interface ResponsiveObject<T> {
base: T;
md: T;
sm: T;
lg: T;
xl: T;
}
interface SelectConstructorProps extends ComponentConstructorProps {
label: Partial<ComponentConstructorProps>;
fieldWrapper: Partial<ComponentConstructorProps>;
field: Partial<ComponentConstructorProps>;
leftSlot: Partial<ComponentConstructorProps>;
rightSlot: Partial<ComponentConstructorProps>;
}
interface TabConstructorProps extends ComponentConstructorProps {
activityIndicator: Partial<ComponentConstructorProps>;
}
interface TabsConstructorProps extends ComponentConstructorProps {
activeTabIndex: number;
tabList: Partial<ComponentConstructorProps>;
tabPanels: Partial<ComponentConstructorProps>;
}
interface ToastConstructorProps extends ComponentConstructorProps {
title: Partial<ComponentConstructorProps>;
description: Partial<ComponentConstructorProps>;
variant: 'success' | 'error' | 'warning' | 'info';
position:
| 'top-right'
| 'top-left'
| 'top-center'
| 'bottom-right'
| 'bottom-left'
| 'bottom-center';
duration: number;
}
declare class Component {
children: ComponentConstructorProps['children'];
id: string;
state: ComponentConstructorProps['state'];
target: HTMLElement;
constructor(props?: Partial<ComponentConstructorProps>);
appendChildren: (payload: ComponentConstructorProps['children']) => void;
appendTo: (target: HTMLElement) => void;
bindEvents: (payload: ComponentConstructorProps['events']) => Promise<void>;
static create: (payload?: Partial<ComponentConstructorProps>) => Component;
destroy: () => void;
fadeIn: (to?: ComponentConstructorProps['style']) => Promise<unknown>;
fadeOut: (to?: ComponentConstructorProps['style']) => Promise<unknown>;
hide: () => void;
prependChildren: (payload: ComponentConstructorProps['children']) => void;
prependTo: (target: HTMLElement) => void;
setAttributes: (payload: ComponentConstructorProps['attributes']) => void;
setState: (payload: typeof this.state) => void;
setStyle: (payload: ComponentConstructorProps['style']) => void;
show: () => void;
}
declare class Accordion extends Component {
constructor(props?: Partial<AccordionConstructorProps>);
isOpen: boolean;
private assemble;
private init;
}
declare class Avatar extends Component {
constructor(props?: Partial<AvatarConstructorProps>);
private assemble;
private init;
}
declare class Button extends Component {
constructor(props?: Partial<ComponentConstructorProps>);
}
declare class Checkbox extends Component {
constructor(props?: Partial<CheckboxConstructorProps>);
private assemble;
private init;
}
declare class Container extends Component {
constructor(props?: Partial<ComponentConstructorProps>);
}
declare class Drawer extends Component {
constructor(props?: Partial<DrawerConstructorProps>);
private assemble;
close: () => Promise<void>;
private init;
open: () => Promise<void>;
}
declare class Header extends Component {
constructor(props?: Partial<HeaderConstructorProps>);
private assemble;
private init;
}
declare class Input extends Component {
constructor(props?: Partial<InputConstructorProps>);
private assemble;
private init;
}
declare class Modal extends Component {
constructor(props?: Partial<ModalConstructorProps>);
private assemble;
close: () => Promise<void>;
private init;
open: () => Promise<void>;
}
declare class Progress extends Component {
constructor(props?: Partial<ProgressConstructorProps>);
private assemble;
private init;
setValue: (value: number) => void;
}
declare class Radio extends Component {
constructor(props?: Partial<RadioConstructorProps>);
private assemble;
private init;
}
declare class Select extends Component {
constructor(props?: Partial<SelectConstructorProps>);
private assemble;
private init;
}
declare class Tab extends Button {
isActive: boolean;
constructor(props?: Partial<TabConstructorProps>);
private assemble;
private init;
setActive: (isActive: boolean) => void;
}
declare class TabPanel extends Component {
constructor(props?: Partial<ComponentConstructorProps>);
}
declare class Tabs extends Component {
activeTabIndex: number;
constructor(props?: Partial<TabsConstructorProps>);
private assemble;
private init;
setActiveTabIndex: (activeTabIndex: TabsConstructorProps['activeTabIndex']) => void;
}
declare class Tag extends Component {
constructor(props?: Partial<ComponentConstructorProps>);
}
declare class Toast extends Component {
constructor(props?: Partial<ToastConstructorProps>);
private assemble;
dismiss: () => void;
show: () => void;
static trigger: (props: Partial<ToastConstructorProps>) => void;
}
export {
Accordion,
Avatar,
Button,
Checkbox,
Component,
Container,
Drawer,
Header,
Input,
Modal,
Progress,
Radio,
Select,
Tab,
TabPanel,
Tabs,
Tag,
Toast,
};