UNPKG

acud

Version:

acg react 组件库

44 lines (43 loc) • 1.59 kB
/** * @file * @author dailin01 */ import React from 'react'; import ButtonGroup from './button-group'; import { SizeType } from '../config-provider/SizeContext'; declare const ButtonTypes: ["default", "primary", "text", "highlight", "enhance", "actiontext"]; export type ButtonType = typeof ButtonTypes[number]; declare const ButtonShapes: ["circle", "round"]; export type ButtonShape = typeof ButtonShapes[number]; declare const ButtonHTMLTypes: ["submit", "button", "reset"]; export type ButtonHTMLType = typeof ButtonHTMLTypes[number]; export interface BaseButtonProps { type?: ButtonType; icon?: React.ReactNode; shape?: ButtonShape; size?: SizeType; loading?: boolean | { delay?: number; }; prefixCls?: string; className?: string; style?: React.CSSProperties; block?: boolean; children?: React.ReactNode; } export type AnchorButtonProps = { href: string; target?: string; onClick?: React.MouseEventHandler<HTMLElement>; } & BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, 'type' | 'onClick'>; export type NativeButtonProps = { htmlType?: ButtonHTMLType; onClick?: React.MouseEventHandler<HTMLElement>; } & BaseButtonProps & Omit<React.ButtonHTMLAttributes<any>, 'type' | 'onClick'>; export type ButtonProps = Partial<AnchorButtonProps & NativeButtonProps>; interface CompoundedComponent extends React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>> { Group: typeof ButtonGroup; __ACUD_BUTTON: boolean; } declare const Button: CompoundedComponent; export default Button;