@uiw/react-native
Version:
UIW for React Native
37 lines (36 loc) • 1.03 kB
TypeScript
import React from 'react';
import { IconsName } from '../Icon';
import { TabsItemIconTypes } from '../Tabs/TabsItem';
export declare type icoType = [TabsItemIconTypes, TabsItemIconTypes];
export interface RatingProps {
/** 默认选中几个 */
defaultRating?: number;
/** 总数*/
resultRating?: number;
/** icon 大小 */
size?: number;
/** icon 颜色 */
color?: string;
/** [未选中, 已选中] */
icon?: icoType;
/**
* void
* @param score type: number 得到几分
*/
onPress?: (score: number) => void;
}
export interface RatingState {
icon: Array<IconsName | React.ReactElement | React.ReactNode>;
resultRating: number;
size: number;
color: string;
defaultRating: number;
typeIcon: icoType;
}
export default class Rating extends React.Component<RatingProps, RatingState> {
constructor(props: RatingProps);
componentDidMount(): void;
flag: boolean;
updateIcon: (index: number) => void;
render(): JSX.Element;
}