@tanstack/react-router 0.0.1-beta.193 → 0.0.1-beta.195
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/react.js +3 -14
- package/build/cjs/react.js.map +1 -1
- package/build/esm/index.js +3 -14
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +98 -98
- package/build/types/react.d.ts +24 -26
- package/build/umd/index.development.js +94 -30
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/react.tsx +24 -76
package/build/stats-react.json
CHANGED
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
"children": [
|
|
12
12
|
{
|
|
13
13
|
"name": "@tanstack+store@0.0.1/node_modules/@tanstack/store/build/esm/index.js",
|
|
14
|
-
"uid": "
|
|
14
|
+
"uid": "435c-159"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "@tanstack+react-store@0.0.1/node_modules/@tanstack/react-store/build/esm/index.js",
|
|
18
|
-
"uid": "
|
|
18
|
+
"uid": "435c-161"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
|
|
22
|
-
"uid": "
|
|
22
|
+
"uid": "435c-163"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
|
|
26
|
-
"uid": "
|
|
26
|
+
"uid": "435c-165"
|
|
27
27
|
}
|
|
28
28
|
]
|
|
29
29
|
},
|
|
@@ -32,25 +32,25 @@
|
|
|
32
32
|
"children": [
|
|
33
33
|
{
|
|
34
34
|
"name": "router-core/build/esm/index.js",
|
|
35
|
-
"uid": "
|
|
35
|
+
"uid": "435c-167"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"name": "react-router/src",
|
|
39
39
|
"children": [
|
|
40
40
|
{
|
|
41
|
-
"uid": "
|
|
41
|
+
"uid": "435c-171",
|
|
42
42
|
"name": "react.tsx"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
|
-
"uid": "
|
|
45
|
+
"uid": "435c-173",
|
|
46
46
|
"name": "scroll-restoration.tsx"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
"uid": "
|
|
49
|
+
"uid": "435c-175",
|
|
50
50
|
"name": "awaited.tsx"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
|
-
"uid": "
|
|
53
|
+
"uid": "435c-177",
|
|
54
54
|
"name": "index.tsx"
|
|
55
55
|
}
|
|
56
56
|
]
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
]
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
"uid": "
|
|
61
|
+
"uid": "435c-169",
|
|
62
62
|
"name": "\u0000rollupPluginBabelHelpers.js"
|
|
63
63
|
}
|
|
64
64
|
]
|
|
@@ -67,302 +67,302 @@
|
|
|
67
67
|
"isRoot": true
|
|
68
68
|
},
|
|
69
69
|
"nodeParts": {
|
|
70
|
-
"
|
|
70
|
+
"435c-159": {
|
|
71
71
|
"renderedLength": 1843,
|
|
72
72
|
"gzipLength": 644,
|
|
73
73
|
"brotliLength": 0,
|
|
74
|
-
"mainUid": "
|
|
74
|
+
"mainUid": "435c-158"
|
|
75
75
|
},
|
|
76
|
-
"
|
|
76
|
+
"435c-161": {
|
|
77
77
|
"renderedLength": 1006,
|
|
78
78
|
"gzipLength": 479,
|
|
79
79
|
"brotliLength": 0,
|
|
80
|
-
"mainUid": "
|
|
80
|
+
"mainUid": "435c-160"
|
|
81
81
|
},
|
|
82
|
-
"
|
|
82
|
+
"435c-163": {
|
|
83
83
|
"renderedLength": 181,
|
|
84
84
|
"gzipLength": 129,
|
|
85
85
|
"brotliLength": 0,
|
|
86
|
-
"mainUid": "
|
|
86
|
+
"mainUid": "435c-162"
|
|
87
87
|
},
|
|
88
|
-
"
|
|
88
|
+
"435c-165": {
|
|
89
89
|
"renderedLength": 44,
|
|
90
90
|
"gzipLength": 62,
|
|
91
91
|
"brotliLength": 0,
|
|
92
|
-
"mainUid": "
|
|
92
|
+
"mainUid": "435c-164"
|
|
93
93
|
},
|
|
94
|
-
"
|
|
95
|
-
"renderedLength":
|
|
96
|
-
"gzipLength":
|
|
94
|
+
"435c-167": {
|
|
95
|
+
"renderedLength": 71807,
|
|
96
|
+
"gzipLength": 17229,
|
|
97
97
|
"brotliLength": 0,
|
|
98
|
-
"mainUid": "
|
|
98
|
+
"mainUid": "435c-166"
|
|
99
99
|
},
|
|
100
|
-
"
|
|
100
|
+
"435c-169": {
|
|
101
101
|
"renderedLength": 429,
|
|
102
102
|
"gzipLength": 238,
|
|
103
103
|
"brotliLength": 0,
|
|
104
|
-
"mainUid": "
|
|
104
|
+
"mainUid": "435c-168"
|
|
105
105
|
},
|
|
106
|
-
"
|
|
107
|
-
"renderedLength":
|
|
108
|
-
"gzipLength":
|
|
106
|
+
"435c-171": {
|
|
107
|
+
"renderedLength": 17157,
|
|
108
|
+
"gzipLength": 3785,
|
|
109
109
|
"brotliLength": 0,
|
|
110
|
-
"mainUid": "
|
|
110
|
+
"mainUid": "435c-170"
|
|
111
111
|
},
|
|
112
|
-
"
|
|
112
|
+
"435c-173": {
|
|
113
113
|
"renderedLength": 466,
|
|
114
114
|
"gzipLength": 228,
|
|
115
115
|
"brotliLength": 0,
|
|
116
|
-
"mainUid": "
|
|
116
|
+
"mainUid": "435c-172"
|
|
117
117
|
},
|
|
118
|
-
"
|
|
118
|
+
"435c-175": {
|
|
119
119
|
"renderedLength": 641,
|
|
120
120
|
"gzipLength": 305,
|
|
121
121
|
"brotliLength": 0,
|
|
122
|
-
"mainUid": "
|
|
122
|
+
"mainUid": "435c-174"
|
|
123
123
|
},
|
|
124
|
-
"
|
|
124
|
+
"435c-177": {
|
|
125
125
|
"renderedLength": 0,
|
|
126
126
|
"gzipLength": 0,
|
|
127
127
|
"brotliLength": 0,
|
|
128
|
-
"mainUid": "
|
|
128
|
+
"mainUid": "435c-176"
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
131
|
"nodeMetas": {
|
|
132
|
-
"
|
|
132
|
+
"435c-158": {
|
|
133
133
|
"id": "/node_modules/.pnpm/@tanstack+store@0.0.1/node_modules/@tanstack/store/build/esm/index.js",
|
|
134
134
|
"moduleParts": {
|
|
135
|
-
"index.production.js": "
|
|
135
|
+
"index.production.js": "435c-159"
|
|
136
136
|
},
|
|
137
137
|
"imported": [],
|
|
138
138
|
"importedBy": [
|
|
139
139
|
{
|
|
140
|
-
"uid": "
|
|
140
|
+
"uid": "435c-160"
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
|
-
"uid": "
|
|
143
|
+
"uid": "435c-166"
|
|
144
144
|
}
|
|
145
145
|
]
|
|
146
146
|
},
|
|
147
|
-
"
|
|
147
|
+
"435c-160": {
|
|
148
148
|
"id": "/node_modules/.pnpm/@tanstack+react-store@0.0.1/node_modules/@tanstack/react-store/build/esm/index.js",
|
|
149
149
|
"moduleParts": {
|
|
150
|
-
"index.production.js": "
|
|
150
|
+
"index.production.js": "435c-161"
|
|
151
151
|
},
|
|
152
152
|
"imported": [
|
|
153
153
|
{
|
|
154
|
-
"uid": "
|
|
154
|
+
"uid": "435c-178"
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
|
-
"uid": "
|
|
157
|
+
"uid": "435c-158"
|
|
158
158
|
}
|
|
159
159
|
],
|
|
160
160
|
"importedBy": [
|
|
161
161
|
{
|
|
162
|
-
"uid": "
|
|
162
|
+
"uid": "435c-176"
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
|
-
"uid": "
|
|
165
|
+
"uid": "435c-170"
|
|
166
166
|
}
|
|
167
167
|
]
|
|
168
168
|
},
|
|
169
|
-
"
|
|
169
|
+
"435c-162": {
|
|
170
170
|
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
|
|
171
171
|
"moduleParts": {
|
|
172
|
-
"index.production.js": "
|
|
172
|
+
"index.production.js": "435c-163"
|
|
173
173
|
},
|
|
174
174
|
"imported": [],
|
|
175
175
|
"importedBy": [
|
|
176
176
|
{
|
|
177
|
-
"uid": "
|
|
177
|
+
"uid": "435c-166"
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
|
-
"uid": "
|
|
180
|
+
"uid": "435c-170"
|
|
181
181
|
}
|
|
182
182
|
]
|
|
183
183
|
},
|
|
184
|
-
"
|
|
184
|
+
"435c-164": {
|
|
185
185
|
"id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
|
|
186
186
|
"moduleParts": {
|
|
187
|
-
"index.production.js": "
|
|
187
|
+
"index.production.js": "435c-165"
|
|
188
188
|
},
|
|
189
189
|
"imported": [],
|
|
190
190
|
"importedBy": [
|
|
191
191
|
{
|
|
192
|
-
"uid": "
|
|
192
|
+
"uid": "435c-166"
|
|
193
193
|
},
|
|
194
194
|
{
|
|
195
|
-
"uid": "
|
|
195
|
+
"uid": "435c-170"
|
|
196
196
|
}
|
|
197
197
|
]
|
|
198
198
|
},
|
|
199
|
-
"
|
|
199
|
+
"435c-166": {
|
|
200
200
|
"id": "/packages/router-core/build/esm/index.js",
|
|
201
201
|
"moduleParts": {
|
|
202
|
-
"index.production.js": "
|
|
202
|
+
"index.production.js": "435c-167"
|
|
203
203
|
},
|
|
204
204
|
"imported": [
|
|
205
205
|
{
|
|
206
|
-
"uid": "
|
|
206
|
+
"uid": "435c-162"
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
|
-
"uid": "
|
|
209
|
+
"uid": "435c-164"
|
|
210
210
|
},
|
|
211
211
|
{
|
|
212
|
-
"uid": "
|
|
212
|
+
"uid": "435c-158"
|
|
213
213
|
}
|
|
214
214
|
],
|
|
215
215
|
"importedBy": [
|
|
216
216
|
{
|
|
217
|
-
"uid": "
|
|
217
|
+
"uid": "435c-176"
|
|
218
218
|
},
|
|
219
219
|
{
|
|
220
|
-
"uid": "
|
|
220
|
+
"uid": "435c-170"
|
|
221
221
|
},
|
|
222
222
|
{
|
|
223
|
-
"uid": "
|
|
223
|
+
"uid": "435c-172"
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
|
-
"uid": "
|
|
226
|
+
"uid": "435c-174"
|
|
227
227
|
}
|
|
228
228
|
]
|
|
229
229
|
},
|
|
230
|
-
"
|
|
230
|
+
"435c-168": {
|
|
231
231
|
"id": "\u0000rollupPluginBabelHelpers.js",
|
|
232
232
|
"moduleParts": {
|
|
233
|
-
"index.production.js": "
|
|
233
|
+
"index.production.js": "435c-169"
|
|
234
234
|
},
|
|
235
235
|
"imported": [],
|
|
236
236
|
"importedBy": [
|
|
237
237
|
{
|
|
238
|
-
"uid": "
|
|
238
|
+
"uid": "435c-170"
|
|
239
239
|
}
|
|
240
240
|
]
|
|
241
241
|
},
|
|
242
|
-
"
|
|
242
|
+
"435c-170": {
|
|
243
243
|
"id": "/packages/react-router/src/react.tsx",
|
|
244
244
|
"moduleParts": {
|
|
245
|
-
"index.production.js": "
|
|
245
|
+
"index.production.js": "435c-171"
|
|
246
246
|
},
|
|
247
247
|
"imported": [
|
|
248
248
|
{
|
|
249
|
-
"uid": "
|
|
249
|
+
"uid": "435c-168"
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
|
-
"uid": "
|
|
252
|
+
"uid": "435c-179"
|
|
253
253
|
},
|
|
254
254
|
{
|
|
255
|
-
"uid": "
|
|
255
|
+
"uid": "435c-160"
|
|
256
256
|
},
|
|
257
257
|
{
|
|
258
|
-
"uid": "
|
|
258
|
+
"uid": "435c-162"
|
|
259
259
|
},
|
|
260
260
|
{
|
|
261
|
-
"uid": "
|
|
261
|
+
"uid": "435c-164"
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
|
-
"uid": "
|
|
264
|
+
"uid": "435c-166"
|
|
265
265
|
}
|
|
266
266
|
],
|
|
267
267
|
"importedBy": [
|
|
268
268
|
{
|
|
269
|
-
"uid": "
|
|
269
|
+
"uid": "435c-176"
|
|
270
270
|
},
|
|
271
271
|
{
|
|
272
|
-
"uid": "
|
|
272
|
+
"uid": "435c-172"
|
|
273
273
|
},
|
|
274
274
|
{
|
|
275
|
-
"uid": "
|
|
275
|
+
"uid": "435c-174"
|
|
276
276
|
}
|
|
277
277
|
]
|
|
278
278
|
},
|
|
279
|
-
"
|
|
279
|
+
"435c-172": {
|
|
280
280
|
"id": "/packages/react-router/src/scroll-restoration.tsx",
|
|
281
281
|
"moduleParts": {
|
|
282
|
-
"index.production.js": "
|
|
282
|
+
"index.production.js": "435c-173"
|
|
283
283
|
},
|
|
284
284
|
"imported": [
|
|
285
285
|
{
|
|
286
|
-
"uid": "
|
|
286
|
+
"uid": "435c-179"
|
|
287
287
|
},
|
|
288
288
|
{
|
|
289
|
-
"uid": "
|
|
289
|
+
"uid": "435c-166"
|
|
290
290
|
},
|
|
291
291
|
{
|
|
292
|
-
"uid": "
|
|
292
|
+
"uid": "435c-170"
|
|
293
293
|
}
|
|
294
294
|
],
|
|
295
295
|
"importedBy": [
|
|
296
296
|
{
|
|
297
|
-
"uid": "
|
|
297
|
+
"uid": "435c-176"
|
|
298
298
|
}
|
|
299
299
|
]
|
|
300
300
|
},
|
|
301
|
-
"
|
|
301
|
+
"435c-174": {
|
|
302
302
|
"id": "/packages/react-router/src/awaited.tsx",
|
|
303
303
|
"moduleParts": {
|
|
304
|
-
"index.production.js": "
|
|
304
|
+
"index.production.js": "435c-175"
|
|
305
305
|
},
|
|
306
306
|
"imported": [
|
|
307
307
|
{
|
|
308
|
-
"uid": "
|
|
308
|
+
"uid": "435c-166"
|
|
309
309
|
},
|
|
310
310
|
{
|
|
311
|
-
"uid": "
|
|
311
|
+
"uid": "435c-170"
|
|
312
312
|
}
|
|
313
313
|
],
|
|
314
314
|
"importedBy": [
|
|
315
315
|
{
|
|
316
|
-
"uid": "
|
|
316
|
+
"uid": "435c-176"
|
|
317
317
|
}
|
|
318
318
|
]
|
|
319
319
|
},
|
|
320
|
-
"
|
|
320
|
+
"435c-176": {
|
|
321
321
|
"id": "/packages/react-router/src/index.tsx",
|
|
322
322
|
"moduleParts": {
|
|
323
|
-
"index.production.js": "
|
|
323
|
+
"index.production.js": "435c-177"
|
|
324
324
|
},
|
|
325
325
|
"imported": [
|
|
326
326
|
{
|
|
327
|
-
"uid": "
|
|
327
|
+
"uid": "435c-160"
|
|
328
328
|
},
|
|
329
329
|
{
|
|
330
|
-
"uid": "
|
|
330
|
+
"uid": "435c-166"
|
|
331
331
|
},
|
|
332
332
|
{
|
|
333
|
-
"uid": "
|
|
333
|
+
"uid": "435c-170"
|
|
334
334
|
},
|
|
335
335
|
{
|
|
336
|
-
"uid": "
|
|
336
|
+
"uid": "435c-172"
|
|
337
337
|
},
|
|
338
338
|
{
|
|
339
|
-
"uid": "
|
|
339
|
+
"uid": "435c-174"
|
|
340
340
|
}
|
|
341
341
|
],
|
|
342
342
|
"importedBy": [],
|
|
343
343
|
"isEntry": true
|
|
344
344
|
},
|
|
345
|
-
"
|
|
345
|
+
"435c-178": {
|
|
346
346
|
"id": "use-sync-external-store/shim/with-selector",
|
|
347
347
|
"moduleParts": {},
|
|
348
348
|
"imported": [],
|
|
349
349
|
"importedBy": [
|
|
350
350
|
{
|
|
351
|
-
"uid": "
|
|
351
|
+
"uid": "435c-160"
|
|
352
352
|
}
|
|
353
353
|
],
|
|
354
354
|
"isExternal": true
|
|
355
355
|
},
|
|
356
|
-
"
|
|
356
|
+
"435c-179": {
|
|
357
357
|
"id": "react",
|
|
358
358
|
"moduleParts": {},
|
|
359
359
|
"imported": [],
|
|
360
360
|
"importedBy": [
|
|
361
361
|
{
|
|
362
|
-
"uid": "
|
|
362
|
+
"uid": "435c-170"
|
|
363
363
|
},
|
|
364
364
|
{
|
|
365
|
-
"uid": "
|
|
365
|
+
"uid": "435c-172"
|
|
366
366
|
}
|
|
367
367
|
],
|
|
368
368
|
"isExternal": true
|
package/build/types/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { NoInfer } from '@tanstack/react-store';
|
|
3
|
-
import { MatchRouteOptions, RegisteredRouter, RouterOptions, Router, RouteMatch, RouteByPath, AnyRoute, AnyRouteProps, LinkOptions, ToOptions, ResolveRelativePath, NavigateOptions, ResolveFullPath, ResolveId, AnySearchSchema, ParsePathParams,
|
|
3
|
+
import { MatchRouteOptions, RegisteredRouter, RouterOptions, Router, RouteMatch, RouteByPath, AnyRoute, AnyRouteProps, LinkOptions, ToOptions, ResolveRelativePath, NavigateOptions, ResolveFullPath, ResolveId, AnySearchSchema, ParsePathParams, RouteContext, AnyContext, UseLoaderResult, ResolveFullSearchSchema, RouteConstraints, RoutePaths, RoutesById, RouteIds, RouteById, ParseRoute, AllParams, AnyPathParams, Expand, ResolveAllParams, DeepMergeAll, IsAny } from '@tanstack/router-core';
|
|
4
4
|
declare module '@tanstack/router-core' {
|
|
5
5
|
interface RouterOptions<TRouteTree extends AnyRoute, TDehydrated extends Record<string, any>> {
|
|
6
6
|
Wrap?: React.ComponentType<{
|
|
@@ -8,28 +8,29 @@ declare module '@tanstack/router-core' {
|
|
|
8
8
|
dehydratedState?: TDehydrated;
|
|
9
9
|
}>;
|
|
10
10
|
}
|
|
11
|
-
interface RegisterRouteComponent<TLoader = unknown, TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams,
|
|
12
|
-
RouteComponent: RouteComponent<RouteProps<TLoader, TFullSearchSchema, TAllParams,
|
|
11
|
+
interface RegisterRouteComponent<TLoader = unknown, TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TAllContext extends Record<string, any> = AnyContext> {
|
|
12
|
+
RouteComponent: RouteComponent<RouteProps<TLoader, TFullSearchSchema, TAllParams, TAllContext>>;
|
|
13
13
|
}
|
|
14
|
-
interface RegisterErrorRouteComponent<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams,
|
|
15
|
-
ErrorRouteComponent: RouteComponent<ErrorRouteProps<TFullSearchSchema, TAllParams,
|
|
14
|
+
interface RegisterErrorRouteComponent<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TAllContext extends Record<string, any> = AnyContext> {
|
|
15
|
+
ErrorRouteComponent: RouteComponent<ErrorRouteProps<TFullSearchSchema, TAllParams, TAllContext>>;
|
|
16
16
|
}
|
|
17
|
-
interface RegisterPendingRouteComponent<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams,
|
|
18
|
-
PendingRouteComponent: RouteComponent<PendingRouteProps<TFullSearchSchema, TAllParams,
|
|
17
|
+
interface RegisterPendingRouteComponent<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TAllContext extends Record<string, any> = AnyContext> {
|
|
18
|
+
PendingRouteComponent: RouteComponent<PendingRouteProps<TFullSearchSchema, TAllParams, TAllContext>>;
|
|
19
19
|
}
|
|
20
|
-
interface Route<TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, TPath extends RouteConstraints['TPath'] = '/', TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, TCustomId extends RouteConstraints['TCustomId'] = string, TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, TLoaderContext extends RouteConstraints['TLoaderContext'] = AnyContext, TLoader = unknown, TSearchSchema extends RouteConstraints['TSearchSchema'] = {}, TFullSearchSchema extends RouteConstraints['TFullSearchSchema'] = ResolveFullSearchSchema<TParentRoute, TSearchSchema>, TParams extends RouteConstraints['TParams'] = Expand<Record<ParsePathParams<TPath>, string>>, TAllParams extends RouteConstraints['TAllParams'] = ResolveAllParams<TParentRoute, TParams>,
|
|
20
|
+
interface Route<TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, TPath extends RouteConstraints['TPath'] = '/', TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, TCustomId extends RouteConstraints['TCustomId'] = string, TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, TLoaderContext extends RouteConstraints['TLoaderContext'] = AnyContext, TLoader = unknown, TSearchSchema extends RouteConstraints['TSearchSchema'] = {}, TFullSearchSchema extends RouteConstraints['TFullSearchSchema'] = ResolveFullSearchSchema<TParentRoute, TSearchSchema>, TParams extends RouteConstraints['TParams'] = Expand<Record<ParsePathParams<TPath>, string>>, TAllParams extends RouteConstraints['TAllParams'] = ResolveAllParams<TParentRoute, TParams>, TRouteContext extends RouteConstraints['TRouteContext'] = RouteContext, TAllContext extends RouteConstraints['TAllContext'] = Expand<DeepMergeAll<[
|
|
21
|
+
IsAny<TParentRoute['types']['context'], {}>,
|
|
22
|
+
TLoaderContext,
|
|
23
|
+
TRouteContext
|
|
24
|
+
]>>, TRouterContext extends RouteConstraints['TRouterContext'] = AnyContext, TChildren extends RouteConstraints['TChildren'] = unknown, TRouteTree extends RouteConstraints['TRouteTree'] = AnyRoute> {
|
|
21
25
|
useMatch: <TSelected = TAllContext>(opts?: {
|
|
22
26
|
select?: (search: TAllContext) => TSelected;
|
|
23
27
|
}) => TSelected;
|
|
24
28
|
useLoader: <TSelected = TLoader>(opts?: {
|
|
25
29
|
select?: (search: TLoader) => TSelected;
|
|
26
30
|
}) => UseLoaderResult<TSelected>;
|
|
27
|
-
|
|
31
|
+
useRouteContext: <TSelected = TAllContext>(opts?: {
|
|
28
32
|
select?: (search: TAllContext) => TSelected;
|
|
29
33
|
}) => TSelected;
|
|
30
|
-
useRouteContext: <TSelected = TRouteContext>(opts?: {
|
|
31
|
-
select?: (search: TRouteContext) => TSelected;
|
|
32
|
-
}) => TSelected;
|
|
33
34
|
useSearch: <TSelected = TFullSearchSchema>(opts?: {
|
|
34
35
|
select?: (search: TFullSearchSchema) => TSelected;
|
|
35
36
|
}) => TSelected;
|
|
@@ -37,29 +38,26 @@ declare module '@tanstack/router-core' {
|
|
|
37
38
|
select?: (search: TAllParams) => TSelected;
|
|
38
39
|
}) => TSelected;
|
|
39
40
|
}
|
|
40
|
-
interface RegisterRouteProps<TLoader = unknown, TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams,
|
|
41
|
-
RouteProps: RouteProps<TLoader, TFullSearchSchema, TAllParams,
|
|
41
|
+
interface RegisterRouteProps<TLoader = unknown, TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TAllContext extends Record<string, any> = AnyContext> {
|
|
42
|
+
RouteProps: RouteProps<TLoader, TFullSearchSchema, TAllParams, TAllContext>;
|
|
42
43
|
}
|
|
43
|
-
interface RegisterPendingRouteProps<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams,
|
|
44
|
-
PendingRouteProps: PendingRouteProps<TFullSearchSchema, TAllParams,
|
|
44
|
+
interface RegisterPendingRouteProps<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TAllContext extends Record<string, any> = AnyContext> {
|
|
45
|
+
PendingRouteProps: PendingRouteProps<TFullSearchSchema, TAllParams, TAllContext>;
|
|
45
46
|
}
|
|
46
|
-
interface RegisterErrorRouteProps<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams,
|
|
47
|
+
interface RegisterErrorRouteProps<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TAllContext extends Record<string, any> = AnyContext> {
|
|
47
48
|
ErrorRouteProps: ErrorRouteProps;
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
export type RouteProps<TLoader = unknown, TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams,
|
|
51
|
+
export type RouteProps<TLoader = unknown, TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TAllContext extends Record<string, any> = AnyContext> = {
|
|
51
52
|
useLoader: <TSelected = TLoader>(opts?: {
|
|
52
53
|
select?: (search: TLoader) => TSelected;
|
|
53
54
|
}) => UseLoaderResult<TSelected>;
|
|
54
55
|
useMatch: <TSelected = TAllContext>(opts?: {
|
|
55
56
|
select?: (search: TAllContext) => TSelected;
|
|
56
57
|
}) => TSelected;
|
|
57
|
-
|
|
58
|
+
useRouteContext: <TSelected = TAllContext>(opts?: {
|
|
58
59
|
select?: (search: TAllContext) => TSelected;
|
|
59
60
|
}) => TSelected;
|
|
60
|
-
useRouteContext: <TSelected = TRouteContext>(opts?: {
|
|
61
|
-
select?: (search: TRouteContext) => TSelected;
|
|
62
|
-
}) => TSelected;
|
|
63
61
|
useSearch: <TSelected = TFullSearchSchema>(opts?: {
|
|
64
62
|
select?: (search: TFullSearchSchema) => TSelected;
|
|
65
63
|
}) => TSelected;
|
|
@@ -67,13 +65,13 @@ export type RouteProps<TLoader = unknown, TFullSearchSchema extends Record<strin
|
|
|
67
65
|
select?: (search: TAllParams) => TSelected;
|
|
68
66
|
}) => TSelected;
|
|
69
67
|
};
|
|
70
|
-
export type ErrorRouteProps<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams,
|
|
68
|
+
export type ErrorRouteProps<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TAllContext extends Record<string, any> = AnyContext> = {
|
|
71
69
|
error: unknown;
|
|
72
70
|
info: {
|
|
73
71
|
componentStack: string;
|
|
74
72
|
};
|
|
75
|
-
} & Omit<RouteProps<unknown, TFullSearchSchema, TAllParams,
|
|
76
|
-
export type PendingRouteProps<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams,
|
|
73
|
+
} & Omit<RouteProps<unknown, TFullSearchSchema, TAllParams, TAllContext>, 'useLoader'>;
|
|
74
|
+
export type PendingRouteProps<TFullSearchSchema extends Record<string, any> = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TAllContext extends Record<string, any> = AnyContext> = Omit<RouteProps<unknown, TFullSearchSchema, TAllParams, TAllContext>, 'useLoader'>;
|
|
77
75
|
type ReactNode = any;
|
|
78
76
|
export type SyncRouteComponent<TProps> = ((props: TProps) => ReactNode) | React.LazyExoticComponent<(props: TProps) => ReactNode>;
|
|
79
77
|
export type AsyncRouteComponent<TProps> = SyncRouteComponent<TProps> & {
|
|
@@ -94,7 +92,7 @@ export type LinkPropsOptions<TRouteTree extends AnyRoute = RegisteredRouter['rou
|
|
|
94
92
|
inactiveProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>);
|
|
95
93
|
startTransition?: boolean;
|
|
96
94
|
};
|
|
97
|
-
export type MakeUseMatchRouteOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''> = ToOptions<
|
|
95
|
+
export type MakeUseMatchRouteOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''> = ToOptions<AnyRoute, TFrom, TTo, TMaskFrom, TMaskTo> & MatchRouteOptions;
|
|
98
96
|
export type MakeMatchRouteOptions<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TMaskFrom extends RoutePaths<TRouteTree> = '/', TMaskTo extends string = ''> = ToOptions<TRouteTree, TFrom, TTo, TMaskFrom, TMaskTo> & MatchRouteOptions & {
|
|
99
97
|
children?: ((params?: RouteByPath<TRouteTree, ResolveRelativePath<TFrom, NoInfer<TTo>>>['types']['allParams']) => ReactNode) | React.ReactNode;
|
|
100
98
|
};
|