UNPKG

@fruits-chain/icons-react-native

Version:
53 lines (52 loc) 1.75 kB
import React from 'react'; import type { TouchableWithoutFeedbackProps, ViewProps, ColorValue } from 'react-native'; import type { SvgProps } from 'react-native-svg/lib/typescript/elements/Svg'; export interface IconCommonProps extends SvgProps { /** * 图标大小 * @default 24 */ size?: number; /** * 图片颜色 * @default '#5A6068' */ color?: ColorValue; /** * Outline 的路径宽 */ strokeWidth?: number; /** * svg 内部的样式 */ svgStyle?: ViewProps['style']; /** * 可点击的范围大小 * @default 44 */ touchableSize?: number; } export type IconOutlineProps = IconCommonProps; export type IconFillProps = Omit<IconCommonProps, 'strokeWidth'>; export type IconColoursProps = Omit<IconCommonProps, 'color'>; type IconRender = (config: { size: number; color?: ColorValue; strokeWidth?: number; }, props: ViewProps) => React.ReactElement; /** * 挑选出点击事件的属性 */ export declare const pickTouchablePropsField: (props: Partial<ViewProps & TouchableWithoutFeedbackProps>) => Pick<Partial<ViewProps & TouchableWithoutFeedbackProps>, keyof TouchableWithoutFeedbackProps>; /** * 排除点击事件的属性 */ export declare const omitTouchablePropsField: (props: ViewProps) => Partial<ViewProps>; /** * 生成一个 Outline 类型的 icon 组件 */ export declare const genIcon: (render: IconRender) => React.FC<IconCommonProps>; export declare const genFillIcon: (render: IconRender) => React.FC<IconFillProps>; export declare const genOutlineIcon: (render: IconRender) => React.FC<IconOutlineProps>; export declare const genColoursIcon: (render: IconRender) => React.FC<IconColoursProps>; export {};