1 | import type * as H from 'history';
|
2 | import type React from 'react';
|
3 | export interface StaticContext {
|
4 | statusCode?: number | undefined;
|
5 | }
|
6 | export interface BasicRouteProps<Params extends {
|
7 | [K in keyof Params]?: string;
|
8 | } = Record<string, any>, C extends StaticContext = StaticContext, S = H.LocationState> {
|
9 | history: H.History<S>;
|
10 | location: H.Location<S>;
|
11 | match: match<Params>;
|
12 | staticContext?: C | undefined;
|
13 | }
|
14 | export interface match<Params extends {
|
15 | [K in keyof Params]?: string;
|
16 | } = Record<string, any>> {
|
17 | params: Params;
|
18 | isExact: boolean;
|
19 | path: string;
|
20 | url: string;
|
21 | }
|
22 | export type LinkProps = {
|
23 | to: H.LocationDescriptor;
|
24 | replace?: boolean;
|
25 | innerRef?: React.Ref<HTMLAnchorElement>;
|
26 | } & React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
27 | export type MenuDataItem = {
|
28 |
|
29 | children?: MenuDataItem[];
|
30 | routes?: undefined;
|
31 |
|
32 | hideChildrenInMenu?: boolean;
|
33 |
|
34 | hideInMenu?: boolean;
|
35 |
|
36 | icon?: React.ReactNode;
|
37 |
|
38 | locale?: string | false;
|
39 |
|
40 | name?: string;
|
41 |
|
42 | key?: string;
|
43 |
|
44 | disabled?: boolean;
|
45 |
|
46 | path?: string;
|
47 | |
48 |
|
49 |
|
50 |
|
51 |
|
52 | parentKeys?: string[];
|
53 |
|
54 | flatMenu?: boolean;
|
55 |
|
56 | target?: string;
|
57 | |
58 |
|
59 |
|
60 | tooltip?: string;
|
61 | [key: string]: any;
|
62 | };
|
63 | export type Route = Omit<MenuDataItem, 'routes'> & {
|
64 | children?: Route[];
|
65 | };
|
66 | export type WithFalse<T> = T | false;
|
67 | export type RouterTypes = {
|
68 | computedMatch?: match<any>;
|
69 | route?: Route;
|
70 | location: BasicRouteProps['location'] | {
|
71 | pathname?: string;
|
72 | };
|
73 | } & Omit<BasicRouteProps, 'location'>;
|
74 | export type MessageDescriptor = {
|
75 | id: any;
|
76 | description?: string;
|
77 | defaultMessage?: string;
|
78 | };
|