forked from dreyescat/react-rating
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
146 lines (126 loc) · 3.85 KB
/
index.d.ts
File metadata and controls
146 lines (126 loc) · 3.85 KB
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
// Type definitions for react-rating 1.0.6 by <https://github.com/dreyescat/>
// Project: https://github.com/dreyescat/react-rating
// Definitions by: Kyle Davis <https://github.com/kyledavisdev>
// Konrad Szwarc <https://github.com/szwarckonrad/>
import { Dictionary } from "lodash";
import * as React from "react";
declare class Rating extends React.Component<RatingComponentProps> {}
declare namespace Rating {
}
export interface RatingComponentProps {
/**
* Range starting value (exclusive).
*
* Default value: 0
*/
start?: number;
/**
* Range stop value (inclusive).
*
* Default value: 5
*/
stop?: number;
/**
* Describes how many values each Symbol represents. For example,
* for a start value of 0, a stop value of 10 and a step of 2,
* we will end up with 5 Symbols, with each Symbol representing
* value increments of 2.
*
* Default value: 1
*/
step?: number;
/**
* Number of equal subdivisions that can be selected as a rating
* in each Symbol. For example, for a fractions value of 2, you
* will be able to select a rating with a precision of down to
* half a Symbol. Must be >= 1
*
* Default value: 1
*/
fractions?: number;
/**
* Range starting value (exclusive).
*
* Default value: 0
*/
initialRating?: number;
/**
* The value that will be used as an initial rating. This is the
* old initialRate.
*
* Default value: 0
*/
className?: string;
/**
* If you do not define an initialRating value, you can use a
* placeholder rating. Visually, this will have the same result
* as if you had defined an initialRating value. If initialRating
* is set placeholderRating is not taken into account. This is
* the old placeholderRate
*
* Default value: 0
*/
placeholderRating?: number;
/**
* Whether the rating can be modified or not.
*
* Default value: false
*/
readonly?: boolean;
/**
* Whether to animate rate hovering or not.
*
* Default value: false
*/
quiet?: boolean;
/**
* The direction of the rating element contents
*
* Default value: "ltr"
*/
direction?: "rtl" | "ltr";
/**
* React element, inline style object, or classes applied to
* the rating symbols when empty. Can also be an array of such
* symbols that will be applied in a circular manner (round-robin).
* This is the old empty.
*
* Default value: Style.empty
*/
emptySymbol?: string | string[] | JSX.Element[] | JSX.Element;
/**
* React element, inline style object, or classes applied to the rating
* symbols when full. Can also be an array of such symbols that will be
* applied in a circular manner (round-robin). This is the old full.
*
* Default value: Style.full
*/
fullSymbol?: string | string[] | JSX.Element[] | JSX.Element;
/**
* React element, inline style object, or classes applied to the
* placeholder rating symbols. Can also be an array of such symbols
* that will be applied in a circular manner (round-robin). This
* is the old placeholder.
*
* Default value: Style.placeholder
*/
placeholderSymbol?: string | string[] | JSX.Element[] | JSX.Element;
/**
* Gets called with the value when a different value than the currently
* set is selected.
*/
onChange?: (value: number) => void;
/**
* Gets called with the value when you hover over a symbol. The value
* is equal to the value that corresponds to that part of the symbol.
* Gets called in quiet mode too. When hover ends, gets called with
* no value (i.e. undefined as the value).
*/
onHover?: (value: number) => void;
/**
* Gets called with the value when a symbol is clicked. The value
* is equal to the value that corresponds to that part of the symbol.
*/
onClick?: (value: number) => void;
}
export default Rating;