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