UNPKG

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