@tanstack/react-router 0.0.1-beta.19 → 0.0.1-beta.190
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/LICENSE +21 -0
- package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +1 -19
- package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/build/cjs/awaited.js +45 -0
- package/build/cjs/awaited.js.map +1 -0
- package/build/cjs/index.js +66 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/react.js +653 -0
- package/build/cjs/react.js.map +1 -0
- package/build/cjs/scroll-restoration.js +56 -0
- package/build/cjs/scroll-restoration.js.map +1 -0
- package/build/esm/index.js +559 -2790
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +59 -49
- package/build/stats-react.json +287 -37
- package/build/types/awaited.d.ts +8 -0
- package/build/types/index.d.ts +4 -105
- package/build/types/react.d.ts +202 -0
- package/build/types/scroll-restoration.d.ts +3 -0
- package/build/umd/index.development.js +2471 -2438
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +25 -4
- package/build/umd/index.production.js.map +1 -1
- package/package.json +11 -10
- package/src/awaited.tsx +40 -0
- package/src/index.tsx +5 -660
- package/src/react.tsx +1298 -0
- package/src/scroll-restoration.tsx +27 -0
- package/build/cjs/react-router/src/index.js +0 -443
- package/build/cjs/react-router/src/index.js.map +0 -1
- package/build/cjs/router-core/build/esm/index.js +0 -2523
- package/build/cjs/router-core/build/esm/index.js.map +0 -1
package/build/stats-react.json
CHANGED
|
@@ -7,21 +7,59 @@
|
|
|
7
7
|
"name": "index.production.js",
|
|
8
8
|
"children": [
|
|
9
9
|
{
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"name": "node_modules/.pnpm",
|
|
11
|
+
"children": [
|
|
12
|
+
{
|
|
13
|
+
"name": "@tanstack+store@0.0.1/node_modules/@tanstack/store/build/esm/index.js",
|
|
14
|
+
"uid": "a31f-159"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "@tanstack+react-store@0.0.1/node_modules/@tanstack/react-store/build/esm/index.js",
|
|
18
|
+
"uid": "a31f-161"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
|
|
22
|
+
"uid": "a31f-163"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
|
|
26
|
+
"uid": "a31f-165"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
12
29
|
},
|
|
13
30
|
{
|
|
14
31
|
"name": "packages",
|
|
15
32
|
"children": [
|
|
16
33
|
{
|
|
17
34
|
"name": "router-core/build/esm/index.js",
|
|
18
|
-
"uid": "
|
|
35
|
+
"uid": "a31f-167"
|
|
19
36
|
},
|
|
20
37
|
{
|
|
21
|
-
"name": "react-router/src
|
|
22
|
-
"
|
|
38
|
+
"name": "react-router/src",
|
|
39
|
+
"children": [
|
|
40
|
+
{
|
|
41
|
+
"uid": "a31f-171",
|
|
42
|
+
"name": "react.tsx"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"uid": "a31f-173",
|
|
46
|
+
"name": "scroll-restoration.tsx"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"uid": "a31f-175",
|
|
50
|
+
"name": "awaited.tsx"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"uid": "a31f-177",
|
|
54
|
+
"name": "index.tsx"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
23
57
|
}
|
|
24
58
|
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"uid": "a31f-169",
|
|
62
|
+
"name": "\u0000rollupPluginBabelHelpers.js"
|
|
25
63
|
}
|
|
26
64
|
]
|
|
27
65
|
}
|
|
@@ -29,97 +67,309 @@
|
|
|
29
67
|
"isRoot": true
|
|
30
68
|
},
|
|
31
69
|
"nodeParts": {
|
|
32
|
-
"
|
|
33
|
-
"renderedLength":
|
|
34
|
-
"gzipLength":
|
|
70
|
+
"a31f-159": {
|
|
71
|
+
"renderedLength": 1843,
|
|
72
|
+
"gzipLength": 644,
|
|
35
73
|
"brotliLength": 0,
|
|
36
|
-
"mainUid": "
|
|
74
|
+
"mainUid": "a31f-158"
|
|
37
75
|
},
|
|
38
|
-
"
|
|
39
|
-
"renderedLength":
|
|
40
|
-
"gzipLength":
|
|
76
|
+
"a31f-161": {
|
|
77
|
+
"renderedLength": 1006,
|
|
78
|
+
"gzipLength": 479,
|
|
41
79
|
"brotliLength": 0,
|
|
42
|
-
"mainUid": "
|
|
80
|
+
"mainUid": "a31f-160"
|
|
43
81
|
},
|
|
44
|
-
"
|
|
45
|
-
"renderedLength":
|
|
46
|
-
"gzipLength":
|
|
82
|
+
"a31f-163": {
|
|
83
|
+
"renderedLength": 181,
|
|
84
|
+
"gzipLength": 129,
|
|
47
85
|
"brotliLength": 0,
|
|
48
|
-
"mainUid": "
|
|
86
|
+
"mainUid": "a31f-162"
|
|
87
|
+
},
|
|
88
|
+
"a31f-165": {
|
|
89
|
+
"renderedLength": 44,
|
|
90
|
+
"gzipLength": 62,
|
|
91
|
+
"brotliLength": 0,
|
|
92
|
+
"mainUid": "a31f-164"
|
|
93
|
+
},
|
|
94
|
+
"a31f-167": {
|
|
95
|
+
"renderedLength": 68113,
|
|
96
|
+
"gzipLength": 16108,
|
|
97
|
+
"brotliLength": 0,
|
|
98
|
+
"mainUid": "a31f-166"
|
|
99
|
+
},
|
|
100
|
+
"a31f-169": {
|
|
101
|
+
"renderedLength": 429,
|
|
102
|
+
"gzipLength": 238,
|
|
103
|
+
"brotliLength": 0,
|
|
104
|
+
"mainUid": "a31f-168"
|
|
105
|
+
},
|
|
106
|
+
"a31f-171": {
|
|
107
|
+
"renderedLength": 17461,
|
|
108
|
+
"gzipLength": 3782,
|
|
109
|
+
"brotliLength": 0,
|
|
110
|
+
"mainUid": "a31f-170"
|
|
111
|
+
},
|
|
112
|
+
"a31f-173": {
|
|
113
|
+
"renderedLength": 466,
|
|
114
|
+
"gzipLength": 228,
|
|
115
|
+
"brotliLength": 0,
|
|
116
|
+
"mainUid": "a31f-172"
|
|
117
|
+
},
|
|
118
|
+
"a31f-175": {
|
|
119
|
+
"renderedLength": 641,
|
|
120
|
+
"gzipLength": 305,
|
|
121
|
+
"brotliLength": 0,
|
|
122
|
+
"mainUid": "a31f-174"
|
|
123
|
+
},
|
|
124
|
+
"a31f-177": {
|
|
125
|
+
"renderedLength": 0,
|
|
126
|
+
"gzipLength": 0,
|
|
127
|
+
"brotliLength": 0,
|
|
128
|
+
"mainUid": "a31f-176"
|
|
49
129
|
}
|
|
50
130
|
},
|
|
51
131
|
"nodeMetas": {
|
|
52
|
-
"
|
|
53
|
-
"id": "
|
|
132
|
+
"a31f-158": {
|
|
133
|
+
"id": "/node_modules/.pnpm/@tanstack+store@0.0.1/node_modules/@tanstack/store/build/esm/index.js",
|
|
134
|
+
"moduleParts": {
|
|
135
|
+
"index.production.js": "a31f-159"
|
|
136
|
+
},
|
|
137
|
+
"imported": [],
|
|
138
|
+
"importedBy": [
|
|
139
|
+
{
|
|
140
|
+
"uid": "a31f-160"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"uid": "a31f-166"
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
"a31f-160": {
|
|
148
|
+
"id": "/node_modules/.pnpm/@tanstack+react-store@0.0.1/node_modules/@tanstack/react-store/build/esm/index.js",
|
|
54
149
|
"moduleParts": {
|
|
55
|
-
"index.production.js": "
|
|
150
|
+
"index.production.js": "a31f-161"
|
|
151
|
+
},
|
|
152
|
+
"imported": [
|
|
153
|
+
{
|
|
154
|
+
"uid": "a31f-178"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"uid": "a31f-158"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"importedBy": [
|
|
161
|
+
{
|
|
162
|
+
"uid": "a31f-176"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"uid": "a31f-170"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
"a31f-162": {
|
|
170
|
+
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
|
|
171
|
+
"moduleParts": {
|
|
172
|
+
"index.production.js": "a31f-163"
|
|
56
173
|
},
|
|
57
174
|
"imported": [],
|
|
58
175
|
"importedBy": [
|
|
59
176
|
{
|
|
60
|
-
"uid": "
|
|
177
|
+
"uid": "a31f-166"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"uid": "a31f-170"
|
|
61
181
|
}
|
|
62
182
|
]
|
|
63
183
|
},
|
|
64
|
-
"
|
|
184
|
+
"a31f-164": {
|
|
185
|
+
"id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
|
|
186
|
+
"moduleParts": {
|
|
187
|
+
"index.production.js": "a31f-165"
|
|
188
|
+
},
|
|
189
|
+
"imported": [],
|
|
190
|
+
"importedBy": [
|
|
191
|
+
{
|
|
192
|
+
"uid": "a31f-166"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"uid": "a31f-170"
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"a31f-166": {
|
|
65
200
|
"id": "/packages/router-core/build/esm/index.js",
|
|
66
201
|
"moduleParts": {
|
|
67
|
-
"index.production.js": "
|
|
202
|
+
"index.production.js": "a31f-167"
|
|
203
|
+
},
|
|
204
|
+
"imported": [
|
|
205
|
+
{
|
|
206
|
+
"uid": "a31f-162"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"uid": "a31f-164"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"uid": "a31f-158"
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
"importedBy": [
|
|
216
|
+
{
|
|
217
|
+
"uid": "a31f-176"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"uid": "a31f-170"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"uid": "a31f-172"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"uid": "a31f-174"
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
"a31f-168": {
|
|
231
|
+
"id": "\u0000rollupPluginBabelHelpers.js",
|
|
232
|
+
"moduleParts": {
|
|
233
|
+
"index.production.js": "a31f-169"
|
|
68
234
|
},
|
|
69
235
|
"imported": [],
|
|
70
236
|
"importedBy": [
|
|
71
237
|
{
|
|
72
|
-
"uid": "
|
|
238
|
+
"uid": "a31f-170"
|
|
73
239
|
}
|
|
74
240
|
]
|
|
75
241
|
},
|
|
76
|
-
"
|
|
242
|
+
"a31f-170": {
|
|
243
|
+
"id": "/packages/react-router/src/react.tsx",
|
|
244
|
+
"moduleParts": {
|
|
245
|
+
"index.production.js": "a31f-171"
|
|
246
|
+
},
|
|
247
|
+
"imported": [
|
|
248
|
+
{
|
|
249
|
+
"uid": "a31f-168"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"uid": "a31f-179"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"uid": "a31f-160"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"uid": "a31f-162"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"uid": "a31f-164"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"uid": "a31f-166"
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"importedBy": [
|
|
268
|
+
{
|
|
269
|
+
"uid": "a31f-176"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"uid": "a31f-172"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"uid": "a31f-174"
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
"a31f-172": {
|
|
280
|
+
"id": "/packages/react-router/src/scroll-restoration.tsx",
|
|
281
|
+
"moduleParts": {
|
|
282
|
+
"index.production.js": "a31f-173"
|
|
283
|
+
},
|
|
284
|
+
"imported": [
|
|
285
|
+
{
|
|
286
|
+
"uid": "a31f-179"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"uid": "a31f-166"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"uid": "a31f-170"
|
|
293
|
+
}
|
|
294
|
+
],
|
|
295
|
+
"importedBy": [
|
|
296
|
+
{
|
|
297
|
+
"uid": "a31f-176"
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
"a31f-174": {
|
|
302
|
+
"id": "/packages/react-router/src/awaited.tsx",
|
|
303
|
+
"moduleParts": {
|
|
304
|
+
"index.production.js": "a31f-175"
|
|
305
|
+
},
|
|
306
|
+
"imported": [
|
|
307
|
+
{
|
|
308
|
+
"uid": "a31f-166"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"uid": "a31f-170"
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"importedBy": [
|
|
315
|
+
{
|
|
316
|
+
"uid": "a31f-176"
|
|
317
|
+
}
|
|
318
|
+
]
|
|
319
|
+
},
|
|
320
|
+
"a31f-176": {
|
|
77
321
|
"id": "/packages/react-router/src/index.tsx",
|
|
78
322
|
"moduleParts": {
|
|
79
|
-
"index.production.js": "
|
|
323
|
+
"index.production.js": "a31f-177"
|
|
80
324
|
},
|
|
81
325
|
"imported": [
|
|
82
326
|
{
|
|
83
|
-
"uid": "
|
|
327
|
+
"uid": "a31f-160"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"uid": "a31f-166"
|
|
84
331
|
},
|
|
85
332
|
{
|
|
86
|
-
"uid": "
|
|
333
|
+
"uid": "a31f-170"
|
|
87
334
|
},
|
|
88
335
|
{
|
|
89
|
-
"uid": "
|
|
336
|
+
"uid": "a31f-172"
|
|
90
337
|
},
|
|
91
338
|
{
|
|
92
|
-
"uid": "
|
|
339
|
+
"uid": "a31f-174"
|
|
93
340
|
}
|
|
94
341
|
],
|
|
95
342
|
"importedBy": [],
|
|
96
343
|
"isEntry": true
|
|
97
344
|
},
|
|
98
|
-
"
|
|
99
|
-
"id": "
|
|
345
|
+
"a31f-178": {
|
|
346
|
+
"id": "use-sync-external-store/shim/with-selector",
|
|
100
347
|
"moduleParts": {},
|
|
101
348
|
"imported": [],
|
|
102
349
|
"importedBy": [
|
|
103
350
|
{
|
|
104
|
-
"uid": "
|
|
351
|
+
"uid": "a31f-160"
|
|
105
352
|
}
|
|
106
353
|
],
|
|
107
354
|
"isExternal": true
|
|
108
355
|
},
|
|
109
|
-
"
|
|
110
|
-
"id": "
|
|
356
|
+
"a31f-179": {
|
|
357
|
+
"id": "react",
|
|
111
358
|
"moduleParts": {},
|
|
112
359
|
"imported": [],
|
|
113
360
|
"importedBy": [
|
|
114
361
|
{
|
|
115
|
-
"uid": "
|
|
362
|
+
"uid": "a31f-170"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"uid": "a31f-172"
|
|
116
366
|
}
|
|
117
367
|
],
|
|
118
368
|
"isExternal": true
|
|
119
369
|
}
|
|
120
370
|
},
|
|
121
371
|
"env": {
|
|
122
|
-
"rollup": "2.
|
|
372
|
+
"rollup": "2.79.1"
|
|
123
373
|
},
|
|
124
374
|
"options": {
|
|
125
375
|
"gzip": true,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DeferredPromise } from '@tanstack/router-core';
|
|
2
|
+
export type AwaitOptions<T> = {
|
|
3
|
+
promise: DeferredPromise<T>;
|
|
4
|
+
};
|
|
5
|
+
export declare function useAwaited<T>({ promise }: AwaitOptions<T>): [T];
|
|
6
|
+
export declare function Await<T>(props: AwaitOptions<T> & {
|
|
7
|
+
children: (result: T) => JSX.Element;
|
|
8
|
+
}): JSX.Element;
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,106 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
* react-router
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) TanStack
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
-
*
|
|
9
|
-
* @license MIT
|
|
10
|
-
*/
|
|
11
|
-
import * as React from 'react';
|
|
12
|
-
import { AnyRouteConfig, RouteConfig, AnyAllRouteInfo, AllRouteInfo, RouterState, RouteMatch, ToOptions, MatchRouteOptions, RouteInfoByPath, ResolveRelativePath, NoInfer, DefaultAllRouteInfo, AnyRouteInfo, RouteInfo, CheckId, ToIdOption, ValidFromPath, LinkOptions, Router, RouterOptions } from '@tanstack/router-core';
|
|
1
|
+
export { useStore } from '@tanstack/react-store';
|
|
13
2
|
export * from '@tanstack/router-core';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type ResolvedRouter = ResolveRouter extends {
|
|
18
|
-
router: Router<infer TRouteConfig, infer TAllRouteInfo>;
|
|
19
|
-
} ? Router<TRouteConfig, TAllRouteInfo> : Router;
|
|
20
|
-
type ResolvedAllRouteInfo = ResolveRouter extends {
|
|
21
|
-
router: Router<infer TRouteConfig, infer TAllRouteInfo>;
|
|
22
|
-
} ? TAllRouteInfo : AnyAllRouteInfo;
|
|
23
|
-
type SyncRouteComponent = (props?: {}) => JSX.Element | React.ReactNode;
|
|
24
|
-
type RouteComponent = SyncRouteComponent & {
|
|
25
|
-
preload?: () => Promise<SyncRouteComponent>;
|
|
26
|
-
};
|
|
27
|
-
declare function lazy(importer: () => Promise<{
|
|
28
|
-
default: SyncRouteComponent;
|
|
29
|
-
}>): RouteComponent;
|
|
30
|
-
declare module '@tanstack/router-core' {
|
|
31
|
-
interface FrameworkGenerics {
|
|
32
|
-
Component: RouteComponent;
|
|
33
|
-
}
|
|
34
|
-
interface Router<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>> {
|
|
35
|
-
useState: () => RouterState;
|
|
36
|
-
useRoute: <TId extends keyof TAllRouteInfo['routeInfoById']>(routeId: TId) => Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]>;
|
|
37
|
-
useMatch: <TId extends keyof TAllRouteInfo['routeInfoById'], TStrict extends true | false = true>(routeId: TId, opts?: {
|
|
38
|
-
strict?: TStrict;
|
|
39
|
-
}) => TStrict extends true ? RouteMatch<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]> : RouteMatch<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]> | undefined;
|
|
40
|
-
linkProps: <TTo extends string = '.'>(props: LinkPropsOptions<TAllRouteInfo, '/', TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>) => React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
41
|
-
Link: <TTo extends string = '.'>(props: LinkPropsOptions<TAllRouteInfo, '/', TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement> & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {
|
|
42
|
-
children?: React.ReactNode | ((state: {
|
|
43
|
-
isActive: boolean;
|
|
44
|
-
}) => React.ReactNode);
|
|
45
|
-
}) => JSX.Element;
|
|
46
|
-
MatchRoute: <TTo extends string = '.'>(props: ToOptions<TAllRouteInfo, '/', TTo> & MatchRouteOptions & {
|
|
47
|
-
children?: React.ReactNode | ((params: RouteInfoByPath<TAllRouteInfo, ResolveRelativePath<'/', NoInfer<TTo>>>['allParams']) => React.ReactNode);
|
|
48
|
-
}) => JSX.Element;
|
|
49
|
-
}
|
|
50
|
-
interface Route<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouteInfo extends AnyRouteInfo = RouteInfo> {
|
|
51
|
-
useRoute: <TTo extends string = '.', TResolved extends string = ResolveRelativePath<TRouteInfo['id'], NoInfer<TTo>>>(routeId: CheckId<TAllRouteInfo, TResolved, ToIdOption<TAllRouteInfo, TRouteInfo['id'], TTo>>, opts?: {
|
|
52
|
-
strict?: boolean;
|
|
53
|
-
}) => Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TResolved]>;
|
|
54
|
-
linkProps: <TTo extends string = '.'>(props: LinkPropsOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>) => React.AnchorHTMLAttributes<HTMLAnchorElement>;
|
|
55
|
-
Link: <TTo extends string = '.'>(props: LinkPropsOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement> & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {
|
|
56
|
-
children?: React.ReactNode | ((state: {
|
|
57
|
-
isActive: boolean;
|
|
58
|
-
}) => React.ReactNode);
|
|
59
|
-
}) => JSX.Element;
|
|
60
|
-
MatchRoute: <TTo extends string = '.'>(props: ToOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo> & MatchRouteOptions & {
|
|
61
|
-
children?: React.ReactNode | ((params: RouteInfoByPath<TAllRouteInfo, ResolveRelativePath<TRouteInfo['fullPath'], NoInfer<TTo>>>['allParams']) => React.ReactNode);
|
|
62
|
-
}) => JSX.Element;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
type LinkPropsOptions<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = LinkOptions<TAllRouteInfo, TFrom, TTo> & {
|
|
66
|
-
activeProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>);
|
|
67
|
-
inactiveProps?: React.AnchorHTMLAttributes<HTMLAnchorElement> | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>);
|
|
68
|
-
};
|
|
69
|
-
type PromptProps = {
|
|
70
|
-
message: string;
|
|
71
|
-
when?: boolean | any;
|
|
72
|
-
children?: React.ReactNode;
|
|
73
|
-
};
|
|
74
|
-
declare function Link<TTo extends string = '.'>(props: LinkPropsOptions<ResolvedAllRouteInfo, '/', TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement> & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {
|
|
75
|
-
children?: React.ReactNode | ((state: {
|
|
76
|
-
isActive: boolean;
|
|
77
|
-
}) => React.ReactNode);
|
|
78
|
-
}): JSX.Element;
|
|
79
|
-
declare const matchesContext: React.Context<RouteMatch<DefaultAllRouteInfo, RouteInfo<string, string, string, string, {}, {}, {}, unknown, unknown, {}, {}, {}, {}, Record<never, string>, {}>>[]>;
|
|
80
|
-
declare const routerContext: React.Context<{
|
|
81
|
-
router: ResolvedRouter;
|
|
82
|
-
}>;
|
|
83
|
-
type MatchesProviderProps = {
|
|
84
|
-
value: RouteMatch[];
|
|
85
|
-
children: React.ReactNode;
|
|
86
|
-
};
|
|
87
|
-
declare function MatchesProvider(props: MatchesProviderProps): JSX.Element;
|
|
88
|
-
declare function createReactRouter<TRouteConfig extends AnyRouteConfig = RouteConfig>(opts: RouterOptions<TRouteConfig>): Router<TRouteConfig>;
|
|
89
|
-
type RouterProps<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo> = RouterOptions<TRouteConfig> & {
|
|
90
|
-
router: Router<TRouteConfig, TAllRouteInfo>;
|
|
91
|
-
children?: React.ReactNode;
|
|
92
|
-
};
|
|
93
|
-
declare function RouterProvider<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo>({ children, router, ...rest }: RouterProps<TRouteConfig, TAllRouteInfo>): JSX.Element;
|
|
94
|
-
declare function useRouter(): ResolvedRouter;
|
|
95
|
-
declare function useMatches(): RouteMatch[];
|
|
96
|
-
declare function useMatch<TId extends keyof ResolvedAllRouteInfo['routeInfoById'], TStrict extends true | false = true>(routeId: TId, opts?: {
|
|
97
|
-
strict?: TStrict;
|
|
98
|
-
}): TStrict extends true ? RouteMatch<ResolvedAllRouteInfo, ResolvedAllRouteInfo['routeInfoById'][TId]> : RouteMatch<ResolvedAllRouteInfo, ResolvedAllRouteInfo['routeInfoById'][TId]> | undefined;
|
|
99
|
-
declare function Outlet(): JSX.Element | null;
|
|
100
|
-
declare function DefaultErrorBoundary({ error }: {
|
|
101
|
-
error: any;
|
|
102
|
-
}): JSX.Element;
|
|
103
|
-
declare function usePrompt(message: string, when: boolean | any): void;
|
|
104
|
-
declare function Prompt({ message, when, children }: PromptProps): React.ReactNode;
|
|
105
|
-
|
|
106
|
-
export { DefaultErrorBoundary, Link, MatchesProvider, MatchesProviderProps, Outlet, Prompt, PromptProps, ResolveRouter, ResolvedAllRouteInfo, ResolvedRouter, RouteComponent, RouterProps, RouterProvider, SyncRouteComponent, createReactRouter, lazy, matchesContext, routerContext, useMatch, useMatches, usePrompt, useRouter };
|
|
3
|
+
export * from './react';
|
|
4
|
+
export * from './scroll-restoration';
|
|
5
|
+
export * from './awaited';
|