1 | import * as React from "react";
|
2 | import type { AgnosticRouteMatch, AgnosticIndexRouteObject, AgnosticNonIndexRouteObject, History, Location, Router, StaticHandlerContext, To, TrackedPromise, LazyRouteFunction } 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 | Component?: React.ComponentType | null;
|
18 | ErrorBoundary?: React.ComponentType | null;
|
19 | lazy?: LazyRouteFunction<IndexRouteObject>;
|
20 | }
|
21 | export interface NonIndexRouteObject {
|
22 | caseSensitive?: AgnosticNonIndexRouteObject["caseSensitive"];
|
23 | path?: AgnosticNonIndexRouteObject["path"];
|
24 | id?: AgnosticNonIndexRouteObject["id"];
|
25 | loader?: AgnosticNonIndexRouteObject["loader"];
|
26 | action?: AgnosticNonIndexRouteObject["action"];
|
27 | hasErrorBoundary?: AgnosticNonIndexRouteObject["hasErrorBoundary"];
|
28 | shouldRevalidate?: AgnosticNonIndexRouteObject["shouldRevalidate"];
|
29 | handle?: AgnosticNonIndexRouteObject["handle"];
|
30 | index?: false;
|
31 | children?: RouteObject[];
|
32 | element?: React.ReactNode | null;
|
33 | errorElement?: React.ReactNode | null;
|
34 | Component?: React.ComponentType | null;
|
35 | ErrorBoundary?: React.ComponentType | null;
|
36 | lazy?: LazyRouteFunction<NonIndexRouteObject>;
|
37 | }
|
38 | export declare type RouteObject = IndexRouteObject | NonIndexRouteObject;
|
39 | export declare type DataRouteObject = RouteObject & {
|
40 | children?: DataRouteObject[];
|
41 | id: string;
|
42 | };
|
43 | export interface RouteMatch<ParamKey extends string = string, RouteObjectType extends RouteObject = RouteObject> extends AgnosticRouteMatch<ParamKey, RouteObjectType> {
|
44 | }
|
45 | export interface DataRouteMatch extends RouteMatch<string, DataRouteObject> {
|
46 | }
|
47 | export interface DataRouterContextObject extends NavigationContextObject {
|
48 | router: Router;
|
49 | staticContext?: StaticHandlerContext;
|
50 | }
|
51 | export declare const DataRouterContext: React.Context<DataRouterContextObject | null>;
|
52 | export declare const DataRouterStateContext: React.Context<import("@remix-run/router").RouterState | null>;
|
53 | export declare const AwaitContext: React.Context<TrackedPromise | null>;
|
54 | export declare type RelativeRoutingType = "route" | "path";
|
55 | export interface NavigateOptions {
|
56 | replace?: boolean;
|
57 | state?: any;
|
58 | preventScrollReset?: boolean;
|
59 | relative?: RelativeRoutingType;
|
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 | }
|
92 | export declare const RouteContext: React.Context<RouteContextObject>;
|
93 | export declare const RouteErrorContext: React.Context<any>;
|
94 | export {};
|