import type { DropDownProps } from 'antd'; import type { ModalFuncProps } from 'antd/es/modal'; import type { PopconfirmProps } from 'antd/es/popconfirm'; import type { HTMLAttributes, MouseEvent, ReactNode } from 'react'; export type ActionTextStatus = 'primary' | 'success' | 'danger' | 'warning'; import type { PresetColorType } from '../helpers/colors'; import type { LinkProps } from '../router/interface'; export interface ActionTextProps extends HTMLAttributes { /** * 显示的文案 */ text?: string; /** * 内置颜色 * @default 'primary' */ status?: PresetColorType; /** * 是否禁用 */ disabled?: boolean; /** * 路由跳转 */ to?: LinkProps['to']; /** * 路由跳转 replace 模式 */ replace?: LinkProps['replace']; /** * 路由 state */ state?: LinkProps['state']; /** * 点击按钮的操作 */ action?: (e: MouseEvent) => Promise; /** * 设置按钮载入状态 * @default false */ loading?: boolean; } export interface ActionTextPopconfirmProps extends Pick, PopconfirmProps { /** * 点击按钮的操作 */ action?: (e?: MouseEvent) => Promise; } export interface ActionTextModalProps extends Pick, Omit { /** * 点击按钮的操作 */ action?: (...args: any[]) => Promise; } export interface ActionTextGroupProps { /** * 最多显示多少个, 0 就不限制 默认 3 * @default 3 */ count?: number; /** * 更多按钮的文案 * @default '···' */ moreText?: ReactNode; /** * 更多触发事件 * @default ['click'] */ trigger?: DropDownProps['trigger']; }