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 { RouteMatch, RouteObject, Navigator, 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 | interface DataRouteProps {
|
51 | id?: RouteObject["id"];
|
52 | loader?: RouteObject["loader"];
|
53 | action?: RouteObject["action"];
|
54 | errorElement?: RouteObject["errorElement"];
|
55 | shouldRevalidate?: RouteObject["shouldRevalidate"];
|
56 | handle?: RouteObject["handle"];
|
57 | }
|
58 | export interface RouteProps extends DataRouteProps {
|
59 | caseSensitive?: boolean;
|
60 | children?: React.ReactNode;
|
61 | element?: React.ReactNode | null;
|
62 | index?: boolean;
|
63 | path?: string;
|
64 | }
|
65 | export interface PathRouteProps extends DataRouteProps {
|
66 | caseSensitive?: boolean;
|
67 | children?: React.ReactNode;
|
68 | element?: React.ReactNode | null;
|
69 | index?: false;
|
70 | path: string;
|
71 | }
|
72 | export interface LayoutRouteProps extends DataRouteProps {
|
73 | children?: React.ReactNode;
|
74 | element?: React.ReactNode | null;
|
75 | }
|
76 | export interface IndexRouteProps extends DataRouteProps {
|
77 | element?: React.ReactNode | null;
|
78 | index: true;
|
79 | }
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | export declare function Route(_props: PathRouteProps | LayoutRouteProps | IndexRouteProps): React.ReactElement | null;
|
86 | export interface RouterProps {
|
87 | basename?: string;
|
88 | children?: React.ReactNode;
|
89 | location: Partial<Location> | string;
|
90 | navigationType?: NavigationType;
|
91 | navigator: Navigator;
|
92 | static?: boolean;
|
93 | }
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 | export declare function Router({ basename: basenameProp, children, location: locationProp, navigationType, navigator, static: staticProp, }: RouterProps): React.ReactElement | null;
|
104 | export interface RoutesProps {
|
105 | children?: React.ReactNode;
|
106 | location?: Partial<Location> | string;
|
107 | }
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 | export declare function Routes({ children, location, }: RoutesProps): React.ReactElement | null;
|
115 | export interface AwaitResolveRenderFunction {
|
116 | (data: Awaited<any>): React.ReactElement;
|
117 | }
|
118 | export interface AwaitProps {
|
119 | children: React.ReactNode | AwaitResolveRenderFunction;
|
120 | errorElement?: React.ReactNode;
|
121 | resolve: TrackedPromise | any;
|
122 | }
|
123 |
|
124 |
|
125 |
|
126 |
|
127 | export declare function Await({ children, errorElement, resolve }: AwaitProps): JSX.Element;
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 | export declare function createRoutesFromChildren(children: React.ReactNode, parentPath?: number[]): RouteObject[];
|
136 |
|
137 |
|
138 |
|
139 | export declare function renderMatches(matches: RouteMatch[] | null): React.ReactElement | null;
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 | export declare function enhanceManualRouteObjects(routes: RouteObject[]): RouteObject[];
|
146 | export {};
|