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