1 | import * as React from "react";
|
2 | import type { InitialEntry, Location, To } from "history";
|
3 | import { Action as NavigationType } from "history";
|
4 | import { Navigator } from "./context";
|
5 | import type { RouteMatch, RouteObject } from "./router";
|
6 | export interface MemoryRouterProps {
|
7 | basename?: string;
|
8 | children?: React.ReactNode;
|
9 | initialEntries?: InitialEntry[];
|
10 | initialIndex?: number;
|
11 | }
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export declare function MemoryRouter({ basename, children, initialEntries, initialIndex, }: MemoryRouterProps): React.ReactElement;
|
18 | export interface NavigateProps {
|
19 | to: To;
|
20 | replace?: boolean;
|
21 | state?: any;
|
22 | }
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | export declare function Navigate({ to, replace, state }: NavigateProps): null;
|
33 | export interface OutletProps {
|
34 | context?: unknown;
|
35 | }
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | export declare function Outlet(props: OutletProps): React.ReactElement | null;
|
42 | export interface RouteProps {
|
43 | caseSensitive?: boolean;
|
44 | children?: React.ReactNode;
|
45 | element?: React.ReactNode | null;
|
46 | index?: boolean;
|
47 | path?: string;
|
48 | }
|
49 | export interface PathRouteProps {
|
50 | caseSensitive?: boolean;
|
51 | children?: React.ReactNode;
|
52 | element?: React.ReactNode | null;
|
53 | index?: false;
|
54 | path: string;
|
55 | }
|
56 | export interface LayoutRouteProps {
|
57 | children?: React.ReactNode;
|
58 | element?: React.ReactNode | null;
|
59 | }
|
60 | export interface IndexRouteProps {
|
61 | element?: React.ReactNode | null;
|
62 | index: true;
|
63 | }
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | export declare function Route(_props: PathRouteProps | LayoutRouteProps | IndexRouteProps): React.ReactElement | null;
|
70 | export interface RouterProps {
|
71 | basename?: string;
|
72 | children?: React.ReactNode;
|
73 | location: Partial<Location> | string;
|
74 | navigationType?: NavigationType;
|
75 | navigator: Navigator;
|
76 | static?: boolean;
|
77 | }
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 | export declare function Router({ basename: basenameProp, children, location: locationProp, navigationType, navigator, static: staticProp, }: RouterProps): React.ReactElement | null;
|
88 | export interface RoutesProps {
|
89 | children?: React.ReactNode;
|
90 | location?: Partial<Location> | string;
|
91 | }
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 | export declare function Routes({ children, location, }: RoutesProps): React.ReactElement | null;
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 | export declare function createRoutesFromChildren(children: React.ReactNode): RouteObject[];
|
107 |
|
108 |
|
109 |
|
110 | export declare function renderMatches(matches: RouteMatch[] | null): React.ReactElement | null;
|