-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
308 lines (273 loc) · 7.62 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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
import React from "react"
import {ImageProps, Text, TextStyle, ViewStyle,ImageSourceProps} from "react-native";
export interface DividerProps {
inset?: boolean,
style?: {
container?: ViewStyle
},
}
export class Divider extends React.Component<DividerProps> {
}
type ListItemStyle = {
container?: ViewStyle,
content?: ViewStyle,
contentViewContainer?: ViewStyle,
leftElementContainer?: ViewStyle,
centerElementContainer?: ViewStyle,
textViewContainer?: ViewStyle,
primaryText?: TextStyle,
firstLine?: TextStyle,
primaryTextContainer?: ViewStyle,
secondaryText?: TextStyle,
tertiaryText?: TextStyle,
rightElementContainer?: ViewStyle,
leftElement?: TextStyle,
rightElement?: TextStyle
}
export interface IconProps {
name?: string,
size?: number,
color?: string,
type?: 'MaterialIcons' | 'FontAwesome' | 'Ionicons' | 'MaterialCommunityIcons',
style?: TextStyle,
}
type MenuType = {
menu: {
labels: Array<string>
}
};
type Actions = {
actions: Array<IconProps>
}
export interface ListItemProps {
dense?: boolean,
divider?: boolean,
onPress?: (value: any) => void,
onLongPress?: (value: any) => void,
numberOfLines?: 1 | 2 | 3 | 'dynamic',
style?: ListItemStyle,
leftElement?: IconProps | React.Component,
rightElement?: IconProps | React.Component<any> | MenuType | Actions | Array<IconProps>,
centerElement?: string | React.Component<any> | { primaryText: string, secondaryText: string, tertiaryText: string },
children?: any,
onLeftElementPress?: (value?: any) => void,
onRightElementPress?: (value?: any) => void,
onPressValue?: any,
}
export class ListItem extends React.Component<ListItemProps> {
}
export class Icon extends React.Component<IconProps> {
}
type ButtonStyle = {
container?: ViewStyle,
icon?: TextStyle,
text?: TextStyle,
}
export interface ButtonProps {
disabled?: boolean,
raised?: boolean,
onPress?: (text: string) => void,
onLongPress?: (text: string) => void,
text: string,
upperCase?: boolean,
icon?: IconProps,
style?: ButtonStyle,
accent?: boolean,
primary?: boolean,
iconPosition?: 'left' | 'right',
useTextColorForRippleColor?: boolean,//是否使用文字颜色用于水波纹颜色,仅仅flatbutton有效
containerStyle?: ViewStyle,
textStyle?: TextStyle,
iconStyle?: TextStyle,
}
export class Button extends React.Component<ButtonProps> {
}
export interface TypographyProps {
variant?: string,
style?: {
text?: TextStyle,
},
children?: string | Text,
textStyle?: TextStyle
}
export class Typography extends React.Component<TypographyProps> {
}
type ActionsType = Array<{
icon: IconProps,
label: string,
name: string,
}>
type ActionButtonStyle = {
positionContainer?: ViewStyle,
toolbarPositionContainer?: ViewStyle,
container?: ViewStyle,
overlayContainer?: ViewStyle,
toolbarContainer?: ViewStyle,
toolbarActionContainer?: ViewStyle,
speedDialContainer?: ViewStyle,
speedDialActionContainer?: ViewStyle,
speedDialActionLabel?: ViewStyle,
speedDialActionLabelContainer?: ViewStyle,
speedDialActionIconContainer?: ViewStyle,
speedDialActionIcon?: ViewStyle,
icon?: ViewStyle
}
type ActionButtonProps = {
actions?: ActionsType,
onPress?: (text: any) => void,
onLongPress?: (text: any) => void,
hidden?: boolean,
icon?: IconProps,
transition?: 'toolbar' | 'speedDial',
rippleColor?: string,
style?: ActionButtonStyle,
size?: number,
}
export class ActionButton extends React.Component<ActionButtonProps> {
}
export interface AvatarProps {
image?: ImageProps,
icon?: IconProps,
text?: string,
size?: number,
style?: AvatarStyle,
containerStyle?: ViewStyle,
contentStyle?: ViewStyle,
source?: ImageSourceProps,
}
type AvatarStyle = {
container?: ViewStyle,
content?: ViewStyle,
}
export class Avatar extends React.Component<AvatarProps> {
}
type SimpleToolbarStyle = {
container?: ViewStyle,
leftElement?: ViewStyle,
rightElement?: ViewStyle,
centerElement?: ViewStyle,
title?: TextStyle,
}
type SimpleToolbarProps = {
title: string,
leftIcon?: IconProps,
rightIcon?: IconProps,
onLeftIconPress?: () => void,
onRightIconPress?: () => void,
style?: SimpleToolbarStyle,
center?: boolean,//title是否处于center
containerStyle?: ViewStyle,
leftElementStyle?: ViewStyle,
rightElementStyle?: ViewStyle,
titleStyle?: TextStyle,
centerElementStyle?: ViewStyle,
}
export class SimpleToolbar extends React.Component<SimpleToolbarProps> {
}
type ToastStyle = {
container?: ViewStyle,
textContainer?: ViewStyle,
text?: TextStyle,
}
type ToastProps = {
style?: ToastStyle,
containerStyle?: ViewStyle,
textContainerStyle?: ViewStyle,
textStyle?: TextStyle,
}
export class Toast extends React.Component<ToastProps> {
}
type IconToggleProps = {
color?: string,
underlayColor?: string,
maxOpacity?: number,
percent?: number,
disabled?: boolean,
size?: number,
name?: string,
children?: React.Node,
onPress?: () => void,
type?: "Ionicons" | "MaterialIcons" | "FontAwesome" | "MaterialCommunityIcons"
};
export class IconToggle extends React.Component<IconToggleProps> {
}
export var human
export var humanDense
export var humanTall
export var material
export var materialTall
export var materialDense
export var materialColors
export var iOSColors
export var iOSUIKit
export var iOSUIKitDense
export var iOSUIKitTall
export var sanFranciscoSpacing
export var sanFranciscoWeights
export var systemDenseWeights
export var systemTallWeights
export var systemWeights
export var robotoWeights
export var notoCJKWeights
export var notoTallWeights
export var webWeights
type CardStyle={
container?: ViewStyle,
}
type CardProps = {
children?: React.Node,
onPress?: () => void,
style?:CardStyle,
fullWidth?: boolean,
containerStyle?:ViewStyle,
}
export class Card extends React.Component<CardProps>{}
type ToolbarStyle = {
container?: ViewStyle,
leftElementContainer?: ViewStyle,
leftElement?: ViewStyle,
centerElementContainer?: ViewStyle,
titleText?: TextStyle,
rightElementContainer?:ViewStyle,
rightElement?: ViewStyle,
}
type ToolbarMenuType = {
menu: { labels: Array<string> | Array<{ text: string, icon: IconProps }> }
};
type ToolbarProps = {
onLeftElementPress?: (any) => void,
style?: ToolbarStyle,
onPress?: () => void,
leftElement?: ()=>React.Component<any> |IconProps | React.Component<any> ,
centerElement?: ()=>React.Component<any> | React.Component<any> | string ,
rightElement?: ()=>React.Component<any> | IconProps | React.Component<any> | Actions | ToolbarMenuType ,
onRightElementPress?: (any) => void,
containerStyle?:ViewStyle,
leftElementContainerStyle?:ViewStyle,
leftElementStyle?:ViewStyle,
rightElementContainerStyle?:ViewStyle,
rightElementStyle?:ViewStyle,
centerElementContainerStyle?:ViewStyle,
titleStyle?:ViewStyle,
}
export class Toolbar extends React.Component<ToolbarProps>{}
type BadgeStyle = {
container?: ViewStyle
}
interface BadgeProps {
children?: React.ReactElement,
text?: string,
icon?:IconProps,
size?: number,
style?: BadgeStyle,
nodeSize?:number,
}
export class Badge extends React.Component<BadgeProps>{}
type CheckboxProps = {
checked:boolean,
onCheck?:(value:boolean)=>void,
disabled?:boolean,
uncheckedIcon?:IconProps,
checkedIcon?:IconProps,
}
export class Checkbox extends React.Component<CheckboxProps>{}