interface.d.ts 2.1 KB

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