UNPKG

41.9 kBTypeScriptView Raw
1import * as React from 'react';
2import {
3 ViewStyle,
4 TextStyle,
5 ImageStyle,
6 ImageSourcePropType,
7 ImageURISource,
8 TouchableWithoutFeedbackProps,
9 TouchableOpacityProps,
10 TouchableNativeFeedbackProps,
11 ViewProps,
12 TextInput,
13 TextProps as TextProperties,
14 StatusBarProps,
15 StyleProp,
16 Animated,
17 ActivityIndicatorProps,
18 StatusBarStyle,
19 ModalProps,
20 TextInputProps,
21 ImageProps as RNImageProps,
22 TouchableHighlightProps,
23} from 'react-native';
24import { RatingProps, AirbnbRatingProps } from 'react-native-ratings';
25import {
26 IconButtonProps,
27 IconProps as VectorIconProps,
28} from 'react-native-vector-icons/Icon';
29
30export interface TouchableComponent extends TouchableHighlightProps {}
31
32/**
33 * Supports auto complete for most used types as well as any other string type.
34 */
35export type IconType =
36 | 'material'
37 | 'material-community'
38 | 'simple-line-icon'
39 | 'zocial'
40 | 'font-awesome'
41 | 'octicon'
42 | 'ionicon'
43 | 'foundation'
44 | 'evilicon'
45 | 'entypo'
46 | 'antdesign'
47 | 'font-awesome-5'
48 | string;
49
50export interface IconObject extends TouchableComponent {
51 name?: string;
52 color?: string;
53 size?: number;
54 type?: IconType;
55 style?: StyleProp<TextStyle>;
56}
57
58export interface AvatarIcon extends IconObject {
59 iconStyle?: StyleProp<TextStyle>;
60}
61
62export interface TextProps extends TextProperties {
63 /**
64 * font size 40
65 */
66 h1?: boolean;
67
68 /**
69 * font size 34
70 */
71 h2?: boolean;
72
73 /**
74 * font size 28
75 */
76 h3?: boolean;
77
78 /**
79 * font size 22
80 */
81 h4?: boolean;
82
83 /**
84 * Styling for when `h1` is set
85 */
86 h1Style?: StyleProp<TextStyle>;
87
88 /**
89 * Styling for when `h2` is set
90 */
91 h2Style?: StyleProp<TextStyle>;
92
93 /**
94 * Styling for when `h3` is set
95 */
96 h3Style?: StyleProp<TextStyle>;
97
98 /**
99 * Styling for when `h4` is set
100 */
101 h4Style?: StyleProp<TextStyle>;
102
103 /**
104 * Additional styling for Text
105 */
106 style?: StyleProp<TextStyle>;
107}
108
109/**
110 * HTML Style Headings
111 *
112 */
113export class Text extends React.Component<TextProps, any> {}
114
115export interface AvatarProps {
116 /**
117 * Component for enclosing element (eg: TouchableHighlight, View, etc)
118 *
119 * @default TouchableOpacity
120 */
121 Component?: React.ComponentClass;
122
123 /**
124 * Callback function when pressing component
125 */
126 onPress?(): void;
127
128 /**
129 * Callback function when long pressing component
130 */
131 onLongPress?(): void;
132
133 /**
134 * Styling for outer container
135 */
136 containerStyle?: StyleProp<ViewStyle>;
137
138 /**
139 * Image source
140 */
141 source?: ImageSourcePropType;
142
143 /**
144 * Style for avatar image
145 */
146 avatarStyle?: ImageStyle;
147
148 /**
149 * Determines the shape of avatar
150 *
151 * @default false
152 */
153 rounded?: boolean;
154
155 /**
156 * Renders title in the avatar
157 */
158 title?: string;
159
160 /**
161 * Style for the title
162 */
163 titleStyle?: StyleProp<TextStyle>;
164
165 /**
166 * Style for the view outside image or icon
167 */
168 overlayContainerStyle?: StyleProp<ViewStyle>;
169
170 /**
171 * Opacity when pressed
172 *
173 * @default 0.2
174 */
175 activeOpacity?: number;
176
177 /**
178 * Style for the placeholder
179 */
180 placeholderStyle?: StyleProp<ViewStyle>;
181
182 /**
183 * Render a content inside placeholder
184 */
185 renderPlaceholderContent?: React.ReactElement<{}>;
186
187 /**
188 * Icon for the avatar
189 */
190 icon?: AvatarIcon;
191
192 /**
193 * extra styling for icon component
194 */
195 iconStyle?: StyleProp<TextStyle>;
196
197 /**
198 * Optional properties to pass to the image if provided e.g "resizeMode"
199 */
200 imageProps?: Partial<ImageProps>;
201
202 /**
203 * Size of Avatar
204 * @default "small"
205 */
206
207 size?: 'small' | 'medium' | 'large' | 'xlarge' | number;
208
209 /**
210 * Image Component of Avatar
211 * @default React Native default Image component
212 */
213
214 ImageComponent?: React.ComponentClass;
215}
216
217/**
218 * Avatar Component
219 *
220 */
221export class Avatar extends React.Component<AvatarProps> {
222 static Accessory: React.ComponentType<
223 Partial<IconProps> & Partial<ImageProps>
224 >;
225}
226
227export interface ButtonProps
228 extends TouchableOpacityProps,
229 TouchableNativeFeedbackProps {
230 /**
231 * Specify other touchable such as TouchableOpacity/TouchableNativeFeedback
232 *
233 * Default is TouchableOpacity on IOS and TouchableNativeFeedback on Android
234 */
235 TouchableComponent?: React.ComponentClass;
236
237 /**
238 * Specify a different component as the background for the button.
239 * Useful for if you want to make a button with a gradient background.
240 *
241 * @default View
242 */
243 ViewComponent?: React.ComponentClass<any>;
244
245 /**
246 * Additional styling for button (background) view component
247 *
248 * @default null
249 */
250 buttonStyle?: StyleProp<ViewStyle>;
251
252 /**
253 * Button title
254 */
255 title?: string;
256
257 /**
258 * If to show the icon on the right
259 *
260 * @default false
261 */
262 iconRight?: boolean;
263
264 /**
265 * Icon to show in the button
266 */
267 icon?: IconNode;
268
269 /**
270 * Style for the container around the icon
271 */
272 iconContainerStyle?: StyleProp<ViewStyle>;
273
274 /**
275 * Title styling
276 */
277 titleStyle?: StyleProp<TextStyle>;
278
279 /**
280 * Optional props for the title inside the button
281 */
282 titleProps?: TextProperties;
283
284 /**
285 * Styling for Component container
286 *
287 * @default null
288 */
289 containerStyle?: StyleProp<ViewStyle>;
290
291 /**
292 * Display a loading spinner
293 *
294 * @default false
295 */
296 loading?: boolean;
297
298 /**
299 * Additional style to applied to the ActivityIndicator
300 */
301 loadingStyle?: StyleProp<ViewStyle>;
302
303 /**
304 * Additional props to applied to the ActivityIndicator
305 */
306 loadingProps?: ActivityIndicatorProps;
307
308 /**
309 * Object of props to be applied to the linearGradient view(ViewComponent)
310 */
311 linearGradientProps?: Object;
312
313 /**
314 * Type of button
315 *
316 * @default solid
317 */
318 type?: 'solid' | 'clear' | 'outline';
319
320 /**
321 * If the user is allowed to interact with the button
322 *
323 * @default false
324 */
325 disabled?: boolean;
326
327 /**
328 * Style of the title when the button is disabled
329 */
330 disabledTitleStyle?: StyleProp<TextStyle>;
331
332 /**
333 * Style of the button when disabled
334 */
335 disabledStyle?: StyleProp<ViewStyle>;
336
337 /**
338 * If the button has raised styling
339 *
340 * @default false
341 */
342 raised?: boolean;
343}
344
345/**
346 * Button component
347 *
348 */
349export class Button extends React.Component<ButtonProps, any> {}
350
351export interface BadgeProps {
352 /**
353 * Text value to be displayed by badge
354 *
355 * @default null
356 */
357 value?: React.ReactNode;
358
359 /**
360 * Additional styling for badge (background) view component
361 */
362 badgeStyle?: StyleProp<ViewStyle>;
363
364 /**
365 * Style for the container
366 */
367 containerStyle?: StyleProp<ViewStyle>;
368
369 /**
370 * Style for the text in the badge
371 */
372 textStyle?: StyleProp<TextStyle>;
373
374 /*
375 * Props for the text in the badge
376 */
377 textProps?: TextProperties;
378
379 /**
380 * Custom component to replace the badge component
381 *
382 * @default View (if onPress then TouchableOpacity)
383 */
384 Component?: React.ComponentClass;
385
386 /**
387 * Determines color of the indicator
388 *
389 * @default primary
390 */
391 status?: 'primary' | 'success' | 'warning' | 'error';
392
393 /**
394 * Function called when pressed on the badge
395 */
396 onPress?(): void;
397}
398
399/**
400 * Badge component
401 *
402 */
403export class Badge extends React.Component<BadgeProps> {}
404
405/**
406 * withBadge Higher-Order Component
407 *
408 * @param value
409 * @param options
410 */
411export function withBadge(
412 /**
413 * Text value to be displayed by badge
414 */
415 value?: React.ReactNode | (() => React.ReactNode),
416 /**
417 * Options to configure the badge
418 */
419 options?: {
420 bottom?: number;
421 left?: number;
422 right?: number;
423 top?: number;
424 hidden?: boolean;
425 containerStyle?: StyleProp<ViewStyle>;
426 } & BadgeProps
427): <P = {}>(WrappedComponent: React.ComponentType<P>) => React.ComponentType<P>;
428
429export interface BottomSheetProps {
430 /**
431 * Style of the bottom sheet's container
432 * Use this to change the color of the underlay
433 */
434 containerStyle?: StyleProp<ViewStyle>;
435
436 /**
437 * To show or hide the Bottom Sheet Component
438 * @default false
439 */
440
441 isVisible: boolean;
442
443 /**
444 * props of react native modal https://reactnative.dev/docs/modal#props
445 * @default {}
446 */
447
448 modalProps: ModalProps;
449}
450
451/**
452 * Bottom Sheet component
453 *
454 */
455export class BottomSheet extends React.Component<BottomSheetProps> {}
456
457export interface CardProps {
458 /**
459 * Outer container style
460 */
461 containerStyle?: StyleProp<ViewStyle>;
462
463 /**
464 * Inner container style
465 */
466 wrapperStyle?: StyleProp<ViewStyle>;
467}
468
469/**
470 * Card component
471 *
472 */
473export class Card extends React.Component<CardProps> {
474 static Divider: React.ComponentType<DividerProps>;
475 static FeaturedSubtitle: React.ComponentType<TextProps>;
476 static FeaturedTitle: React.ComponentType<TextProps>;
477 static Title: React.ComponentType<TextProps>;
478 static Image: React.ComponentType<ImageProps>;
479}
480
481/**
482 * Set the buttons within a Group.
483 */
484export interface ElementObject {
485 element: React.ReactElement<{}> | React.ReactType;
486}
487
488/**
489 * Set the border styles for a component.
490 */
491export interface InnerBorderStyleProperty {
492 color?: string;
493 width?: number;
494}
495
496export interface ButtonGroupProps {
497 /**
498 * Allows the user to select multiple items
499 *
500 * @default false
501 */
502 selectMultiple?: boolean;
503
504 /**
505 * Current selected index of array of buttons
506 */
507 selectedIndex?: number | null;
508
509 /**
510 * The indexes that are selected. Used with 'selectMultiple'
511 *
512 * @default []
513 */
514 selectedIndexes?: number[];
515
516 /**
517 * Array of buttons for component, if returning a component, must be an object with { element: componentName }
518 */
519 buttons: string[] | ElementObject[];
520
521 /**
522 * Choose other button component such as TouchableOpacity
523 *
524 * @default TouchableHighlight
525 */
526 Component?: React.ComponentType<any>;
527
528 /**
529 * Specify styling for main button container
530 */
531 containerStyle?: StyleProp<ViewStyle>;
532
533 /**
534 * Specify styling for buttons container
535 */
536 buttonContainerStyle?: StyleProp<ViewStyle>;
537
538 /**
539 * inherited styling specify styling for button
540 */
541 buttonStyle?: StyleProp<ViewStyle>;
542
543 /**
544 * Specify styling selected button
545 *
546 * @default 'white'
547 */
548 selectedButtonStyle?: StyleProp<ViewStyle>;
549
550 /**
551 * Specify specific styling for text
552 */
553 textStyle?: StyleProp<TextStyle>;
554
555 /**
556 * Specify specific styling for text in the selected state
557 */
558 selectedTextStyle?: StyleProp<TextStyle>;
559
560 /**
561 * inherited styling object { width, color } update the styling of the interior border of the list of buttons
562 */
563 innerBorderStyle?: InnerBorderStyleProperty;
564
565 /**
566 * Specify underlayColor for TouchableHighlight
567 *
568 * @default 'white'
569 */
570 underlayColor?: string;
571
572 /**
573 * Determines what the opacity of the wrapped view should be when touch is active.
574 */
575 activeOpacity?: number;
576
577 /**
578 * Border radius for the container
579 */
580 containerBorderRadius?: number;
581
582 /**
583 * Controls if buttons are disabled
584 *
585 * Setting `true` makes all of them disabled, while using an array only makes those indices disabled
586 *
587 * @default false
588 */
589 disabled?: boolean | number[];
590
591 /**
592 * Styling for each button when disabled
593 */
594 disabledStyle?: StyleProp<ViewStyle>;
595
596 /**
597 * Styling for each selected button when disabled
598 */
599 disabledSelectedStyle?: StyleProp<ViewStyle>;
600
601 /**
602 * Styling for the text of each button when disabled
603 */
604 disabledTextStyle?: StyleProp<TextStyle>;
605
606 /**
607 * Styling for the text of each selected button when disabled
608 */
609 disabledSelectedTextStyle?: StyleProp<TextStyle>;
610
611 /**
612 * Display in vertical orientation
613 *
614 * @default false
615 */
616 vertical?: boolean;
617
618 /**
619 * Method to update Button Group Index
620 */
621 onPress(selectedIndex: number): void;
622
623 /**
624 *
625 * Called immediately after the underlay is hidden
626 */
627 onHideUnderlay?(): void;
628
629 /**
630 * Called immediately after the underlay is shown
631 */
632 onShowUnderlay?(): void;
633
634 /**
635 * Animate the touchable to a new opacity.
636 */
637 setOpacityTo?(value: number): void;
638}
639
640export class ButtonGroup extends React.Component<ButtonGroupProps> {}
641
642export interface CheckBoxProps extends TouchableOpacityProps {
643 /**
644 * Icon family, can be one of the following
645 * (required only if specifying an icon that is not from font-awesome)
646 */
647 iconType?: IconType;
648
649 /**
650 * Specify React Native component for main button
651 */
652 Component?: React.ComponentClass;
653
654 /**
655 * Flag for checking the icon
656 *
657 * @default false
658 */
659 checked: boolean;
660
661 /**
662 * Moves icon to right of text.
663 *
664 * @default false
665 */
666 iconRight?: boolean;
667
668 /**
669 * Aligns checkbox to right
670 *
671 * @default false
672 */
673 right?: boolean;
674
675 /**
676 * Aligns checkbox to center
677 *
678 * @default false
679 */
680 center?: boolean;
681
682 /**
683 * Title of checkbox
684 */
685 title?: string | React.ReactElement<{}>;
686
687 /**
688 * Additional props for the title
689 */
690 titleProps?: Partial<TextProperties>;
691
692 /**
693 * Style of main container
694 */
695 containerStyle?: StyleProp<ViewStyle>;
696
697 /**
698 * Style of container that wraps the check box and text
699 */
700 wrapperStyle?: StyleProp<ViewStyle>;
701
702 /**
703 * style of text
704 */
705 textStyle?: StyleProp<TextStyle>;
706
707 /**
708 * Size of the checkbox
709 *
710 * @default 24
711 */
712 size?: number;
713
714 /**
715 * onLongPress function for checkbox
716 */
717 onLongPress?(): void;
718
719 /**
720 * onLongPress function for checkbox
721 */
722 onLongIconPress?(): void;
723
724 /**
725 * onPress function for container
726 */
727 onPress?(): void;
728
729 /**
730 * onPress function for checkbox
731 */
732 onIconPress?(): void;
733
734 /**
735 * Default checked icon (Font Awesome Icon)
736 *
737 * @default 'check-square-o'
738 */
739 checkedIcon?: string | React.ReactElement<{}>;
740
741 /**
742 * Default checked icon (Font Awesome Icon)
743 *
744 * @default 'square-o'
745 */
746 uncheckedIcon?: string | React.ReactElement<{}>;
747
748 /**
749 * Default checked color
750 *
751 * @default 'green'
752 */
753 checkedColor?: string;
754
755 /**
756 * Default unchecked color
757 * @default '#bfbfbf'
758 */
759 uncheckedColor?: string;
760
761 /**
762 * Specify a custom checked message
763 */
764 checkedTitle?: string;
765
766 /**
767 * Specify different font family
768 * @default 'System font bold (iOS)'
769 * @default 'Sans Serif Bold (android)'
770 */
771 fontFamily?: string;
772}
773export class CheckBox extends React.Component<CheckBoxProps, any> {}
774
775export interface DividerProps extends ViewProps {}
776
777export class Divider extends React.Component<DividerProps> {}
778
779export interface InputProps extends TextInputProps {
780 /**
781 * Styling for Input Component Container (optional)
782 */
783 containerStyle?: StyleProp<ViewStyle>;
784
785 /**
786 * Disables the input field
787 */
788 disabled?: boolean;
789
790 /**
791 * Style of the input field when disabled
792 */
793 disabledInputStyle?: StyleProp<TextStyle>;
794
795 /**
796 * Styling for Input Component Container (optional)
797 */
798 inputContainerStyle?: StyleProp<ViewStyle>;
799
800 /**
801 * Displays an icon to the left (optional)
802 */
803 leftIcon?: IconNode;
804
805 /**
806 * Styling for left Icon Component container
807 */
808 leftIconContainerStyle?: StyleProp<ViewStyle>;
809
810 /**
811 * Displays an icon to the right (optional)
812 */
813 rightIcon?: IconNode;
814
815 /**
816 * Styling for the right icon container
817 */
818 rightIconContainerStyle?: StyleProp<ViewStyle>;
819
820 /**
821 * Renders component in place of the React Native `TextInput` (optional)
822 */
823 InputComponent?: React.ComponentType<any>;
824
825 /**
826 * Adds styling to input component (optional)
827 */
828 inputStyle?: StyleProp<TextStyle>;
829
830 /**
831 * Add styling to error message (optional)
832 */
833 errorStyle?: StyleProp<TextStyle>;
834
835 /**
836 * Adds error message (optional)
837 */
838 errorMessage?: string;
839
840 /**
841 * props to be passed to the React Native Text component used to display the error message (optional)
842 */
843 errorProps?: TextProps;
844
845 /**
846 * Add styling to label (optional)
847 */
848 labelStyle?: StyleProp<TextStyle>;
849
850 /**
851 * Adds label (optional)
852 */
853 label?: string | React.ReactElement<{}>;
854
855 /**
856 * props to be passed to the React Native Text component used to display the label (optional)
857 */
858 labelProps?: TextProps;
859
860 /**
861 * displays error message
862 */
863 renderErrorMessage?: boolean;
864}
865
866export class Input extends React.Component<InputProps> {
867 /**
868 * Shakes the Input
869 *
870 * eg `this.inputRef.shake()`
871 */
872 shake(): void;
873
874 /**
875 * Calls focus on the Input
876 *
877 * eg `this.inputRef.focus()`
878 */
879 focus(): void;
880
881 /**
882 * Calls isFocused() on the Input
883 *
884 * eg `let focused = this.inputRef.isFocused()`
885 */
886 isFocused(): boolean;
887
888 /**
889 * Calls blur on the Input
890 *
891 * eg `this.inputRef.blur()`
892 */
893 blur(): void;
894
895 /**
896 * Calls clear on the Input
897 *
898 * eg `this.inputRef.clear()`
899 */
900 clear(): void;
901
902 /**
903 * Calls setNativeProps on the Input
904 *
905 * eg `this.inputRef.setNativeProps({ text: 'any text' })`
906 */
907 setNativeProps(nativeProps: Partial<TextInputProps>): void;
908}
909
910export interface HeaderIcon extends IconObject {
911 icon?: string;
912 text?: string;
913 color?: string;
914 style?: StyleProp<TextStyle>;
915}
916
917/**
918 * Defines the types that can be used in a header sub component
919 */
920export type HeaderSubComponent =
921 | React.ReactElement<{}>
922 | TextProps
923 | HeaderIcon;
924
925export interface HeaderProps extends ViewProps {
926 /**
927 * Specify a different component as the background for the button.
928 * Useful for if you want to make a button with a gradient background.
929 *
930 * @default View
931 */
932 ViewComponent?: React.ComponentClass<any>;
933
934 /**
935 * Object of props to be applied to the linearGradient view(ViewComponent)
936 */
937 linearGradientProps?: Object;
938
939 /**
940 * Accepts all props for StatusBar
941 */
942 statusBarProps?: StatusBarProps;
943
944 /**
945 * Sets the color of the status bar text.
946 *
947 * @default 'default'
948 */
949 barStyle?: StatusBarStyle;
950
951 /**
952 * Configuration object for default component (icon: string, ...props for React Native Elements Icon) or a valid React Element define your left component here
953 */
954 leftComponent?: HeaderSubComponent;
955
956 /**
957 * Configuration object for default component (text: string, ...props for React Native Text component) valid React Element define your center component here
958 */
959 centerComponent?: HeaderSubComponent;
960
961 /**
962 * Configuration object for default component (icon: string, ...props for React Native Elements Icon component) or a valid React Element define your right component here
963 */
964 rightComponent?: HeaderSubComponent;
965
966 /**
967 * Sets backgroundColor of the parent component
968 */
969 backgroundColor?: string;
970
971 /**
972 * Background image source
973 */
974 backgroundImage?: ImageSourcePropType;
975
976 /**
977 * Styles for the background image in the container
978 */
979 backgroundImageStyle?: ImageStyle;
980
981 /**
982 * Determines the alignment of the title
983 *
984 * @default 'center'
985 */
986 placement?: 'left' | 'center' | 'right';
987
988 /**
989 * Styling for main container
990 */
991 containerStyle?: StyleProp<ViewStyle>;
992
993 /**
994 * Styles for the container surrounding the title
995 */
996 centerContainerStyle?: StyleProp<ViewStyle>;
997
998 /**
999 * Styling for container around the leftComponent
1000 */
1001 leftContainerStyle?: StyleProp<ViewStyle>;
1002
1003 /**
1004 * Styling for container around the rightComponent
1005 */
1006 rightContainerStyle?: StyleProp<ViewStyle>;
1007}
1008
1009/**
1010 * Header component
1011 */
1012export class Header extends React.Component<HeaderProps, any> {}
1013
1014export interface IconProps extends IconButtonProps {
1015 /**
1016 * Type (defaults to material, options are material-community, zocial, font-awesome, octicon, ionicon, foundation, evilicon, simple-line-icon, or entypo)
1017 * @default 'material'
1018 */
1019 type?: IconType;
1020
1021 /**
1022 * View if no onPress method is defined, TouchableHighlight if onPress method is defined React Native component update React Native Component
1023 */
1024 Component?: React.ComponentClass;
1025
1026 /*
1027 * Extra props supplied to Icon Component from react-native-vector-icons.
1028 */
1029 iconProps?: VectorIconProps;
1030
1031 /**
1032 * Reverses color scheme
1033 *
1034 * @default false
1035 */
1036 reverse?: boolean;
1037
1038 /**
1039 * Adds box shadow to button
1040 *
1041 * @default false
1042 */
1043 raised?: boolean;
1044
1045 /**
1046 * Add styling to container holding icon
1047 */
1048 containerStyle?: StyleProp<ViewStyle>;
1049
1050 /**
1051 * Specify reverse icon color
1052 *
1053 * @default 'white'
1054 */
1055 reverseColor?: string;
1056
1057 /**
1058 * Styles for the Icon when disabled
1059 */
1060 disabledStyle?: StyleProp<ViewStyle>;
1061
1062 /**
1063 * FontAwesome5 solid style
1064 *
1065 * @default false
1066 */
1067 solid?: boolean;
1068
1069 /**
1070 * FontAwesome5 brands icon set
1071 *
1072 * @default false
1073 */
1074 brand?: boolean;
1075}
1076
1077/**
1078 * Icon component
1079 */
1080export class Icon extends React.Component<IconProps> {}
1081
1082export interface ScaleProps extends TouchableWithoutFeedbackProps {
1083 style?: StyleProp<ViewStyle>;
1084 defaultNumber?: number;
1085 activeScale?: number;
1086 tension?: number;
1087 friction?: number;
1088 pressInTension?: number;
1089 pressInFriction?: number;
1090 pressOutTension?: number;
1091 pressOutFriction?: number;
1092 useNativeDriver?: boolean;
1093}
1094
1095export interface ListItemProps extends TouchableComponent {
1096 containerStyle?: StyleProp<ViewStyle>;
1097 disabledStyle?: StyleProp<ViewStyle>;
1098 topDivider?: boolean;
1099 bottomDivider?: boolean;
1100 scaleProps?: ScaleProps;
1101 pad?: number;
1102 Component?: React.ComponentType<{}>;
1103 ViewComponent?: React.ComponentType<{}>;
1104}
1105
1106/**
1107 * ListItem component
1108 */
1109export class ListItem extends React.Component<ListItemProps, any> {
1110 static Content: React.ComponentType<ViewProps & { right?: boolean }>;
1111 static Title: React.ComponentType<TextProps & { right?: boolean }>;
1112 static Subtitle: React.ComponentType<TextProps & { right?: boolean }>;
1113 static ButtonGroup: React.ComponentType<ButtonGroupProps>;
1114 static CheckBox: React.ComponentType<CheckBoxProps>;
1115 static Chevron: React.ComponentType<Partial<IconProps>>;
1116 static Input: React.ComponentType<InputProps>;
1117}
1118
1119export interface OverlayProps extends ModalProps {
1120 /**
1121 * Content of the overlay
1122 */
1123 children: React.ReactElement<any>;
1124
1125 /**
1126 * If true, the overlay is visible
1127 */
1128 isVisible: boolean;
1129
1130 /**
1131 * Style for the backdrop
1132 */
1133 backdropStyle?: StyleProp<ViewStyle>;
1134
1135 /**
1136 * Style of the actual overlay
1137 */
1138 overlayStyle?: StyleProp<ViewStyle>;
1139
1140 /**
1141 * If to take up full screen width and height
1142 *
1143 * @default false
1144 */
1145 fullScreen?: boolean;
1146
1147 /**
1148 * Override React Native `Modal` component (usable for web-platform)
1149 */
1150 ModalComponent?: React.ComponentClass;
1151
1152 /**
1153 * Callback when user touches the backdrop
1154 */
1155 onBackdropPress?(): void;
1156}
1157
1158export class Overlay extends React.Component<OverlayProps> {}
1159
1160export interface ButtonInformation {
1161 title: string;
1162 icon: string;
1163 buttonStyle?: StyleProp<ViewStyle>;
1164 titleStyle?: StyleProp<TextStyle>;
1165}
1166
1167export interface PricingCardProps {
1168 /**
1169 * Title
1170 */
1171 title?: string;
1172
1173 /**
1174 * Price
1175 */
1176 price: string;
1177
1178 /**
1179 * Color scheme for button & title
1180 */
1181 color?: string;
1182
1183 /**
1184 * Pricing information
1185 */
1186 info?: string[];
1187
1188 /**
1189 * {title, icon, buttonStyle}
1190 * Button information
1191 */
1192 button: ButtonInformation;
1193
1194 /**
1195 * Function to be run when button is pressed
1196 */
1197 onButtonPress?(): void;
1198
1199 /**
1200 * Outer component styling
1201 */
1202 containerStyle?: StyleProp<ViewStyle>;
1203
1204 /**
1205 * Inner wrapper component styling
1206 */
1207 wrapperStyle?: StyleProp<ViewStyle>;
1208
1209 /**
1210 * component title style
1211 */
1212 titleStyle?: StyleProp<TextStyle>;
1213
1214 /**
1215 * component pricing text style
1216 */
1217 pricingStyle?: StyleProp<TextStyle>;
1218
1219 /**
1220 * component info text style
1221 */
1222 infoStyle?: StyleProp<TextStyle>;
1223}
1224
1225/**
1226 * PricingCard component
1227 */
1228export class PricingCard extends React.Component<PricingCardProps, any> {}
1229
1230/**
1231 * Rating, AirbnbRating, RatingProps, AirbnbRatingProps
1232 */
1233export * from 'react-native-ratings';
1234
1235export type IconNode = boolean | React.ReactElement<{}> | Partial<IconProps>;
1236
1237export interface SearchBarWrapper {
1238 /**
1239 * What style of search bar to display
1240 *
1241 * @default is 'default
1242 */
1243 platform?: 'default' | 'ios' | 'android';
1244}
1245
1246export interface SearchBarBase extends InputProps {
1247 /**
1248 * Styling for the searchbar container
1249 */
1250 containerStyle?: StyleProp<ViewStyle>;
1251
1252 /**
1253 * Optional styling for the TextInput's container
1254 */
1255 inputContainerStyle?: StyleProp<ViewStyle>;
1256
1257 /**
1258 * Override the clear Icon props or use a custom component. Use null or false to hide the icon.
1259 */
1260 clearIcon?: IconNode;
1261
1262 /**
1263 * Override the search Icon props or use a custom component. Use null or false to hide the icon.
1264 */
1265 searchIcon?: IconNode;
1266
1267 /**
1268 * TextInput styling
1269 */
1270 inputStyle?: StyleProp<TextStyle>;
1271
1272 /**
1273 * Optional props to pass to the ActivityIndicator
1274 */
1275 loadingProps?: ActivityIndicatorProps;
1276
1277 /**
1278 * If to show the loading indicator
1279 *
1280 * @default false
1281 */
1282 showLoading?: boolean;
1283
1284 /**
1285 * Container style for the left icon
1286 */
1287 leftIconContainerStyle?: StyleProp<ViewStyle>;
1288
1289 /**
1290 * Container style for the right icon
1291 */
1292 rightIconContainerStyle?: StyleProp<ViewStyle>;
1293
1294 /**
1295 * Callback fired when the clear button is pressed
1296 */
1297 onClear?(): void;
1298
1299 /**
1300 * Callback fired when the input is focused
1301 */
1302 onFocus?(): void;
1303
1304 /**
1305 * Callback fired when the input is blurred via the keyboard
1306 */
1307 onBlur?(): void;
1308
1309 /**
1310 * Method to fire when text is changed
1311 */
1312 onChangeText?(text: string): void;
1313}
1314
1315export interface TooltipProps {
1316 /**
1317 * sets backgroundColor of the tooltip and pointer.
1318 */
1319 backgroundColor?: string;
1320
1321 /**
1322 * Color to highlight the item the tooltip is surrounding.
1323 */
1324 highlightColor?: string;
1325
1326 /**
1327 * Override React Native `Modal` component (usable for web-platform)
1328 */
1329 ModalComponent?: React.ComponentClass;
1330
1331 /**
1332 * function which gets called on closing the tooltip.
1333 */
1334 onClose?(): void;
1335
1336 /**
1337 * function which gets called on opening the tooltip.
1338 */
1339 onOpen?(): void;
1340
1341 /**
1342 * Color of tooltip pointer, it defaults to the backgroundColor if none passed .
1343 */
1344 pointerColor?: string;
1345
1346 /**
1347 * Flag to determine to toggle or not the tooltip on press.
1348 */
1349 toggleOnPress?: boolean;
1350
1351 /**
1352 * To determine whether to activate tooltip by onPress or onLongPress.
1353 */
1354 toggleAction?: string;
1355
1356 /**
1357 * Component to be rendered as the display container.
1358 */
1359 popover?: React.ReactElement<{}>;
1360
1361 /**
1362 * Passes style object to tooltip container
1363 */
1364 containerStyle?: StyleProp<ViewStyle>;
1365
1366 /**
1367 * Tooltip container height. Necessary in order to render the container in the correct place. Pass height according to the size of the content rendered inside the container.
1368 * @default 40
1369 */
1370 height?: number;
1371
1372 /**
1373 * Tooltip container width. Necessary in order to render the container in the correct place. Pass height according to the size of the content rendered inside the container.
1374 * @default 150
1375 */
1376 width?: number;
1377
1378 /**
1379 * Flag to determine whether or not dislay overlay shadow when tooltip is open.
1380 *
1381 * @default true
1382 */
1383 withOverlay?: boolean;
1384
1385 /**
1386 * Color of overlay shadow when tooltip is open.
1387 *
1388 * @default 'rgba(250, 250, 250, 0.70)'
1389 */
1390 overlayColor?: string;
1391
1392 /**
1393 * Flag to determine whether or not dislay pointer.
1394 */
1395 withPointer?: boolean;
1396
1397 /**
1398 * Force skip StatusBar height when calculating yOffset of element position (usable inside Modal on Android)
1399 */
1400 skipAndroidStatusBar?: boolean;
1401
1402 /**
1403 * Disable auto hiding of tooltip when touching/scrolling anywhere inside the active tooltip popover container. Tooltip closes only when overlay backdrop is pressed (or) highlighted tooltip button is pressed
1404 */
1405 closeOnlyOnBackdropPress?: boolean;
1406}
1407
1408export class Tooltip extends React.Component<TooltipProps, any> {
1409 /**
1410 * Toggles tooltip manually.
1411 */
1412 toggleTooltip(): void;
1413}
1414
1415export interface SearchBarDefault extends SearchBarBase {
1416 /**
1417 * Change theme to light theme
1418 *
1419 * @default false
1420 */
1421 lightTheme?: boolean;
1422
1423 /**
1424 * Change TextInput styling to rounded corners
1425 *
1426 * @default false
1427 */
1428 round?: boolean;
1429}
1430
1431export interface SearchBarPlatform extends SearchBarBase {
1432 /**
1433 * Callback fired when the cancel button is pressed
1434 */
1435 onCancel?(): void;
1436}
1437
1438export interface SearchBarAndroid extends SearchBarPlatform {
1439 /**
1440 * Override the cancel Icon props or use a custom component. Use null or false to hide the icon.
1441 */
1442 cancelIcon?: IconNode;
1443}
1444
1445export interface SearchBarIOS extends SearchBarPlatform {
1446 /**
1447 * Props passed to cancel button
1448 */
1449 cancelButtonProps?: Partial<TouchableOpacityProps> & {
1450 buttonStyle?: StyleProp<ViewStyle>;
1451 buttonTextStyle?: StyleProp<TextStyle>;
1452 color?: string;
1453 buttonDisabledStyle?: StyleProp<ViewStyle>;
1454 buttonDisabledTextStyle?: StyleProp<ViewStyle>;
1455 };
1456
1457 /**
1458 * title of cancel button on iOS. Default: 'Cancel'.
1459 */
1460 cancelButtonTitle?: string;
1461
1462 /**
1463 * When `true` the cancel button will stay visible after blur events.
1464 */
1465 showCancel?: boolean;
1466}
1467
1468export type SearchBarProps = SearchBarWrapper &
1469 SearchBarBase &
1470 SearchBarPlatform &
1471 SearchBarDefault &
1472 SearchBarIOS &
1473 SearchBarAndroid;
1474
1475/**
1476 * SearchBar component
1477 */
1478export class SearchBar extends React.Component<SearchBarProps, any> {
1479 /**
1480 * Holds reference to the stored input.
1481 */
1482 input: TextInput;
1483
1484 /**
1485 * Call focus on the TextInput
1486 */
1487 focus(): void;
1488
1489 /**
1490 * Call blur on the TextInput
1491 */
1492 blur(): void;
1493
1494 /**
1495 * Call clear on the TextInput
1496 */
1497 clear(): void;
1498
1499 /**
1500 * Only available for Android and IOS
1501 * call blur on the TextInput
1502 * call cancel passed from Props
1503 */
1504 cancel?(): void;
1505}
1506
1507export interface SliderProps {
1508 /**
1509 * Initial value of the slider
1510 *
1511 * @default 0
1512 */
1513 value?: number;
1514
1515 /**
1516 * Choose the orientation
1517 *
1518 * @default horizontal
1519 */
1520 orientation?: 'horizontal' | 'vertical';
1521
1522 /**
1523 * If true the user won't be able to move the slider
1524 *
1525 * @default false
1526 */
1527 disabled?: boolean;
1528
1529 /**
1530 * Initial minimum value of the slider
1531 *
1532 * @default 0
1533 */
1534 minimumValue?: number;
1535
1536 /**
1537 * Initial maximum value of the slider
1538 *
1539 * @default 1
1540 */
1541 maximumValue?: number;
1542
1543 /**
1544 * Step value of the slider. The value should be between 0 and maximumValue - minimumValue)
1545 *
1546 * @default 0
1547 */
1548 step?: number;
1549
1550 /**
1551 * The color used for the track to the left of the button
1552 *
1553 * @default '#3f3f3f'
1554 */
1555 minimumTrackTintColor?: string;
1556
1557 /**
1558 * The color used for the track to the right of the button
1559 *
1560 * @default '#b3b3b3'
1561 */
1562 maximumTrackTintColor?: string;
1563
1564 /**
1565 * The color used for the thumb
1566 *
1567 * @default '#343434'
1568 */
1569 thumbTintColor?: string;
1570
1571 /**
1572 * The size of the touch area that allows moving the thumb. The touch area has the same center as the visible thumb.
1573 * This allows to have a visually small thumb while still allowing the user to move it easily.
1574 *
1575 * @default "{width: 40, height: 40}"
1576 */
1577 thumbTouchSize?: {
1578 width?: number;
1579 height?: number;
1580 };
1581
1582 /**
1583 * Callback continuously called while the user is dragging the slider
1584 */
1585 onValueChange?(value: number): void;
1586
1587 /**
1588 * Callback called when the user starts changing the value (e.g. when the slider is pressed)
1589 */
1590 onSlidingStart?(value: number): void;
1591
1592 /**
1593 * Callback called when the user finishes changing the value (e.g. when the slider is released)
1594 */
1595 onSlidingComplete?(value: number): void;
1596
1597 /**
1598 * The style applied to the slider container
1599 */
1600 style?: StyleProp<ViewStyle>;
1601
1602 /**
1603 * The style applied to the track
1604 */
1605 trackStyle?: StyleProp<ViewStyle>;
1606
1607 /**
1608 * Allow touch on track to move the thumb.
1609 */
1610 allowTouchTrack?: boolean;
1611
1612 /**
1613 * The style applied to the thumb
1614 */
1615 thumbStyle?: StyleProp<ViewStyle>;
1616
1617 /**
1618 * The props applied to the thumb
1619 */
1620 thumbProps?: any;
1621
1622 /**
1623 * Set this to true to visually see the thumb touch rect in green.
1624 *
1625 * @default false
1626 */
1627 debugTouchArea?: boolean;
1628
1629 /**
1630 * Set to true if you want to use the default 'spring' animation
1631 *
1632 * @default false
1633 */
1634 animateTransitions?: boolean;
1635
1636 /**
1637 * Set to 'spring' or 'timing' to use one of those two types of animations with the default animation properties.
1638 *
1639 * @default 'timing'
1640 */
1641 animationType?: 'spring' | 'timing';
1642
1643 /**
1644 * Used to configure the animation parameters. These are the same parameters in the Animated library.
1645 *
1646 * @default undefined
1647 */
1648 animationConfig?:
1649 | Animated.TimingAnimationConfig
1650 | Animated.SpringAnimationConfig;
1651}
1652
1653/**
1654 * Slider component
1655 */
1656export class Slider extends React.Component<SliderProps, any> {}
1657
1658export type SocialMediaType =
1659 | 'facebook'
1660 | 'twitter'
1661 | 'google-plus-official'
1662 | 'google'
1663 | 'pinterest'
1664 | 'linkedin'
1665 | 'youtube'
1666 | 'vimeo'
1667 | 'tumblr'
1668 | 'instagram'
1669 | 'quora'
1670 | 'flickr'
1671 | 'foursquare'
1672 | 'wordpress'
1673 | 'stumbleupon'
1674 | 'github'
1675 | 'github-alt'
1676 | 'twitch'
1677 | 'medium'
1678 | 'soundcloud'
1679 | 'gitlab'
1680 | 'angellist'
1681 | 'codepen'
1682 | 'weibo'
1683 | 'vk';
1684
1685export interface SocialIconProps {
1686 /**
1687 * Title if made into a button
1688 */
1689 title?: string;
1690
1691 /**
1692 * Social media type
1693 */
1694 type: SocialMediaType;
1695
1696 /**
1697 * Adds a drop shadow, set to false to remove
1698 *
1699 * @default true
1700 */
1701 raised?: boolean;
1702
1703 /**
1704 * Creates button
1705 *
1706 * @default false
1707 */
1708 button?: boolean;
1709
1710 /**
1711 * onPress method
1712 */
1713 onPress?(): void;
1714
1715 /**
1716 * @default none function onLongPress method
1717 */
1718 onLongPress?(): void;
1719
1720 /**
1721 * Reverses icon color scheme, setting background to white and icon to primary color
1722 *
1723 * @default false
1724 */
1725 light?: boolean;
1726
1727 /**
1728 * Extra styling for icon component
1729 */
1730 iconStyle?: StyleProp<ViewStyle>;
1731
1732 /**
1733 * Button styling
1734 */
1735 style?: StyleProp<ViewStyle>;
1736
1737 /**
1738 * Icon color
1739 */
1740 iconColor?: string;
1741
1742 /**
1743 * Icon size
1744 *
1745 * @default 24
1746 */
1747 iconSize?: number;
1748
1749 /**
1750 * Component Type of button
1751 *
1752 * @default TouchableHighlight
1753 */
1754 Component?: React.ComponentClass;
1755
1756 /**
1757 * Specify different font family
1758 *
1759 * @default System font bold (iOS), Sans Serif Black (android)
1760 */
1761 fontFamily?: string;
1762
1763 /**
1764 * Specify font weight of title if set as a button with a title
1765 *
1766 * @default bold (ios), black(android)
1767 */
1768 fontWeight?: string;
1769
1770 /**
1771 * Specify text styling
1772 */
1773 fontStyle?: StyleProp<TextStyle>;
1774
1775 /**
1776 * Disable button
1777 *
1778 * @default false
1779 */
1780 disabled?: boolean;
1781
1782 /**
1783 * Shows loading indicator
1784 *
1785 * @default false
1786 */
1787 loading?: boolean;
1788
1789 /**
1790 * Specify underlayColor for TouchableHighlight
1791 *
1792 * @default 'white' if `light` prop is true, otherwise defaults to icon color.
1793 */
1794 underlayColor?: string;
1795}
1796
1797/**
1798 * SocialIcon component
1799 */
1800export class SocialIcon extends React.Component<SocialIconProps, any> {}
1801
1802export interface TileProps
1803 extends TouchableOpacityProps,
1804 TouchableNativeFeedbackProps {
1805 /**
1806 * Number passed to control opacity on press
1807 *
1808 * @default 0.2
1809 */
1810 activeOpacity?: number;
1811
1812 /**
1813 * Text inside the tile when tile is featured
1814 */
1815 caption?: string;
1816
1817 /**
1818 * Styling for the caption
1819 */
1820 captionStyle?: StyleProp<TextStyle>;
1821
1822 /**
1823 * @default none object (style) Styling for the outer tile container
1824 */
1825 containerStyle?: StyleProp<ViewStyle>;
1826
1827 /**
1828 * Styling for bottom container when not featured tile
1829 */
1830 contentContainerStyle?: StyleProp<ViewStyle>;
1831
1832 /**
1833 * Changes the look of the tile
1834 */
1835 featured?: boolean;
1836
1837 /**
1838 * Height for the tile
1839 *
1840 * @default Device Width * 0.8
1841 */
1842 height?: number;
1843
1844 /**
1845 * Icon Component Props
1846 */
1847 icon?: IconObject;
1848
1849 /**
1850 * Styling for the outer icon container
1851 */
1852 iconContainerStyle?: StyleProp<ViewStyle>;
1853
1854 /**
1855 * Styling for the image
1856 */
1857 imageContainerStyle?: StyleProp<ViewStyle>;
1858
1859 /**
1860 * Optional properties to pass to the image if provided e.g "resizeMode"
1861 */
1862 imageProps?: Partial<ImageProps>;
1863
1864 /**
1865 * Source for the image
1866 */
1867 imageSrc: ImageURISource | string | number;
1868
1869 /**
1870 * @default none function (event) Function to call when tile is pressed
1871 */
1872 onPress?(): void;
1873
1874 /**
1875 * Styling for overlay
1876 */
1877 overlayContainerStyle?: StyleProp<ViewStyle>;
1878
1879 /**
1880 * Text inside the tile
1881 */
1882 title?: string;
1883
1884 titleNumberOfLines?: number;
1885
1886 /**
1887 * Styling for the title
1888 */
1889 titleStyle?: StyleProp<TextStyle>;
1890
1891 /**
1892 * Width for the tile
1893 *
1894 * @default Device Width
1895 */
1896 width?: number;
1897
1898 /**
1899 * Specify a different component as the Image component
1900 * @default React Native BackgroundImage component
1901 */
1902 ImageComponent?: React.ComponentClass;
1903}
1904
1905/**
1906 * Tile component
1907 */
1908export class Tile extends React.Component<TileProps> {}
1909
1910export interface ImageProps extends RNImageProps {
1911 /**
1912 * Component for enclosing element (eg: TouchableHighlight, View, etc)
1913 *
1914 * @default View
1915 */
1916 Component?: React.ComponentClass;
1917
1918 /**
1919 * Callback function when pressing component
1920 */
1921 onPress?(): void;
1922
1923 /**
1924 * Callback function when long pressing component
1925 */
1926 onLongPress?(): void;
1927
1928 /**
1929 * Specify a different component as the Image component.
1930 *
1931 * @default Image
1932 */
1933 ImageComponent?: React.ComponentType<any>;
1934
1935 /**
1936 * Content to render when image is loading
1937 */
1938 PlaceholderContent?: React.ReactElement<any>;
1939
1940 /**
1941 * Additional styling for the container
1942 */
1943 containerStyle?: StyleProp<ViewStyle>;
1944
1945 /**
1946 * Additional styling for the placeholder container
1947 */
1948 placeholderStyle?: StyleProp<ViewStyle>;
1949
1950 /**
1951 * Perform fade transition on image load
1952 *
1953 * @default true
1954 */
1955 transition?: boolean;
1956
1957 /**
1958 * Sets transition's duration
1959 *
1960 * @default 360
1961 */
1962 transitionDuration?: number;
1963}
1964
1965/**
1966 * Image component
1967 */
1968export class Image extends React.Component<ImageProps> {}
1969
1970/**
1971 * Colors
1972 */
1973
1974export interface Colors {
1975 readonly primary: string;
1976 readonly secondary: string;
1977 readonly white: string;
1978 readonly black: string;
1979 readonly grey0: string;
1980 readonly grey1: string;
1981 readonly grey2: string;
1982 readonly grey3: string;
1983 readonly grey4: string;
1984 readonly grey5: string;
1985 readonly greyOutline: string;
1986 readonly searchBg: string;
1987 readonly success: string;
1988 readonly warning: string;
1989 readonly error: string;
1990 readonly disabled: string;
1991 readonly divider: string;
1992 readonly platform: {
1993 ios: {
1994 primary: string;
1995 secondary: string;
1996 grey: string;
1997 success: string;
1998 error: string;
1999 warning: string;
2000 };
2001 android: {
2002 primary: string;
2003 secondary: string;
2004 grey: string;
2005 success: string;
2006 error: string;
2007 warning: string;
2008 };
2009 };
2010}
2011
2012export const colors: Colors;
2013
2014/* Utility Functions */
2015
2016/**
2017 * TODO make the Icon Type an export of the react-native-vector-icons type definitions.
2018 */
2019export function getIconType(type: IconType): any;
2020
2021/**
2022 * Method to normalize size of fonts across devices
2023 */
2024export function normalize(size: number): number;
2025
2026/**
2027 * Registers custom icons
2028 */
2029export function registerCustomIconType(id: string, font: any): void;
2030
2031type RecursivePartial<T> = { [P in keyof T]?: RecursivePartial<T[P]> };
2032
2033export interface FullTheme {
2034 Avatar: Partial<AvatarProps>;
2035 Accessory: Partial<IconProps> & Partial<ImageProps>;
2036 Badge: Partial<BadgeProps>;
2037 BottomSheet: Partial<BottomSheetProps>;
2038 Button: Partial<ButtonProps>;
2039 ButtonGroup: Partial<ButtonGroupProps>;
2040 Card: Partial<CardProps>;
2041 CardDivider: Partial<DividerProps>;
2042 CardFeaturedSubtitle: Partial<TextProps>;
2043 CardFeaturedTitle: Partial<TextProps>;
2044 CardImage: Partial<ImageProps>;
2045 CardTitle: Partial<TextProps>;
2046 CheckBox: Partial<CheckBoxProps>;
2047 Divider: Partial<DividerProps>;
2048 Header: Partial<HeaderProps>;
2049 Icon: Partial<IconProps>;
2050 Image: Partial<ImageProps>;
2051 Input: Partial<InputProps>;
2052 ListItem: Partial<ListItemProps>;
2053 ListItemButtonGroup: Partial<ButtonGroupProps>;
2054 ListItemCheckBox: Partial<CheckBoxProps>;
2055 ListItemContent: Partial<ViewProps>;
2056 ListItemChevron: Partial<IconProps>;
2057 ListItemInput: Partial<InputProps>;
2058 ListItemSubtitle: Partial<TextProps>;
2059 ListItemTitle: Partial<TextProps>;
2060 Overlay: Partial<OverlayProps>;
2061 PricingCard: Partial<PricingCardProps>;
2062 Rating: Partial<RatingProps>;
2063 AirbnbRating: Partial<AirbnbRatingProps>;
2064 SearchBar: Partial<SearchBarProps>;
2065 Slider: Partial<SliderProps>;
2066 SocialIcon: Partial<SocialIconProps>;
2067 Text: Partial<TextProps>;
2068 Tile: Partial<TileProps>;
2069 Tooltip: Partial<TooltipProps>;
2070 colors: RecursivePartial<Colors>;
2071}
2072
2073export type Theme<T = {}> = Partial<FullTheme> & T;
2074
2075export type UpdateTheme = (updates: RecursivePartial<FullTheme>) => void;
2076
2077export type ReplaceTheme = (updates: RecursivePartial<FullTheme>) => void;
2078
2079export interface ThemeProps<T> {
2080 theme: Theme<T>;
2081 updateTheme: UpdateTheme;
2082 replaceTheme: ReplaceTheme;
2083}
2084
2085/**
2086 * ThemeProvider
2087 */
2088export interface ThemeProviderProps<T> {
2089 theme?: Theme<T>;
2090 children: React.ReactNode;
2091 useDark?: boolean;
2092}
2093
2094export class ThemeProvider<T> extends React.Component<ThemeProviderProps<T>> {
2095 updateTheme: UpdateTheme;
2096 replaceTheme: ReplaceTheme;
2097
2098 getTheme(): Theme<T>;
2099}
2100
2101export interface ThemeConsumerProps<T> {
2102 children(props: ThemeProps<T>): React.ReactNode;
2103}
2104
2105export class ThemeConsumer<T> extends React.Component<ThemeConsumerProps<T>> {}
2106
2107export const ThemeContext: React.Context<ThemeProps<{}>>;
2108
2109export function withTheme<P = {}, T = {}>(
2110 component: React.ComponentType<P & ThemeProps<T>>,
2111 themeKey?: string
2112): React.ComponentClass<Omit<P, keyof ThemeProps<T>>>;