import React from 'react'; import { StyleProp, ViewStyle } from 'react-native'; import { StarIconProps } from './StarIcon'; type AnimationConfig = { easing?: (value: number) => number; duration?: number; delay?: number; scale?: number; }; type StarRatingProps = { /** * Rating Value. Should be between 0 and `maxStars`. */ rating: number; /** * Change listener that gets called when rating changes. */ onChange: (rating: number) => void; /** * Custom color for the filled stars. * * @default '#fdd835' */ color?: string; /** * Custom color for the empty stars. * * @default color */ emptyColor?: string; /** * Total amount of stars to display. * * @default 5 */ maxStars?: number; /** * Size of the stars. * * @default 32 */ starSize?: number; /** * Step size for the rating. * * @default 'half' */ step?: 'half' | 'quarter' | 'full'; /** * Enable swiping to rate. * * @default true */ enableSwiping?: boolean; /** * Callback that gets called when the interaction starts, before `onChange`. * * @param rating The rating value at the start of the interaction. */ onRatingStart?: (rating: number) => void; /** * Callback that gets called when the interaction ends, after `onChange`. * * @param rating The rating value at the end of the interaction. */ onRatingEnd?: (rating: number) => void; /** * Custom style for the component. */ style?: StyleProp; /** * Custom style for the star component. */ starStyle?: StyleProp; /** * Custom style for the star container. */ starContainerStyle?: StyleProp; /** * Custom animation configuration. * * @default * { * easing: Easing.elastic(2), * duration: 300, * scale: 1.2, * delay: 300 * } */ animationConfig?: AnimationConfig; /** * Custom star icon component. * * @default StarIcon */ StarIconComponent?: (props: StarIconProps) => React.JSX.Element; testID?: string; /** * The accessibility label used on the star component. If you want to include the staged star value, then * include the token, %value%, in your label. * * @default 'star rating. %value% stars. use custom actions to set rating.' */ accessibilityLabel?: string; /** * The accessibility label for the increment action. * * @default 'increment' */ accessabilityIncrementLabel?: string; /** * The accessibility label for the decrement action. * * @default 'decrement' */ accessabilityDecrementLabel?: string; /** * The accessibility label for the activate action. * * @default 'activate (default)' */ accessabilityActivateLabel?: string; /** * When the user is adjusting the amount of stars, the voiceover reads as "n stars". This property will override * that label. Use the token, %value%, in your label to specify where the staged value should go. * * @default '%value% stars' */ accessibilityAdjustmentLabel?: string; }; declare const StarRating: ({ rating, maxStars, starSize, onChange, color, emptyColor, step, enableSwiping, onRatingStart, onRatingEnd, animationConfig, style, starStyle, starContainerStyle, StarIconComponent, testID, accessibilityLabel, accessabilityIncrementLabel, accessabilityDecrementLabel, accessabilityActivateLabel, accessibilityAdjustmentLabel, }: StarRatingProps) => React.JSX.Element; export default StarRating; //# sourceMappingURL=StarRating.d.ts.map