| 1 | import * as React from "react";
|
| 2 | import type { AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, AgnosticRouteMatch, History, LazyRouteFunction, Location, Action as NavigationType, RelativeRoutingType, Router, StaticHandlerContext, To, TrackedPromise } from "@remix-run/router";
|
| 3 | export interface IndexRouteObject {
|
| 4 | caseSensitive?: AgnosticIndexRouteObject["caseSensitive"];
|
| 5 | path?: AgnosticIndexRouteObject["path"];
|
| 6 | id?: AgnosticIndexRouteObject["id"];
|
| 7 | loader?: AgnosticIndexRouteObject["loader"];
|
| 8 | action?: AgnosticIndexRouteObject["action"];
|
| 9 | hasErrorBoundary?: AgnosticIndexRouteObject["hasErrorBoundary"];
|
| 10 | shouldRevalidate?: AgnosticIndexRouteObject["shouldRevalidate"];
|
| 11 | handle?: AgnosticIndexRouteObject["handle"];
|
| 12 | index: true;
|
| 13 | children?: undefined;
|
| 14 | element?: React.ReactNode | null;
|
| 15 | errorElement?: React.ReactNode | null;
|
| 16 | Component?: React.ComponentType | null;
|
| 17 | ErrorBoundary?: React.ComponentType | null;
|
| 18 | lazy?: LazyRouteFunction<RouteObject>;
|
| 19 | }
|
| 20 | export interface NonIndexRouteObject {
|
| 21 | caseSensitive?: AgnosticNonIndexRouteObject["caseSensitive"];
|
| 22 | path?: AgnosticNonIndexRouteObject["path"];
|
| 23 | id?: AgnosticNonIndexRouteObject["id"];
|
| 24 | loader?: AgnosticNonIndexRouteObject["loader"];
|
| 25 | action?: AgnosticNonIndexRouteObject["action"];
|
| 26 | hasErrorBoundary?: AgnosticNonIndexRouteObject["hasErrorBoundary"];
|
| 27 | shouldRevalidate?: AgnosticNonIndexRouteObject["shouldRevalidate"];
|
| 28 | handle?: AgnosticNonIndexRouteObject["handle"];
|
| 29 | index?: false;
|
| 30 | children?: RouteObject[];
|
| 31 | element?: React.ReactNode | null;
|
| 32 | errorElement?: React.ReactNode | null;
|
| 33 | Component?: React.ComponentType | null;
|
| 34 | ErrorBoundary?: React.ComponentType | null;
|
| 35 | lazy?: LazyRouteFunction<RouteObject>;
|
| 36 | }
|
| 37 | export type RouteObject = IndexRouteObject | NonIndexRouteObject;
|
| 38 | export type DataRouteObject = RouteObject & {
|
| 39 | children?: DataRouteObject[];
|
| 40 | id: string;
|
| 41 | };
|
| 42 | export interface RouteMatch<ParamKey extends string = string, RouteObjectType extends RouteObject = RouteObject> extends AgnosticRouteMatch<ParamKey, RouteObjectType> {
|
| 43 | }
|
| 44 | export interface DataRouteMatch extends RouteMatch<string, DataRouteObject> {
|
| 45 | }
|
| 46 | export interface DataRouterContextObject extends NavigationContextObject {
|
| 47 | router: Router;
|
| 48 | staticContext?: StaticHandlerContext;
|
| 49 | }
|
| 50 | export declare const DataRouterContext: React.Context<DataRouterContextObject | null>;
|
| 51 | export declare const DataRouterStateContext: React.Context<import("@remix-run/router").RouterState | null>;
|
| 52 | export declare const AwaitContext: React.Context<TrackedPromise | null>;
|
| 53 | export interface NavigateOptions {
|
| 54 | replace?: boolean;
|
| 55 | state?: any;
|
| 56 | preventScrollReset?: boolean;
|
| 57 | relative?: RelativeRoutingType;
|
| 58 | unstable_flushSync?: boolean;
|
| 59 | unstable_viewTransition?: boolean;
|
| 60 | }
|
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 |
|
| 70 | export interface Navigator {
|
| 71 | createHref: History["createHref"];
|
| 72 | encodeLocation?: History["encodeLocation"];
|
| 73 | go: History["go"];
|
| 74 | push(to: To, state?: any, opts?: NavigateOptions): void;
|
| 75 | replace(to: To, state?: any, opts?: NavigateOptions): void;
|
| 76 | }
|
| 77 | interface NavigationContextObject {
|
| 78 | basename: string;
|
| 79 | navigator: Navigator;
|
| 80 | static: boolean;
|
| 81 | }
|
| 82 | export declare const NavigationContext: React.Context<NavigationContextObject>;
|
| 83 | interface LocationContextObject {
|
| 84 | location: Location;
|
| 85 | navigationType: NavigationType;
|
| 86 | }
|
| 87 | export declare const LocationContext: React.Context<LocationContextObject>;
|
| 88 | export interface RouteContextObject {
|
| 89 | outlet: React.ReactElement | null;
|
| 90 | matches: RouteMatch[];
|
| 91 | isDataRoute: boolean;
|
| 92 | }
|
| 93 | export declare const RouteContext: React.Context<RouteContextObject>;
|
| 94 | export declare const RouteErrorContext: React.Context<any>;
|
| 95 | export {};
|