-
Notifications
You must be signed in to change notification settings - Fork 297
Expand file tree
/
Copy pathindex.d.ts
More file actions
214 lines (180 loc) · 5.56 KB
/
index.d.ts
File metadata and controls
214 lines (180 loc) · 5.56 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
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
import * as React from 'react';
import {FC} from 'react';
import * as ReactNative from 'react-native';
import {ImageURISource} from 'react-native';
type Constructor<T> = new (...args: any[]) => T;
type SliderReferenceType =
| (React.MutableRefObject<SliderRef> & React.LegacyRef<Slider>)
| undefined;
export interface SliderPropsAndroid extends ReactNative.ViewProps {
/**
* Color of the foreground switch grip.
*/
thumbTintColor?: string;
}
export interface SliderRef {
updateValue(value: number): void;
}
export type TrackMarksProps = {
isTrue: boolean;
thumbImage?: ImageURISource;
StepMarker?: FC<MarkerProps> | boolean;
currentValue?: number;
};
export type MarkerProps = {
stepMarked: boolean;
currentValue?: number;
};
export interface SliderPropsIOS extends ReactNative.ViewProps {
/**
* Assigns a maximum track image. Only static images are supported.
* The leftmost pixel of the image will be stretched to fill the track.
*/
maximumTrackImage?: ReactNative.ImageURISource;
/**
* Assigns a minimum track image. Only static images are supported.
* The rightmost pixel of the image will be stretched to fill the track.
*/
minimumTrackImage?: ReactNative.ImageURISource;
/**
* Permits tapping on the slider track to set the thumb position.
* Defaults to false on iOS. No effect on Android or Windows.
*/
tapToSeek?: boolean;
/**
* Sets an image for the thumb. Only static images are supported.
*/
thumbImage?: ReactNative.ImageURISource;
/**
* Assigns a single image for the track. Only static images
* are supported. The center pixel of the image will be stretched
* to fill the track.
*/
trackImage?: ReactNative.ImageURISource;
}
export interface SliderPropsWindows extends ReactNative.ViewProps {
/**
* Controls the orientation of the slider, default value is 'false' (horizontal).
*/
vertical?: boolean;
}
export interface SliderProps
extends SliderPropsIOS,
SliderPropsAndroid,
SliderPropsWindows {
/**
* If true the user won't be able to move the slider.
* Default value is false.
*/
disabled?: boolean;
/**
* The color used for the track to the right of the button.
* Overrides the default blue gradient image.
*/
maximumTrackTintColor?: string;
/**
* Initial maximum value of the slider. Default value is 1.
*/
maximumValue?: number;
/**
* The lower limit value of the slider. The user won't be able to slide below this limit.
*/
lowerLimit?: number;
/**
* The upper limit value of the slider. The user won't be able to slide above this limit.
*/
upperLimit?: number;
/**
* The color used for the track to the left of the button.
* Overrides the default blue gradient image.
*/
minimumTrackTintColor?: string;
/**
* Initial minimum value of the slider. Default value is 0.
*/
minimumValue?: number;
/**
* Custom padding on android
*/
padding?: {
left?: number;
top?: number;
right?: number;
bottom?: number;
};
/**
* Callback that is called when the user picks up the slider.
* The initial value is passed as an argument to the callback handler.
*/
onSlidingStart?: (value: number) => void;
/**
* Callback called when the user finishes changing the value (e.g. when the slider is released).
*/
onSlidingComplete?: (value: number) => void;
/**
* Callback continuously called while the user is dragging the slider.
*/
onValueChange?: (value: number) => void;
/**
* Step value of the slider. The value should be between 0 and (maximumValue - minimumValue). Default value is 0.
*/
step?: number;
/**
* Used to style and layout the Slider. See StyleSheet.js and ViewStylePropTypes.js for more info.
*/
style?: ReactNative.StyleProp<ReactNative.ViewStyle>;
/**
* Used to locate this view in UI automation tests.
*/
testID?: string;
/**
* Write-only property representing the value of the slider.
* Can be used to programmatically control the position of the thumb.
* Entered once at the beginning still acts as an initial value.
* The value should be between minimumValue and maximumValue,
* which default to 0 and 1 respectively.
* Default value is 0.
*
* This is not a controlled component, you don't need to update the
* value during dragging.
*/
value?: number;
/**
* Reverses the direction of the slider.
*/
inverted?: boolean;
/**
* Component to be rendered for each step indicator.
*/
StepMarker?: FC<MarkerProps>;
/**
*
*/
renderStepNumber?: boolean;
/**
* A string of one or more words to be announced by the screen reader.
* Otherwise, it will announce the value as a percentage.
* Requires passing a value to `accessibilityIncrements` to work correctly.
* Should be a plural word, as singular units will be handled.
*/
accessibilityUnits?: string;
/**
* An array of values that represent the different increments displayed
* by the slider. All the values passed into this prop must be strings.
* Requires passing a value to `accessibilityUnits` to work correctly.
* The number of elements must be the same as `maximumValue`.
*/
accessibilityIncrements?: Array<string>;
/**
* Reference object.
*/
ref?: SliderReferenceType;
}
/**
* A component used to select a single value from a range of values.
*/
declare class SliderComponent extends React.Component<SliderProps> {}
declare const SliderBase: Constructor<ReactNative.NativeMethods> &
typeof SliderComponent;
export default class Slider extends SliderBase {}
export type SliderIOS = Slider;