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