File tree Expand file tree Collapse file tree 6 files changed +31
-16
lines changed Expand file tree Collapse file tree 6 files changed +31
-16
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,8 @@ export type {
78
78
NavigateOptions ,
79
79
Navigator ,
80
80
NonIndexRouteObject ,
81
+ PatchRoutesOnNavigationFunction ,
82
+ PatchRoutesOnNavigationFunctionArgs ,
81
83
RouteMatch ,
82
84
RouteObject ,
83
85
} from "./lib/context" ;
@@ -93,7 +95,6 @@ export type {
93
95
RouterProps ,
94
96
RouterProviderProps ,
95
97
RoutesProps ,
96
- PatchRoutesOnNavigationFunction as PatchRoutesOnNavigationFunction ,
97
98
} from "./lib/components" ;
98
99
export type { NavigateFunction } from "./lib/hooks" ;
99
100
export {
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import type {
23
23
} from "./router/router" ;
24
24
import { createRouter } from "./router/router" ;
25
25
import type {
26
- AgnosticPatchRoutesOnNavigationFunction ,
27
26
DataStrategyFunction ,
28
27
LazyRouteFunction ,
29
28
TrackedPromise ,
@@ -35,6 +34,7 @@ import type {
35
34
IndexRouteObject ,
36
35
Navigator ,
37
36
NonIndexRouteObject ,
37
+ PatchRoutesOnNavigationFunction ,
38
38
RouteMatch ,
39
39
RouteObject ,
40
40
ViewTransitionContextObject ,
@@ -130,9 +130,6 @@ export function mapRouteProperties(route: RouteObject) {
130
130
return updates ;
131
131
}
132
132
133
- export interface PatchRoutesOnNavigationFunction
134
- extends AgnosticPatchRoutesOnNavigationFunction < RouteMatch > { }
135
-
136
133
/**
137
134
* @category Routers
138
135
*/
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import type {
13
13
import type {
14
14
AgnosticIndexRouteObject ,
15
15
AgnosticNonIndexRouteObject ,
16
+ AgnosticPatchRoutesOnNavigationFunction ,
17
+ AgnosticPatchRoutesOnNavigationFunctionArgs ,
16
18
AgnosticRouteMatch ,
17
19
LazyRouteFunction ,
18
20
TrackedPromise ,
@@ -74,6 +76,12 @@ export interface RouteMatch<
74
76
75
77
export interface DataRouteMatch extends RouteMatch < string , DataRouteObject > { }
76
78
79
+ export type PatchRoutesOnNavigationFunctionArgs =
80
+ AgnosticPatchRoutesOnNavigationFunctionArgs < RouteObject , RouteMatch > ;
81
+
82
+ export type PatchRoutesOnNavigationFunction =
83
+ AgnosticPatchRoutesOnNavigationFunction < RouteObject , RouteMatch > ;
84
+
77
85
export interface DataRouterContextObject
78
86
// Omit `future` since those can be pulled from the `router`
79
87
// `NavigationContext` needs future since it doesn't have a `router` in all cases
Original file line number Diff line number Diff line change @@ -64,9 +64,12 @@ import {
64
64
mergeRefs ,
65
65
usePrefetchBehavior ,
66
66
} from "./ssr/components" ;
67
- import type { PatchRoutesOnNavigationFunction } from "../components" ;
68
67
import { Router , mapRouteProperties } from "../components" ;
69
- import type { RouteObject , NavigateOptions } from "../context" ;
68
+ import type {
69
+ RouteObject ,
70
+ NavigateOptions ,
71
+ PatchRoutesOnNavigationFunction ,
72
+ } from "../context" ;
70
73
import {
71
74
DataRouterContext ,
72
75
DataRouterStateContext ,
Original file line number Diff line number Diff line change 1
1
import * as React from "react" ;
2
- import type { PatchRoutesOnNavigationFunction } from "../../components " ;
2
+ import type { PatchRoutesOnNavigationFunction } from "../../context " ;
3
3
import type { Router as RemixRouter } from "../../router/router" ;
4
4
import { matchRoutes } from "../../router/utils" ;
5
5
import type { AssetsManifest } from "./entry" ;
Original file line number Diff line number Diff line change @@ -223,15 +223,21 @@ export interface DataStrategyFunction {
223
223
( args : DataStrategyFunctionArgs ) : Promise < Record < string , DataStrategyResult > > ;
224
224
}
225
225
226
- export interface AgnosticPatchRoutesOnNavigationFunction <
226
+ export type AgnosticPatchRoutesOnNavigationFunctionArgs <
227
+ O extends AgnosticRouteObject = AgnosticRouteObject ,
227
228
M extends AgnosticRouteMatch = AgnosticRouteMatch
228
- > {
229
- ( opts : {
230
- path : string ;
231
- matches : M [ ] ;
232
- patch : ( routeId : string | null , children : AgnosticRouteObject [ ] ) => void ;
233
- } ) : void | Promise < void > ;
234
- }
229
+ > = {
230
+ path : string ;
231
+ matches : M [ ] ;
232
+ patch : ( routeId : string | null , children : O [ ] ) => void ;
233
+ } ;
234
+
235
+ export type AgnosticPatchRoutesOnNavigationFunction <
236
+ O extends AgnosticRouteObject = AgnosticRouteObject ,
237
+ M extends AgnosticRouteMatch = AgnosticRouteMatch
238
+ > = (
239
+ opts : AgnosticPatchRoutesOnNavigationFunctionArgs < O , M >
240
+ ) => void | Promise < void > ;
235
241
236
242
/**
237
243
* Function provided by the framework-aware layers to set any framework-specific
You can’t perform that action at this time.
0 commit comments