react-native-rating-element icon indicating copy to clipboard operation
react-native-rating-element copied to clipboard

Typescript issue

Open tonym95 opened this issue 4 years ago • 2 comments

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.

tonym95 avatar Nov 06 '20 14:11 tonym95

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  
}

panigrah avatar May 23 '21 05:05 panigrah

There's an error in the type interface above. marginBetweenRatingIcon should be:

marginBetweenRatingIcon?: number

It's also missing:

size?: number

markrickert avatar Sep 08 '21 16:09 markrickert