1 | import * as React from 'react';
|
2 | import Group from './button-group';
|
3 | import { Omit } from '../_util/type';
|
4 | import { SizeType } from '../config-provider/SizeContext';
|
5 | declare const ButtonTypes: ["default", "primary", "ghost", "dashed", "link", "text"];
|
6 | export declare type ButtonType = typeof ButtonTypes[number];
|
7 | declare const ButtonShapes: ["circle", "round"];
|
8 | export declare type ButtonShape = typeof ButtonShapes[number];
|
9 | declare const ButtonHTMLTypes: ["submit", "button", "reset"];
|
10 | export declare type ButtonHTMLType = typeof ButtonHTMLTypes[number];
|
11 | export declare type LegacyButtonType = ButtonType | 'danger';
|
12 | export declare function convertLegacyProps(type?: LegacyButtonType): ButtonProps;
|
13 | export interface BaseButtonProps {
|
14 | type?: ButtonType;
|
15 | icon?: React.ReactNode;
|
16 | shape?: ButtonShape;
|
17 | size?: SizeType;
|
18 | loading?: boolean | {
|
19 | delay?: number;
|
20 | };
|
21 | prefixCls?: string;
|
22 | className?: string;
|
23 | ghost?: boolean;
|
24 | danger?: boolean;
|
25 | block?: boolean;
|
26 | children?: React.ReactNode;
|
27 | }
|
28 | export declare type AnchorButtonProps = {
|
29 | href: string;
|
30 | target?: string;
|
31 | onClick?: React.MouseEventHandler<HTMLElement>;
|
32 | } & BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, 'type' | 'onClick'>;
|
33 | export declare type NativeButtonProps = {
|
34 | htmlType?: ButtonHTMLType;
|
35 | onClick?: React.MouseEventHandler<HTMLElement>;
|
36 | } & BaseButtonProps & Omit<React.ButtonHTMLAttributes<any>, 'type' | 'onClick'>;
|
37 | export declare type ButtonProps = Partial<AnchorButtonProps & NativeButtonProps>;
|
38 | interface CompoundedComponent extends React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>> {
|
39 | Group: typeof Group;
|
40 | __ANT_BUTTON: boolean;
|
41 | }
|
42 | declare const Button: CompoundedComponent;
|
43 | export default Button;
|