forked from jeanregisser/react-native-slider
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
137 lines (113 loc) · 3.36 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
declare module 'react-native-slider' {
import { ComponentClass, FC } from 'react'
import {
ImageSourcePropType,
SpringAnimationConfig,
StyleProp,
TimingAnimationConfig,
ViewStyle,
} from 'react-native'
interface SliderProps {
/**
* Initial value of the slider. 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*, e.g. if you don't update
* the value, the component won't be reset to its inital value.
*/
value?: number
/**
* If true the user won't be able to move the slider.
* Default value is false.
*/
disabled: boolean
/**
* Initial minimum value of the slider. Default value is 0.
*/
minimumValue?: number
/**
* Initial maximum value of the slider. Default value is 1.
*/
maximumValue?: number
/**
* Step value of the slider. The value should be between 0 and
* (maximumValue - minimumValue). Default value is 0.
*/
step?: number
/**
* The color used for the track to the left of the button. Overrides the
* default blue gradient image.
*/
minimumTrackTintColor?: string
/**
* The color used for the track to the right of the button. Overrides the
* default blue gradient image.
*/
maximumTrackTintColor?: string
/**
* The color used for the thumb.
*/
thumbTintColor?: string
/**
* The size of the touch area that allows moving the thumb.
* The touch area has the same center has the visible thumb.
* This allows to have a visually small thumb while still allowing the user
* to move it easily.
* The default is {width: 40, height: 40}.
*/
thumbTouchSize?: { width: number; height: number }
/**
* Callback continuously called while the user is dragging the slider.
*/
onValueChange: (value: number) => void
/**
* Callback called when the user starts changing the value (e.g. when
* the slider is pressed).
*/
onSlidingStart?: (value: number) => void
/**
* Callback called when the user finishes changing the value (e.g. when
* the slider is released).
*/
onSlidingComplete?: (value: number) => void
/**
* The style applied to the slider container.
*/
style?: StyleProp<ViewStyle>
/**
* The style applied to the track.
*/
trackStyle?: StyleProp<ViewStyle>
/**
* The component that renders inside track.
*/
customTrackComponent?: FC
/**
* The style applied to the thumb.
*/
thumbStyle?: StyleProp<ViewStyle>
/**
* Sets an image for the thumb.
*/
thumbImage?: ImageSourcePropType
/**
* Set this to true to visually see the thumb touch rect in green.
*/
debugTouchArea?: boolean
/**
* Set to true to animate values with default 'timing' animation type
*/
animateTransitions?: boolean
/**
* Custom Animation type. 'spring' or 'timing'.
*/
animationType?: 'spring' | 'timing'
/**
* Used to configure the animation parameters. These are the same parameters in the Animated library.
*/
animationConfig?: SpringAnimationConfig | TimingAnimationConfig
}
const Slider: ComponentClass<SliderProps>
export default Slider
}