UNPKG

2.3 kBTypeScriptView Raw
1import type React from 'react';
2import type { BadgeProps } from '../badge';
3import type { TooltipProps } from '../tooltip';
4import type BackTop from './BackTop';
5import type Group from './FloatButtonGroup';
6import type PurePanel from './PurePanel';
7export type FloatButtonElement = HTMLAnchorElement & HTMLButtonElement;
8export interface FloatButtonRef {
9 nativeElement: FloatButtonElement | null;
10}
11export type FloatButtonType = 'default' | 'primary';
12export type FloatButtonShape = 'circle' | 'square';
13export type FloatButtonGroupTrigger = 'click' | 'hover';
14export type FloatButtonBadgeProps = Omit<BadgeProps, 'status' | 'text' | 'title' | 'children'>;
15export interface FloatButtonProps extends React.DOMAttributes<FloatButtonElement> {
16 prefixCls?: string;
17 className?: string;
18 rootClassName?: string;
19 style?: React.CSSProperties;
20 icon?: React.ReactNode;
21 description?: React.ReactNode;
22 type?: FloatButtonType;
23 shape?: FloatButtonShape;
24 tooltip?: TooltipProps['title'];
25 href?: string;
26 target?: React.HTMLAttributeAnchorTarget;
27 badge?: FloatButtonBadgeProps;
28 ['aria-label']?: React.HtmlHTMLAttributes<HTMLElement>['aria-label'];
29}
30export interface FloatButtonContentProps extends React.DOMAttributes<HTMLDivElement> {
31 className?: string;
32 icon?: FloatButtonProps['icon'];
33 description?: FloatButtonProps['description'];
34 prefixCls: FloatButtonProps['prefixCls'];
35}
36export interface FloatButtonGroupProps extends FloatButtonProps {
37 children: React.ReactNode;
38 trigger?: FloatButtonGroupTrigger;
39 open?: boolean;
40 closeIcon?: React.ReactNode;
41 onOpenChange?: (open: boolean) => void;
42}
43export interface BackTopProps extends Omit<FloatButtonProps, 'target'> {
44 visibilityHeight?: number;
45 onClick?: React.MouseEventHandler<FloatButtonElement>;
46 target?: () => HTMLElement | Window | Document;
47 prefixCls?: string;
48 children?: React.ReactNode;
49 className?: string;
50 rootClassName?: string;
51 style?: React.CSSProperties;
52 duration?: number;
53}
54export type CompoundedComponent = React.ForwardRefExoticComponent<FloatButtonProps & React.RefAttributes<FloatButtonElement>> & {
55 Group: typeof Group;
56 BackTop: typeof BackTop;
57 _InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
58};