Breadcrumb.d.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import * as React from 'react';
  2. import type { AnyObject } from '../_util/type';
  3. import type { DropdownProps } from '../dropdown';
  4. import type { BreadcrumbItemProps } from './BreadcrumbItem';
  5. export interface BreadcrumbItemType extends React.AriaAttributes {
  6. key?: React.Key;
  7. /**
  8. * Different with `path`. Directly set the link of this item.
  9. */
  10. href?: string;
  11. /**
  12. * Different with `href`. It will concat all prev `path` to the current one.
  13. */
  14. path?: string;
  15. title?: React.ReactNode;
  16. /** @deprecated Please use `title` instead */
  17. breadcrumbName?: string;
  18. menu?: BreadcrumbItemProps['menu'];
  19. /** @deprecated Please use `menu` instead */
  20. overlay?: React.ReactNode;
  21. className?: string;
  22. dropdownProps?: DropdownProps;
  23. onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLSpanElement>;
  24. /** @deprecated Please use `menu` instead */
  25. children?: Omit<BreadcrumbItemType, 'children'>[];
  26. [key: `data-${string}`]: string;
  27. }
  28. export interface BreadcrumbSeparatorType {
  29. type: 'separator';
  30. separator?: React.ReactNode;
  31. }
  32. export type ItemType = Partial<BreadcrumbItemType & BreadcrumbSeparatorType>;
  33. export type InternalRouteType = Partial<BreadcrumbItemType & BreadcrumbSeparatorType>;
  34. export interface BreadcrumbProps<T extends AnyObject = AnyObject> {
  35. prefixCls?: string;
  36. params?: T;
  37. separator?: React.ReactNode;
  38. style?: React.CSSProperties;
  39. className?: string;
  40. rootClassName?: string;
  41. children?: React.ReactNode;
  42. /** @deprecated Please use `items` instead */
  43. routes?: ItemType[];
  44. items?: ItemType[];
  45. itemRender?: (route: ItemType, params: T, routes: ItemType[], paths: string[]) => React.ReactNode;
  46. }
  47. declare const Breadcrumb: {
  48. <T extends AnyObject = AnyObject>(props: BreadcrumbProps<T>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
  49. Item: React.FC<BreadcrumbItemProps> & {
  50. __ANT_BREADCRUMB_ITEM: boolean;
  51. };
  52. Separator: React.FC<{
  53. children?: React.ReactNode | undefined;
  54. }> & {
  55. __ANT_BREADCRUMB_SEPARATOR: boolean;
  56. };
  57. displayName: string;
  58. };
  59. export default Breadcrumb;