1 | import * as React from "react";
|
2 | import type { TrackedPromise, InitialEntry, Location, Router as RemixRouter, To } from "@remix-run/router";
|
3 | import { Action as NavigationType } from "@remix-run/router";
|
4 | import type { IndexRouteObject, RouteMatch, RouteObject, Navigator, NonIndexRouteObject, RelativeRoutingType } from "./context";
|
5 | export interface RouterProviderProps {
|
6 | fallbackElement?: React.ReactNode;
|
7 | router: RemixRouter;
|
8 | }
|
9 |
|
10 |
|
11 |
|
12 | export declare function RouterProvider({ fallbackElement, router, }: RouterProviderProps): React.ReactElement;
|
13 | export interface MemoryRouterProps {
|
14 | basename?: string;
|
15 | children?: React.ReactNode;
|
16 | initialEntries?: InitialEntry[];
|
17 | initialIndex?: number;
|
18 | }
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | export declare function MemoryRouter({ basename, children, initialEntries, initialIndex, }: MemoryRouterProps): React.ReactElement;
|
25 | export interface NavigateProps {
|
26 | to: To;
|
27 | replace?: boolean;
|
28 | state?: any;
|
29 | relative?: RelativeRoutingType;
|
30 | }
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | export declare function Navigate({ to, replace, state, relative, }: NavigateProps): null;
|
41 | export interface OutletProps {
|
42 | context?: unknown;
|
43 | }
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 | export declare function Outlet(props: OutletProps): React.ReactElement | null;
|
50 | export interface PathRouteProps {
|
51 | caseSensitive?: NonIndexRouteObject["caseSensitive"];
|
52 | path?: NonIndexRouteObject["path"];
|
53 | id?: NonIndexRouteObject["id"];
|
54 | loader?: NonIndexRouteObject["loader"];
|
55 | action?: NonIndexRouteObject["action"];
|
56 | hasErrorBoundary?: NonIndexRouteObject["hasErrorBoundary"];
|
57 | shouldRevalidate?: NonIndexRouteObject["shouldRevalidate"];
|
58 | handle?: NonIndexRouteObject["handle"];
|
59 | index?: false;
|
60 | children?: React.ReactNode;
|
61 | element?: React.ReactNode | null;
|
62 | errorElement?: React.ReactNode | null;
|
63 | }
|
64 | export interface LayoutRouteProps extends PathRouteProps {
|
65 | }
|
66 | export interface IndexRouteProps {
|
67 | caseSensitive?: IndexRouteObject["caseSensitive"];
|
68 | path?: IndexRouteObject["path"];
|
69 | id?: IndexRouteObject["id"];
|
70 | loader?: IndexRouteObject["loader"];
|
71 | action?: IndexRouteObject["action"];
|
72 | hasErrorBoundary?: IndexRouteObject["hasErrorBoundary"];
|
73 | shouldRevalidate?: IndexRouteObject["shouldRevalidate"];
|
74 | handle?: IndexRouteObject["handle"];
|
75 | index: true;
|
76 | children?: undefined;
|
77 | element?: React.ReactNode | null;
|
78 | errorElement?: React.ReactNode | null;
|
79 | }
|
80 | export declare type RouteProps = PathRouteProps | LayoutRouteProps | IndexRouteProps;
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | export declare function Route(_props: RouteProps): React.ReactElement | null;
|
87 | export interface RouterProps {
|
88 | basename?: string;
|
89 | children?: React.ReactNode;
|
90 | location: Partial<Location> | string;
|
91 | navigationType?: NavigationType;
|
92 | navigator: Navigator;
|
93 | static?: boolean;
|
94 | }
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 | export declare function Router({ basename: basenameProp, children, location: locationProp, navigationType, navigator, static: staticProp, }: RouterProps): React.ReactElement | null;
|
105 | export interface RoutesProps {
|
106 | children?: React.ReactNode;
|
107 | location?: Partial<Location> | string;
|
108 | }
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | export declare function Routes({ children, location, }: RoutesProps): React.ReactElement | null;
|
116 | export interface AwaitResolveRenderFunction {
|
117 | (data: Awaited<any>): React.ReactElement;
|
118 | }
|
119 | export interface AwaitProps {
|
120 | children: React.ReactNode | AwaitResolveRenderFunction;
|
121 | errorElement?: React.ReactNode;
|
122 | resolve: TrackedPromise | any;
|
123 | }
|
124 |
|
125 |
|
126 |
|
127 |
|
128 | export declare function Await({ children, errorElement, resolve }: AwaitProps): JSX.Element;
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 | export declare function createRoutesFromChildren(children: React.ReactNode, parentPath?: number[]): RouteObject[];
|
137 |
|
138 |
|
139 |
|
140 | export declare function renderMatches(matches: RouteMatch[] | null): React.ReactElement | null;
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 | export declare function enhanceManualRouteObjects(routes: RouteObject[]): RouteObject[];
|