import React, { ReactNode, CSSProperties, ComponentType, ButtonHTMLAttributes } from 'react'; import { ComponentSize } from '../ConfigProvider'; import { WithRef } from '../utils/type'; export declare type ButtonType = 'primary' | 'reverse' | 'default' | 'secondary' | 'link' | 'text' | 'dashed'; export declare type ButtonHtmlType = 'button' | 'submit' | 'reset'; export interface ButtonProps { /** * 类型 * * @default 'default' */ type?: ButtonType; /** * 是否告警按钮 * * @description 该属性对 type 为 default 和 reverse 无效 * @default false */ danger?: boolean; /** * 图标 * * @description 该按钮会出现在文字前面 */ icon?: ReactNode; /** * 图标 * * @description 该按钮会出现在文字后面 */ endIcon?: ReactNode; /** * 原生 button 标签的 type 属性 * * @description 可选属性 'button', 'submit', 'reset' * @default 'button' */ htmlType?: ButtonHtmlType; /** * 按钮大小 * * @default 'default' */ size?: ComponentSize; /** * 是否显示 loading 状态 */ loading?: boolean; onClick?(event: React.MouseEvent): void; disabled?: boolean; className?: string; style?: CSSProperties; children?: ReactNode; /** 指定组件实现替换 HTML button */ as?: ComponentType>; /** * 根元素的 html 属性 */ rootHtmlProps?: WithRef, T>; } export default function Button(props: ButtonProps): React.ReactElement, string | ((props: any) => React.ReactElement | null) | (new (props: any) => React.Component)>;