index.d.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import * as React from 'react';
  2. import type { PresetStatusColorType } from '../_util/colors';
  3. import type { LiteralUnion } from '../_util/type';
  4. import type { PresetColorKey } from '../theme/internal';
  5. import Ribbon from './Ribbon';
  6. export type { ScrollNumberProps } from './ScrollNumber';
  7. type SemanticName = 'root' | 'indicator';
  8. export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
  9. /** Number to show in badge */
  10. count?: React.ReactNode;
  11. showZero?: boolean;
  12. /** Max count to show */
  13. overflowCount?: number;
  14. /** Whether to show red dot without number */
  15. dot?: boolean;
  16. style?: React.CSSProperties;
  17. prefixCls?: string;
  18. scrollNumberPrefixCls?: string;
  19. className?: string;
  20. rootClassName?: string;
  21. status?: PresetStatusColorType;
  22. color?: LiteralUnion<PresetColorKey>;
  23. text?: React.ReactNode;
  24. size?: 'default' | 'small';
  25. offset?: [number | string, number | string];
  26. title?: string;
  27. children?: React.ReactNode;
  28. classNames?: Partial<Record<SemanticName, string>>;
  29. styles?: Partial<Record<SemanticName, React.CSSProperties>>;
  30. }
  31. declare const InternalBadge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
  32. type CompoundedComponent = typeof InternalBadge & {
  33. Ribbon: typeof Ribbon;
  34. };
  35. declare const Badge: CompoundedComponent;
  36. export default Badge;