UNPKG

antd

Version:

An enterprise-class UI design language and React components implementation

38 lines (37 loc) 1.45 kB
import * as React from 'react'; import Group from './button-group'; import type { ButtonType, ButtonHTMLType, ButtonShape } from './buttonHelpers'; import type { SizeType } from '../config-provider/SizeContext'; export type LegacyButtonType = ButtonType | 'danger'; export declare function convertLegacyProps(type?: LegacyButtonType): ButtonProps; export interface BaseButtonProps { type?: ButtonType; icon?: React.ReactNode; shape?: ButtonShape; size?: SizeType; disabled?: boolean; loading?: boolean | { delay?: number; }; prefixCls?: string; className?: string; ghost?: boolean; danger?: boolean; block?: boolean; children?: React.ReactNode; } export type AnchorButtonProps = { href: string; target?: string; onClick?: React.MouseEventHandler<HTMLAnchorElement>; } & BaseButtonProps & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, 'type' | 'onClick'>; export type NativeButtonProps = { htmlType?: ButtonHTMLType; onClick?: React.MouseEventHandler<HTMLButtonElement>; } & BaseButtonProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'onClick'>; export type ButtonProps = Partial<AnchorButtonProps & NativeButtonProps>; type CompoundedComponent = React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>> & { Group: typeof Group; }; declare const Button: CompoundedComponent; export default Button;