UNPKG

2.05 kBTypeScriptView Raw
1import * as React from 'react';
2import type { AnyObject } from '../_util/type';
3import type { DropdownProps } from '../dropdown';
4import type { BreadcrumbItemProps } from './BreadcrumbItem';
5export interface BreadcrumbItemType {
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 breadcrumbName?: string;
17 menu?: BreadcrumbItemProps['menu'];
18 /** @deprecated Please use `menu` instead */
19 overlay?: React.ReactNode;
20 className?: string;
21 dropdownProps?: DropdownProps;
22 onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLSpanElement>;
23 /** @deprecated Please use `menu` instead */
24 children?: Omit<BreadcrumbItemType, 'children'>[];
25}
26export interface BreadcrumbSeparatorType {
27 type: 'separator';
28 separator?: React.ReactNode;
29}
30export type ItemType = Partial<BreadcrumbItemType & BreadcrumbSeparatorType>;
31export type InternalRouteType = Partial<BreadcrumbItemType & BreadcrumbSeparatorType>;
32export interface BreadcrumbProps<T extends AnyObject = AnyObject> {
33 prefixCls?: string;
34 params?: T;
35 separator?: React.ReactNode;
36 style?: React.CSSProperties;
37 className?: string;
38 rootClassName?: string;
39 children?: React.ReactNode;
40 /** @deprecated Please use `items` instead */
41 routes?: ItemType[];
42 items?: ItemType[];
43 itemRender?: (route: ItemType, params: T, routes: ItemType[], paths: string[]) => React.ReactNode;
44}
45declare const Breadcrumb: {
46 <T extends AnyObject = AnyObject>(props: BreadcrumbProps<T>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
47 Item: React.FC<BreadcrumbItemProps> & {
48 __ANT_BREADCRUMB_ITEM: boolean;
49 };
50 Separator: React.FC<{
51 children?: React.ReactNode;
52 }> & {
53 __ANT_BREADCRUMB_SEPARATOR: boolean;
54 };
55 displayName: string;
56};
57export default Breadcrumb;