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