import { PopconfirmProps } from 'antd'; import type { TooltipProps, TooltipPropsWithOverlay } from 'antd/lib/tooltip'; import { HTMLAttributes, ReactNode } from 'react'; export interface IconfontCommonType extends HTMLAttributes { /** icon类名(取自iconfont) */ icon: string; /** tooltip提示文字 */ tip?: ReactNode; /** 字体大小 */ fontSize?: string | number; /** 是否禁用 */ disabled?: boolean; /** 自定义类名 */ className?: string; /** 加载状态 */ loading?: boolean; /** tooltip配置 */ tooltipProps?: TooltipProps; /** popConfirm配置 */ popConfirmProps?: PopconfirmProps; /** 自定义图标字体库的字体名称,类似iconfont库默认的`iconfont` */ iconFontFamily?: string; } export interface IconfontNormalType extends Pick, 'style'>, IconfontCommonType, Partial> { /** 按钮类型(为delete时会出现删除提示框) */ type?: 'normal'; onClick?: HTMLAttributes['onClick']; } export interface IconfontDeleteType extends Pick, 'style'>, IconfontCommonType, Partial> { /** 按钮类型(为delete时会出现删除提示框) */ type?: 'confirm'; /** type为delete时确定按钮点击事件 */ onConfirm: () => void; } export type IconFontType = IconfontNormalType | IconfontDeleteType;