UNPKG

1.78 kBTypeScriptView Raw
1import type * as H from 'history';
2import type { RouteComponentProps as BasicRouteProps, match } from 'react-router-dom';
3import type React from 'react';
4export declare type LinkProps = {
5 to: H.LocationDescriptor;
6 replace?: boolean;
7 innerRef?: React.Ref<HTMLAnchorElement>;
8} & React.AnchorHTMLAttributes<HTMLAnchorElement>;
9export declare type MenuDataItem = {
10 /** @name 子菜单 */
11 children?: MenuDataItem[];
12 /** @name 在菜单中隐藏子节点 */
13 hideChildrenInMenu?: boolean;
14 /** @name 在菜单中隐藏自己和子节点 */
15 hideInMenu?: boolean;
16 /** @name 菜单的icon */
17 icon?: React.ReactNode;
18 /** @name 自定义菜单的国际化 key */
19 locale?: string | false;
20 /** @name 菜单的名字 */
21 name?: string;
22 /** @name 用于标定选中的值,默认是 path */
23 key?: string;
24 /** @name disable 菜单选项 */
25 disabled?: boolean;
26 /** @name 路径,可以设定为网页链接 */
27 path?: string;
28 /**
29 * 当此节点被选中的时候也会选中 parentKeys 的节点
30 *
31 * @name 自定义父节点
32 */
33 parentKeys?: string[];
34 /** @name 隐藏自己,并且将子节点提升到与自己平级 */
35 flatMenu?: boolean;
36 /** @name 指定外链打开形式,同a标签 */
37 target?: string;
38 [key: string]: any;
39};
40export declare type Route = {
41 routes?: Route[];
42} & MenuDataItem;
43export declare type WithFalse<T> = T | false;
44export declare type RouterTypes<P> = {
45 computedMatch?: match<P>;
46 route?: Route;
47 location: BasicRouteProps['location'] | {
48 pathname?: string;
49 };
50} & Omit<BasicRouteProps, 'location'>;
51export declare type MessageDescriptor = {
52 id: any;
53 description?: string;
54 defaultMessage?: string;
55};