forked from GeekyAnts/NativeBase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
1175 lines (1117 loc) · 36.6 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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
declare module "native-base" {
import * as React from "react";
import * as ReactNative from "react-native";
namespace NativeBase {
interface Text extends ReactNative.TextProperties {
note?: boolean;
uppercase?: boolean;
}
interface Switch extends ReactNative.SwitchProperties { }
interface View extends ReactNative.ViewProperties {
padder?: boolean;
}
interface Picker extends ReactNative.PickerProperties {
mode?: "dialog" | "dropdown";
supportedOrientations?: "portrait" | "landscape"
iosHeader?: string;
inlineLabel?: boolean;
headerBackButtonText?: string;
placeholder?: string;
placeholderStyle?: ReactNative.TextStyle;
textStyle?: ReactNative.TextStyle;
style?: ReactNative.TextStyle;
iosIcon?: React.ReactElement<NativeBase.Icon>;
note?: boolean;
placeholderIconColor?: string;
itemTextStyle?: ReactNative.TextStyle;
headerStyle?: ReactNative.ViewStyle;
headerTitleStyle?: ReactNative.TextStyle;
headerBackButtonTextStyle?: ReactNative.TextStyle;
modalStyle?: ReactNative.ViewStyle;
renderHeader?: (backAction: any) => React.ReactElement<any>;
}
interface H1 extends ReactNative.TextProperties { }
/**
* see Widget Text.js
*/
interface H2 extends ReactNative.TextProperties { }
/**
* see Widget Text.js
*/
interface H3 extends ReactNative.TextProperties { }
/**
* see Widget Text.js
*/
interface BsStyle {
success?: boolean;
primary?: boolean;
danger?: boolean;
warning?: boolean;
info?: boolean;
}
interface Badge extends ReactNative.ViewProperties, BsStyle { }
/**
* see Widget CardSwiper.js
*/
interface CardSwiper { }
/**
* see Widget DeckSwiper.js
*/
interface DeckSwiper {
/**
* Array<any>
*/
dataSource?: Array<any>;
/**
* Direction of iteration for elements
* Default: iterates in backward direction
*/
onSwipeLeft?: Function;
/**
* Direction of iteration for elements
* Default: iterates in forward direction
*/
onSwipeRight?: Function;
/**
* Takes a data entry from the data source and should return a renderable component to be rendered as the row.
*/
renderItem?: Function;
}
/**
* see Widget Header.js
*/
interface Header {
/**
* Prop to be used with <Header> component to have Search bar onto the Header section of your screen.
*/
searchBar?: boolean;
/**
* Wraps the search bar with predefined border options.
* Default: regular
*/
rounded?: boolean;
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
/**
* It is advisable to use hasTabs prop with Header while using Tab
*/
hasTabs?: boolean;
noShadow?: boolean;
hasSubtitle?: boolean;
span?: boolean;
androidStatusBarColor?: string;
iosBarStyle?: ReactNative.StatusBarStyle;
hasSegment?: boolean;
translucent?: boolean;
transparent?: boolean;
noLeft?: boolean;
}
interface Left {
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
}
interface Body {
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
}
interface Right {
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
}
/**
* see Widget FooterTab.js
*/
interface FooterTab {
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
}
/**
* see Widget Footer.js
*/
interface Footer {
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
}
/**
* see Widget Title.js
*/
interface Title {
style?: ReactNative.TextStyle;
}
/**
* see Widget Subtitle/index.js
*/
interface Subtitle {
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
}
/**
* see Widget Container.js
*/
interface Container {
/**
* The theme prop can be applied to any component of NativeBase.
*/
theme?: Object;
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
}
/**
* see Widget Content.js
*/
interface Content {
/**
* The theme prop can be applied to any component of NativeBase.
*/
refreshing?: boolean;
refreshControl?: object;
theme?: Object;
padder?: boolean;
disableKBDismissScroll?: boolean;
enableResetScrollToCoords?: boolean;
contentOffset?: Object;
scrollEnabled?: boolean;
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
contentContainerStyle?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
keyboardShouldPersistTaps?: string;
keyboardDismissMode?: string;
}
/**
* see Widget Button.js
*/
interface Button extends ReactNative.TouchableOpacityProperties, BsStyle {
/**
* Defines button style
*/
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
/**
* Defines button text style
*/
textStyle?: ReactNative.TextStyle;
/**
* Block level button
*/
block?: boolean;
/**
* Vertical button
*/
vertical?: boolean;
/**
* Button with badges
*/
badge?: boolean;
//primary?: boolean,
/**
* Gives you effect of Icon-buttons.
* To have button with transparent background, include this prop.
*/
transparent?: boolean;
//success?: boolean,
//danger?: boolean,
// warning?: boolean,
//info?: boolean,
color?: string;
/**
* Applies outline button style.
*/
bordered?: boolean;
/**
* Renders button with slightly round shaped edges.
*/
rounded?: boolean;
/**
* For large size button
*/
large?: boolean;
/**
* For small size button
*/
small?: boolean;
/**
* Used for Icon alignment.
* Aligns icon to the left in button.
* By default, icons are aligned to the left in button.
*/
iconLeft?: boolean;
/**
* Used for Icon alignment.
* Aligns icon to the right in button.
*/
iconRight?: boolean;
/**
* Used to enable/disable icons
* Icons align in the center of the button.
*/
icon?: boolean;
/**
* Disables onPress option for button
*/
disabled?: boolean;
active?: boolean;
inputButton?: boolean;
full?: boolean;
light?: boolean;
dark?: boolean;
/**
* [android] colored ripple effect
*/
androidRippleColor?: string;
/**
* Segments
*/
first?: boolean;
last?: boolean;
}
/**
* see Widget List.js
*/
interface List extends ReactListViewProperties {
listBorderColor?: string;
listDividerBg?: string;
listNoteColor?: string;
listItemPadding?: number;
listNoteSize?: number;
inset?: boolean;
/**
* Array of data chunks to render iteratively.
*/
dataArray?: Array<any>;
renderRow?: (
rowData: any,
sectionID: string | number,
rowID: string | number,
highlightRow?: boolean
) => React.ReactElement<any>;
dataSource?: ReactNative.ListViewDataSource;
disableLeftSwipe?: boolean;
disableRightSwipe?: boolean;
rightOpenValue?: number;
leftOpenValue?: number;
renderRightHiddenRow?: (
rowData: any,
sectionID: string | number,
rowID: string | number,
rowMap?: any
) => React.ReactElement<any>;
renderLeftHiddenRow?: (
rowData: any,
sectionID: string | number,
rowID: string | number,
rowMap?: any
) => React.ReactElement<any>;
rowHasChanged?: (r1: any, r2: any) => boolean;
onRowOpen?: Function;
onRowClose?: Function;
onRowDidOpen?: Function;
onRowDidClose?: Function;
swipeToOpenPercent?: number;
closeOnRowBeginSwipe?: boolean;
}
/**
* see Widget ListItem.js
*/
interface ListItem extends ReactNative.TouchableOpacityProperties {
header?: boolean;
noBorder?: boolean;
noIndent?: boolean;
/**
* Aligns icon to the right of ListItem.
* Default: false
*/
iconRight?: boolean;
/**
* Aligns icon to the left of ListItem.
* Default: true
*/
iconLeft?: boolean;
icon?: boolean;
avatar?: boolean;
thumbnail?: boolean;
button?: boolean;
/**
* Helps to organize and group the list items.
*/
itemDivider?: boolean;
/**
* Sub caption for List Item.
*/
note?: string;
itemHeader?: boolean;
first?: boolean;
last?: boolean;
selected?: boolean;
/**
* [android] colored ripple effect
*/
androidRippleColor?: string;
touchableHighlightStyle?: ReactNative.ViewStyle;
}
interface Separator {
bordered?: boolean;
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
}
/**
* see Widget CardItem.js
*/
interface CardItem extends ReactNative.TouchableOpacityProperties {
header?: boolean;
footer?: boolean;
cardBody?: boolean;
button?: boolean;
bordered?: boolean;
}
/**
* Override React ListViewProperties
*/
interface ReactListViewProperties
extends ReactNative.ScrollViewProperties,
React.Props<ReactNative.ListView> {
/**
* Flag indicating whether empty section headers should be rendered.
* In the future release empty section headers will be rendered by
* default, and the flag will be deprecated. If empty sections are not
* desired to be rendered their indices should be excluded from
* sectionID object.
*/
enableEmptySections?: boolean;
/**
* How many rows to render on initial component mount. Use this to make
* it so that the first screen worth of data apears at one time instead of
* over the course of multiple frames.
*/
initialListSize?: number;
/**
* (visibleRows, changedRows) => void
*
* Called when the set of visible rows changes. `visibleRows` maps
* { sectionID: { rowID: true }} for all the visible rows, and
* `changedRows` maps { sectionID: { rowID: true | false }} for the rows
* that have changed their visibility, with true indicating visible, and
* false indicating the view has moved out of view.
*/
onChangeVisibleRows?: (
visibleRows: Array<{ [sectionId: string]: { [rowID: string]: boolean } }>,
changedRows: Array<{ [sectionId: string]: { [rowID: string]: boolean } }>
) => void;
/**
* Called when all rows have been rendered and the list has been scrolled
* to within onEndReachedThreshold of the bottom. The native scroll
* event is provided.
*/
onEndReached?: () => void;
/**
* Threshold in pixels for onEndReached.
*/
onEndReachedThreshold?: number;
/**
* Number of rows to render per event loop.
*/
pageSize?: number;
/**
* A performance optimization for improving scroll perf of
* large lists, used in conjunction with overflow: 'hidden' on the row
* containers. Use at your own risk.
*/
removeClippedSubviews?: boolean;
/**
* () => renderable
*
* The header and footer are always rendered (if these props are provided)
* on every render pass. If they are expensive to re-render, wrap them
* in StaticContainer or other mechanism as appropriate. Footer is always
* at the bottom of the list, and header at the top, on every render pass.
*/
renderFooter?: () => React.ReactElement<any>;
/**
* () => renderable
*
* The header and footer are always rendered (if these props are provided)
* on every render pass. If they are expensive to re-render, wrap them
* in StaticContainer or other mechanism as appropriate. Footer is always
* at the bottom of the list, and header at the top, on every render pass.
*/
renderHeader?: () => React.ReactElement<any>;
/**
* (rowData, sectionID, rowID) => renderable
* Takes a data entry from the data source and its ids and should return
* a renderable component to be rendered as the row. By default the data
* is exactly what was put into the data source, but it's also possible to
* provide custom extractors.
*/
renderRow?: (
rowData: any,
sectionID: string | number,
rowID: string | number,
highlightRow?: boolean
) => React.ReactElement<any>;
/**
* A function that returns the scrollable component in which the list rows are rendered.
* Defaults to returning a ScrollView with the given props.
*/
renderScrollComponent?: (
props: ReactNative.ScrollViewProperties
) => React.ReactElement<ReactNative.ScrollViewProperties>;
/**
* (sectionData, sectionID) => renderable
*
* If provided, a sticky header is rendered for this section. The sticky
* behavior means that it will scroll with the content at the top of the
* section until it reaches the top of the screen, at which point it will
* stick to the top until it is pushed off the screen by the next section
* header.
*/
renderSectionHeader?: (sectionData: any, sectionId: string | number) => React.ReactElement<any>;
/**
* (sectionID, rowID, adjacentRowHighlighted) => renderable
* If provided, a renderable component to be rendered as the separator below each row
* but not the last row if there is a section header below.
* Take a sectionID and rowID of the row above and whether its adjacent row is highlighted.
*/
renderSeparator?: (
sectionID: string | number,
rowID: string | number,
adjacentRowHighlighted?: boolean
) => React.ReactElement<any>;
/**
* How early to start rendering rows before they come on screen, in
* pixels.
*/
scrollRenderAheadDistance?: number;
/**
* An array of child indices determining which children get docked to the
* top of the screen when scrolling. For example, passing
* `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the
* top of the scroll view. This property is not supported in conjunction
* with `horizontal={true}`.
* @platform ios
*/
stickyHeaderIndices?: number[];
ref?: React.Ref<ReactNative.ListView & ReactNative.ScrollView & ReactNative.View>;
}
/**
* see Widget Card.js
*/
interface Card extends ReactNative.ViewProperties {
dataArray?: Array<any>;
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
ref?: React.Ref<ReactNative.ViewProperties | ReactListViewProperties>;
transparent?: boolean;
noShadow?: boolean;
// Adding ListView properties
// dataSource?: ReactNative.ListViewDataSource;
enableEmptySections?: boolean;
initialListSize?: number;
onChangeVisibleRows?: (
visibleRows: Array<{ [sectionId: string]: { [rowID: string]: boolean } }>,
changedRows: Array<{ [sectionId: string]: { [rowID: string]: boolean } }>
) => void;
onEndReached?: () => void;
onEndReachedThreshold?: number;
pageSize?: number;
removeClippedSubviews?: boolean;
renderFooter?: () => React.ReactElement<any>;
renderHeader?: () => React.ReactElement<any>;
renderRow?: (
rowData: any,
sectionID: string | number,
rowID: string | number,
highlightRow?: boolean
) => React.ReactElement<any>;
renderScrollComponent?: (props: ReactNative.ScrollViewProperties) => React.ReactElement<ReactNative.ScrollViewProperties>;
renderSectionHeader?: (sectionData: any, sectionId: string | number) => React.ReactElement<any>;
renderSeparator?: (
sectionID: string | number,
rowID: string | number,
adjacentRowHighlighted?: boolean
) => React.ReactElement<any>;
scrollRenderAheadDistance?: number;
stickyHeaderIndices?: number[];
stickySectionHeadersEnabled?: boolean;
}
/**
* react-native-easy-grid
*/
interface Grid extends ReactNative.ViewProperties { }
interface Row extends ReactNative.ViewProperties {
size?: number;
}
interface Col extends ReactNative.ViewProperties {
size?: number;
}
/**
* see Widget InputGroup.js
*/
interface InputGroup extends ReactNative.ViewProperties {
/**
* Wraps the textbox with predefined border options.
* Default: underline
*/
borderType?: "rounded" | "regular" | "underline";
toolbar?: boolean;
atoolbar?: boolean;
/**
* If true, the icon in the input text box appears to the right.
* Default: true
*/
iconRight?: boolean;
/**
* The border color of textbox for valid input.
*/
success?: boolean;
/**
* The border color of textbox for invalid input.
*/
error?: boolean;
/**
* Disables inputting data.
*/
disabled?: boolean;
regular?: boolean;
underline?: boolean;
rounded?: boolean;
}
/**
* see Widget Input.js
*/
interface Input extends ReactNative.TextInputProperties {
label?: string;
/**
* Label placed to the left of the input element.
* When the user enters text, the label does not hide.
* This can also be used along with placeholder.
*/
inlineLabel?: boolean;
/**
* Places the label on top of the input element which appears like a stack.
* This can also be used along with placeholder.
*/
stackedLabel?: boolean;
/**
* Disables inputting data.
*/
disabled?: boolean;
getRef?: React.Ref<ReactNative.TextInput>;
}
/**
* see Widget Textarea.js
*/
interface Textarea extends ReactNative.TextInputProperties {
bordered: boolean;
rowSpan: number;
}
interface Label {
style?: ReactNative.TextStyle;
}
/**
* see Widget Icon.js
*/
interface Icon {
name: string;
type?: "AntDesign" | "Entypo" | "EvilIcons" | "Feather" | "FontAwesome" | "FontAwesome5" | "Foundation" | "Ionicons" | "MaterialCommunityIcons" | "MaterialIcons" | "Octicons" | "SimpleLineIcons" | "Zocial";
// TODO position attribute of ReactNative.FlexStyle hasn't another position values without "absolute" and "relative"
style?: any;
onPress?: (e?: any) => any;
active?: boolean;
ios?: string;
android?: string;
color?: string;
fontSize?: number;
}
/**
* see Widget Icon.js
*/
interface Thumbnail extends ReactNative.ImageProperties {
/**
* Dimension of thumbnail.
* Default: 30
*/
size?: number;
/**
* Represents shape of thumbnail.
* By default thumbnail is circle in shape.
*/
circular?: boolean;
/**
* Represents shape of thumbnail.
* By default thumbnail is circle in shape.
*/
square?: boolean;
small?: boolean;
large?: boolean;
}
/**
* see Widget Spinner.js
*/
interface Spinner extends ReactNative.ActivityIndicatorProperties {
inverse?: boolean;
}
/**
* see Widget CheckBox.js
*/
interface CheckBox extends ReactNative.TouchableOpacityProperties {
checked?: boolean;
color?: string;
}
/**
* see Widget CheckBox.js
*/
interface Radio extends ReactNative.TouchableOpacityProperties {
selected?: boolean;
selectedColor?: string;
}
/**
* see Widget ProgressBar.js
*/
interface ProgressBar {
progress?: number;
color?: string;
inverse?: boolean;
}
/**
* vendor react-native-drawer
*/
interface DrawerStyles {
drawer?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
main?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
drawerOverlay?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
mainOverlay?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
}
interface Drawer {
acceptDoubleTap?: boolean;
acceptPan?: boolean;
acceptTap?: boolean;
captureGestures?: boolean;
children?: any;
open?: boolean;
closedDrawerOffset?: number;
content?: any;
deviceScreen?: ReactNative.ScaledSize;
disabled?: boolean;
initializeOpen?: boolean;
negotiatePan?: boolean;
onClose?: Function;
onCloseStart?: Function;
onOpen?: Function;
onOpenStart?: Function;
openDrawerOffset?: number;
openDrawerThreshold?: number;
panCloseMask?: number;
panOpenMask?: number;
panStartCompensation?: boolean;
relativeDrag?: boolean;
side?: "left" | "right";
styles?: DrawerStyles;
tapToClose?: boolean;
tweenDuration?: number;
tweenEasing?: string;
tweenHandler?: Function;
type?: "overlay" | "static" | "displace";
}
interface ScrollableTab {
goToPage?: Function;
activeTab?: number;
tabs?: Array<any>;
backgroundColor?: string;
activeTextColor?: string;
inactiveTextColor?: string;
scrollOffset?: number;
style?: ReactNative.ViewStyle;
tabStyle?: ReactNative.ViewStyle;
tabsContainerStyle?: ReactNative.ViewStyle;
renderTab?: Function;
underlineStyle?: ReactNative.ViewStyle;
onScroll?: Function;
}
/**
* see Widget Tabs.js
*/
interface Tabs {
renderTabBar?: Function;
tabBarPosition?: "top" | "bottom";
edgeHitWidth?: number;
springTension?: number;
springFriction?: number;
onChangeTab?: Function;
page?: number;
locked?: boolean;
initialPage?: number;
tabBarUnderlineStyle?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
tabBarBackgroundColor?: string;
tabBarActiveTextColor?: string;
tabBarInactiveTextColor?: string;
tabBarTextStyle?: ReactNative.TextStyle;
tabContainerStyle?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
contentProps?: ReactNative.ScrollViewProperties;
}
interface Tab {
heading: React.ReactElement<TabHeading> | string;
tabStyle?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
activeTabStyle?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
textStyle?: ReactNative.TextStyle;
activeTextStyle?: ReactNative.TextStyle;
}
interface TabHeading {
tabStyle?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
activeTabStyle?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
textStyle?: ReactNative.TextStyle;
activeTextStyle?: ReactNative.TextStyle;
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
}
interface Item {
fixedLabel?: boolean;
floatingLabel?: boolean;
inlineLabel?: boolean;
stackedLabel?: boolean;
placeholderLabel?: boolean;
bordered?: boolean;
regular?: boolean;
underline?: boolean;
rounded?: boolean;
disabled?: boolean;
error?: boolean;
placeholder?: string;
secureTextEntry?: boolean;
success?: boolean;
last?: boolean;
picker?: boolean;
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
}
interface Form {
style?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
}
interface Fab {
active?: boolean;
direction?: "down" | "up" | "left" | "right";
containerStyle?: ReactNative.ViewStyle | Array<ReactNative.ViewStyle>;
onPress?: () => void;
position?: "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
style?: ReactNative.ViewStyle;
}
interface Image extends ReactNative.TextProperties { }
interface Segment extends ReactNative.TextProperties { }
interface Root extends ReactNative.TextProperties { }
interface StyleProvider {
style?: any;
}
interface SwipeRow {
leftOpenValue?: number;
rightOpenValue?: number;
closeOnRowPress?: boolean;
disableLeftSwipe?: boolean;
disableRightSwipe?: boolean;
recalculateHiddenLayout?: boolean;
preview?: boolean;
previewDuration?: number;
directionalDistanceChangeThreshold?: number;
swipeToOpenPercent?: number;
stopLeftSwipe?: number;
stopRightSwipe?: number;
onRowOpen?: Function;
onRowClose?: Function;
left?: React.ReactElement<any>;
body?: React.ReactElement<any>;
right?: React.ReactElement<any>;
style?: ReactNative.ViewStyle;
}
interface Accordion {
dataArray: Array<any>;
headerStyle?: ReactNative.ViewStyle;
contentStyle?: ReactNative.ViewStyle;
renderHeader?: (item: any, expanded: boolean) => React.ReactElement<any>;
renderContent?: (item: any) => React.ReactElement<any>;
expanded?: number;
icon?: string;
expandedIcon?: string;
iconStyle?: ReactNative.TextStyle;
expandedIconStyle?: ReactNative.TextStyle;
style?: ReactNative.ViewStyle;
}
interface DatePicker {
defaultDate?: Date;
minimumDate?: Date;
maximumDate?: Date;
locale?: string;
placeHolderText?: string;
textStyle?: ReactNative.TextStyle;
placeHolderTextStyle?: ReactNative.TextStyle;
androidMode?: "calendar" | "spinner" | "default";
timeZoneOffsetInMinutes?: number;
modalTransparent?: boolean;
animationType?: "slide" | "fade" | "none";
disabled?: boolean;
onDateChange?: (date: any) => void;
formatChosenDate?: (date: any) => void;
}
}
// Export definitions
/**
* NativeBase.Container
*
* Provides its own frame component, named after <Container>.
* All the components should be included within the Container.
* Container takes mainly two components: <Header> and <Content>.
* Container comes with its predefined stylesheet, with an added advantage of accepting user-defined styles.
* Usage of Container's Header component is very similar to your HTML <head>.
* The Content component of Container is nothing but the body section of your screen.
*/
export class Container extends React.Component<NativeBase.Container, any> { }
/**
* NativeBase.Header
*
* NativeBase component that renders as Header (navbar) for your screen.
* There can be a single Header component into your Container.
* To have Header for your screen, include <Header> component within <Container>.
* NativeBase gives you flexibility to define your Header component anywhere in the bounds of Container.
* Header takes input as: Button and Title (Text)
* The components those are defined within <Header> will be rendered in the same order that you define them.
* Header provides you with stylesheet.
* User can add custom styles while defining <Header> within their app.
* Replacing Component: React Native <View>
*/
export class Header extends React.Component<NativeBase.Header, any> { }
/**
* NativeBase.Content
*
* This is a NativeBase component which renders as body element of your screen.
* Each screen can have only one <Content> component and can be defined anywhere within the Container.
* Content takes in the whole collection of React Native and NativeBase components.
* Content provides you with stylesheet.
* User can add custom styles while defining <Content> within their app.
* Replacing Component: React Native <ScrollView>
*/
/**
* NativeBase.Left
*/
export class Left extends React.Component<NativeBase.Left, any> { }
/**
* NativeBase.Right
*/
export class Right extends React.Component<NativeBase.Right, any> { }
/**
* NativeBase.Body
*/
export class Body extends React.Component<NativeBase.Body, any> { }
export class Content extends React.Component<NativeBase.Content, any> { }
/**
* NativeBase.FooterTab
*/
export class FooterTab extends React.Component<NativeBase.FooterTab, any> { }
/**
* NativeBase.Footer
*/
export class Footer extends React.Component<NativeBase.Footer, any> { }
/**
* NativeBase.Title
*/
export class Title extends React.Component<NativeBase.Title, any> { }
export class Subtitle extends React.Component<NativeBase.Subtitle, any> { }
/**
* NativeBase.Button
*
* Provides Button component which is readily not available in React Native.
* Supports React Native app on both iOS and Android devices.
* Button component takes input such as: Text, Icon, Text with Icon.
* NativeBase gives you privilege to customize the props of this component.
* Example: To have custom style for button, include them in style prop of button.
* Intakes user-defined styles.
* NativeBase has provided its users with enormous list of props that can be used with Button.
* Replacing Component: React Native <TouchableOpacity>
*/
export class Button extends React.Component<NativeBase.Button, any> { }
/**
* NativeBase.View
*/
export class View extends React.Component<NativeBase.View, any> { }
/**
* NativeBase.Text
*/
export class Text extends React.Component<NativeBase.Text, any> { }
/**
* NativeBase.Switch
*/
export class Switch extends React.Component<NativeBase.Switch, any> { }
/**
* NativeBase.Picker
*/
export class Picker extends React.Component<NativeBase.Picker, any> { }
namespace Picker {
export class Item extends React.Component<ReactNative.PickerItemProperties, any> { }
}
/**
* NativeBase.List
*
* A base component for specifying lists of information. List must contain one or more list elements.
* Props provide configurability for several features. Provides a number of attributes that follows styling and interaction guidelines for each platform, so that they are intuitive for users to interact with.
*/
export class List extends React.Component<NativeBase.List, any> { }
/**
* NativeBase.ListItem
*
* • This is the child component of List.
* • Defines a list item.
* • Adds border at bottom of each ListItem.
* • List takes any number of ListItem.
*/
export class ListItem extends React.Component<NativeBase.ListItem, any> { }
/**
* NativeBase.H1
*/
export class H1 extends React.Component<NativeBase.H1, any> { }
/**
* NativeBase.H2