1 | import React, { Component } from "react";
|
2 | import { StyleProp, ViewStyle } from "react-native";
|
3 | declare const fractionsType: any;
|
4 | export declare type SwipeRatingProps = {
|
5 | /**
|
6 | * Graphic used for represent a rating
|
7 | *
|
8 | * Default is 'star'
|
9 | */
|
10 | type?: string;
|
11 | /**
|
12 | * Pass in a custom image source; use this along with type='custom' prop above
|
13 | */
|
14 | ratingImage?: React.ReactNode;
|
15 | /**
|
16 | * Pass in a custom fill-color for the rating icon; use this along with type='custom' prop above
|
17 | *
|
18 | * Default is '#f1c40f'
|
19 | */
|
20 | ratingColor?: string;
|
21 | /**
|
22 | * Pass in a custom background-fill-color for the rating icon; use this along with type='custom' prop above
|
23 | *
|
24 | * Default is 'white'
|
25 | */
|
26 | ratingBackgroundColor?: string;
|
27 | /**
|
28 | * Number of rating images to display
|
29 | *
|
30 | * Default is 5
|
31 | */
|
32 | ratingCount?: number;
|
33 | /**
|
34 | * Color used for the text labels
|
35 | */
|
36 | ratingTextColor?: string;
|
37 | /**
|
38 | * The size of each rating image
|
39 | *
|
40 | * Default is 50
|
41 | */
|
42 | imageSize?: number;
|
43 | /**
|
44 | * Callback method when the user starts rating.
|
45 | */
|
46 | onStartRating?: Function;
|
47 | /**
|
48 | * Callback method when the user finishes rating. Gives you the final rating value as a whole number
|
49 | */
|
50 | onFinishRating?: Function;
|
51 | /**
|
52 | * Displays the Built-in Rating UI to show the rating value in real-time
|
53 | *
|
54 | * Default is false
|
55 | */
|
56 | showRating?: boolean;
|
57 | /**
|
58 | * Exposes style prop to add additonal styling to the container view
|
59 | */
|
60 | style?: StyleProp<ViewStyle>;
|
61 | /**
|
62 | * Whether the rating can be modiefied by the user
|
63 | *
|
64 | * Default is false
|
65 | */
|
66 | readonly?: boolean;
|
67 | /**
|
68 | * Whether the text is read only
|
69 | *
|
70 | * Default is false
|
71 | */
|
72 | showReadOnlyText?: boolean;
|
73 | /**
|
74 | * The initial rating to render
|
75 | *
|
76 | * Default is ratingCount/2
|
77 | */
|
78 | startingValue?: number;
|
79 | /**
|
80 | * The number of decimal places for the rating value; must be between 0 and 20
|
81 | */
|
82 | fractions?: typeof fractionsType;
|
83 | /**
|
84 | * The minimum value the user can select
|
85 | *
|
86 | * Default is 0
|
87 | */
|
88 | minValue?: number;
|
89 | /**
|
90 | * Callback method when the user is swiping.
|
91 | */
|
92 | onSwipeRating?: (number: any) => void;
|
93 | /**
|
94 | * Color used for the background
|
95 | */
|
96 | tintColor?: string;
|
97 | /**
|
98 | * The number to jump per swipe
|
99 | * Default is 0 (not to jump)
|
100 | */
|
101 | jumpValue?: number;
|
102 | };
|
103 | declare type SwipeRatingState = {
|
104 | isComponentMounted: boolean;
|
105 | position: any;
|
106 | value?: number;
|
107 | centerX?: number;
|
108 | display: boolean;
|
109 | panResponder: any;
|
110 | };
|
111 | export default class SwipeRating extends Component<SwipeRatingProps, SwipeRatingState> {
|
112 | static defaultProps: {
|
113 | type: string;
|
114 | ratingImage: any;
|
115 | ratingColor: string;
|
116 | ratingBackgroundColor: string;
|
117 | ratingCount: number;
|
118 | showReadOnlyText: boolean;
|
119 | imageSize: number;
|
120 | minValue: number;
|
121 | jumpValue: number;
|
122 | };
|
123 | ratingRef: any;
|
124 | constructor(props: any);
|
125 | componentDidMount(): void;
|
126 | componentDidUpdate(prevProps: any): void;
|
127 | handleLayoutChange(): void;
|
128 | getPrimaryViewStyle(): {
|
129 | backgroundColor: any;
|
130 | width: any;
|
131 | height: number;
|
132 | };
|
133 | getSecondaryViewStyle(): {
|
134 | backgroundColor: any;
|
135 | width: any;
|
136 | height: number;
|
137 | };
|
138 | renderRatings(): any;
|
139 | getCurrentRating(value: any): number;
|
140 | setCurrentRating(rating: any): void;
|
141 | displayCurrentRating(): JSX.Element;
|
142 | render(): JSX.Element;
|
143 | componentWillUnmount(): void;
|
144 | }
|
145 | export {};
|