Open tonym95 opened 4 years ago
copy this into a file called react-native-rating-element.d.ts
anywhere in your project source code.
declare module 'react-native-rating-element' {
import { ViewStyle } from 'react-native'
interface RatingProps {
rated?: number
totalCount?: number
type?: string
selectedIconImage?: JSX.Element | JSX.Element[]
emptyIconImage?: JSX.Element | JSX.Element[]
readonly?: boolean
direction?: string
onIconTap?: (value: number) => void
ratingColor?: string
ratingBackgroundColor?: string
icon?: string
marginBetweenRatingIcon: 1
style?: ViewStyle
}
export const Rating: (props: RatingProps) => any
}
There's an error in the type interface above. marginBetweenRatingIcon
should be:
marginBetweenRatingIcon?: number
It's also missing:
size?: number
It seems that this library is missing a type definition file and there is none added so far in DefinitelyTyped repo, will that be added in the future? I'm pretty new to typescript myself, so I'm not really sure I can add one.