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