| 1 |
|
| 2 | import { Action, History, Location, To } from "./router/history.js";
|
| 3 | import { RouteMatch, TrackedPromise } from "./router/utils.js";
|
| 4 | import { RelativeRoutingType, Router, StaticHandlerContext } from "./router/router.js";
|
| 5 | import { ClientOnErrorFunction } from "./components.js";
|
| 6 | import * as React$1 from "react";
|
| 7 |
|
| 8 |
|
| 9 | interface DataRouterContextObject extends Omit<NavigationContextObject, "future" | "useTransitions"> {
|
| 10 | router: Router;
|
| 11 | staticContext?: StaticHandlerContext;
|
| 12 | onError?: ClientOnErrorFunction;
|
| 13 | }
|
| 14 | declare const DataRouterContext: React$1.Context<DataRouterContextObject | null>;
|
| 15 | type DataRouterDataContextObject = Pick<Router["state"], "loaderData" | "actionData" | "errors">;
|
| 16 | type DataRouterNavigationContextObject = Pick<Router["state"], "navigation" | "revalidation">;
|
| 17 | type DataRouterStateContextObject = Omit<Router["state"], keyof DataRouterDataContextObject | keyof DataRouterNavigationContextObject | "fetchers">;
|
| 18 | declare const DataRouterStateContext: React$1.Context<DataRouterStateContextObject | null>;
|
| 19 | declare const DataRouterDataContext: React$1.Context<DataRouterDataContextObject | null>;
|
| 20 | declare const DataRouterNavigationContext: React$1.Context<DataRouterNavigationContextObject | null>;
|
| 21 | type ViewTransitionContextObject = {
|
| 22 | isTransitioning: false;
|
| 23 | } | {
|
| 24 | isTransitioning: true;
|
| 25 | flushSync: boolean;
|
| 26 | currentLocation: Location;
|
| 27 | nextLocation: Location;
|
| 28 | };
|
| 29 | declare const ViewTransitionContext: React$1.Context<ViewTransitionContextObject>;
|
| 30 | type FetchersContextObject = {
|
| 31 | fetchers: Router["state"]["fetchers"];
|
| 32 | fetcherData: Map<string, any>;
|
| 33 | };
|
| 34 | declare const FetchersContext: React$1.Context<FetchersContextObject | null>;
|
| 35 | declare const AwaitContext: React$1.Context<TrackedPromise | null>;
|
| 36 | declare const AwaitContextProvider: (props: React$1.ComponentProps<typeof AwaitContext.Provider>) => React$1.FunctionComponentElement<React$1.ProviderProps<TrackedPromise | null>>;
|
| 37 | interface NavigateOptions {
|
| 38 |
|
| 39 | replace?: boolean;
|
| 40 |
|
| 41 | mask?: To;
|
| 42 |
|
| 43 | state?: any;
|
| 44 |
|
| 45 | preventScrollReset?: boolean;
|
| 46 |
|
| 47 | relative?: RelativeRoutingType;
|
| 48 |
|
| 49 | flushSync?: boolean;
|
| 50 |
|
| 51 | viewTransition?: boolean;
|
| 52 |
|
| 53 | defaultShouldRevalidate?: boolean;
|
| 54 | }
|
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 |
|
| 64 | interface Navigator {
|
| 65 | createHref: History["createHref"];
|
| 66 | createURL?: History["createURL"];
|
| 67 | encodeLocation?: History["encodeLocation"];
|
| 68 | go: History["go"];
|
| 69 | push(to: To, state?: any, opts?: NavigateOptions): void;
|
| 70 | replace(to: To, state?: any, opts?: NavigateOptions): void;
|
| 71 | }
|
| 72 | interface NavigationContextObject {
|
| 73 | basename: string;
|
| 74 | navigator: Navigator;
|
| 75 | static: boolean;
|
| 76 | useTransitions: boolean | undefined;
|
| 77 | future: {};
|
| 78 | }
|
| 79 | declare const NavigationContext: React$1.Context<NavigationContextObject>;
|
| 80 | interface LocationContextObject {
|
| 81 | location: Location;
|
| 82 | navigationType: Action;
|
| 83 | }
|
| 84 | declare const LocationContext: React$1.Context<LocationContextObject>;
|
| 85 | interface RouteContextObject {
|
| 86 | outlet: React$1.ReactElement | null;
|
| 87 | matches: RouteMatch[];
|
| 88 | isDataRoute: boolean;
|
| 89 | }
|
| 90 | declare const RouteContext: React$1.Context<RouteContextObject>;
|
| 91 |
|
| 92 | export { AwaitContextProvider, DataRouterContext, DataRouterDataContext, DataRouterNavigationContext, DataRouterStateContext, FetchersContext, LocationContext, NavigateOptions, NavigationContext, Navigator, RouteContext, ViewTransitionContext }; |
| \ | No newline at end of file |