react-native-slider
react-native-slider copied to clipboard
Typings (for typescript)
Can you add typings for typescript? I would love to use this in my project, but without types it's really annoying. Many thanks!
you can add your own typings in the mean time by declaring the module:
- create a
slider.d.ts
file at the top of your project - declare the module like so:
declare module 'react-native-slider' {
import { ViewStyle } from 'react-native'
interface ISlider {
minimumValue?: number
maximumValue?: number
disabled?: boolean
value?: number
step?: number
minimumTrackTintColor?: string
maximumTrackTintColor?: string
thumbTintColor?: string
thumbTouchSize?: {
width: number
height: number
}
onValueChange?: (value: number) => void
onSlidingStart?: (value: number) => void
onSlidingComplete?: (value?: number) => void
style?: ViewStyle
trackStyle?: ViewStyle
thumbStyle?: ViewStyle
thumbImage?: number
debugTouchArea?: boolean
animateTransitions?: boolean
animationType?: 'spring' | 'timing'
animationConfig?: any
}
export default function Slider(props: ISlider): any
}
Actually, it is not a solution, it would be better to have the types in the library.