@kitbag/router 0.21.0 → 0.22.0

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.
Files changed (54) hide show
  1. package/README.md +9 -0
  2. package/dist/components/routerLink.d.ts +3 -3
  3. package/dist/compositions/useLink.d.ts +2 -2
  4. package/dist/devtools/createRouterDevtools.d.ts +13 -0
  5. package/dist/devtools/filters.d.ts +12 -0
  6. package/dist/devtools/getDevtoolsLabel.d.ts +13 -0
  7. package/dist/devtools/types.d.ts +10 -0
  8. package/dist/errors/invalidRouteRedirectError.d.ts +11 -0
  9. package/dist/errors/multipleRouteRedirectsError.d.ts +13 -0
  10. package/dist/kitbag-router.js +5256 -2004
  11. package/dist/kitbag-router.umd.cjs +3 -3
  12. package/dist/main.d.ts +1 -1
  13. package/dist/models/hooks.d.ts +9 -7
  14. package/dist/services/createComponentHooks.d.ts +5 -5
  15. package/dist/services/createExternalRoute.d.ts +3 -2
  16. package/dist/services/createRoute.d.ts +2 -1
  17. package/dist/services/createRouteHooks.d.ts +17 -0
  18. package/dist/services/createRouteRedirects.d.ts +10 -0
  19. package/dist/services/createRouterAssets.d.ts +5 -5
  20. package/dist/services/createRouterHooks.d.ts +8 -9
  21. package/dist/services/insertBaseRoute.d.ts +2 -2
  22. package/dist/services/routeMatchRules.d.ts +0 -1
  23. package/dist/services/routeMatchScore.d.ts +1 -1
  24. package/dist/services/routeRegex.d.ts +1 -0
  25. package/dist/services/urlAssembly.d.ts +2 -2
  26. package/dist/services/urlCombine.d.ts +2 -3
  27. package/dist/services/urlCreator.d.ts +2 -3
  28. package/dist/services/urlParser.d.ts +1 -1
  29. package/dist/types/hooks.d.ts +56 -28
  30. package/dist/types/params.d.ts +5 -11
  31. package/dist/types/redirects.d.ts +40 -0
  32. package/dist/types/resolved.d.ts +12 -2
  33. package/dist/types/route.d.ts +0 -2
  34. package/dist/types/router.d.ts +12 -7
  35. package/dist/types/routerLink.d.ts +3 -3
  36. package/dist/types/routerPush.d.ts +2 -2
  37. package/dist/types/routerReplace.d.ts +2 -2
  38. package/dist/types/urlString.d.ts +23 -0
  39. package/dist/types/useLink.d.ts +2 -2
  40. package/dist/utilities/checkDuplicateParams.spec.d.ts +1 -0
  41. package/dist/utilities/index.d.ts +1 -1
  42. package/dist/utilities/isNamedRoute.d.ts +4 -0
  43. package/dist/utilities/makeOptional.d.ts +0 -1
  44. package/dist/utilities/testHelpers.d.ts +450 -18
  45. package/package.json +7 -7
  46. package/dist/errors/missingRouteContextError.d.ts +0 -10
  47. package/dist/services/createHooksFactory.d.ts +0 -15
  48. package/dist/services/createUrlParts.d.ts +0 -13
  49. package/dist/types/url.d.ts +0 -14
  50. package/dist/types/urlParts.d.ts +0 -53
  51. package/dist/utilities/checkMissingContext.d.ts +0 -2
  52. /package/dist/{utilities/checkDuplicateKeys.spec.d.ts → services/createRouteRedirects.spec.d.ts} +0 -0
  53. /package/dist/{utilities/checkMissingContext.spec copy.d.ts → types/redirects.spec-d.d.ts} +0 -0
  54. /package/dist/utilities/{checkDuplicateKeys.d.ts → checkDuplicateParams.d.ts} +0 -0
@@ -22,7 +22,14 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
22
22
  id: string;
23
23
  props: undefined;
24
24
  meta: Readonly<{}>;
25
- }], []>, []>, import('../main').Route<"parentA.childA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childA/[?paramB]", {
25
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
26
+ readonly name: "parentA";
27
+ readonly path: "/parentA/[paramA]";
28
+ }, "meta" | "props"> & {
29
+ id: string;
30
+ props: undefined;
31
+ meta: Readonly<{}>;
32
+ }], []>>, import('../main').Route<"parentA.childA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childA/[?paramB]", {
26
33
  paramA: StringConstructor;
27
34
  } & {
28
35
  paramB: StringConstructor;
@@ -48,7 +55,14 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
48
55
  id: string;
49
56
  props: undefined;
50
57
  meta: Readonly<{}>;
51
- }], []>, []>;
58
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
59
+ readonly name: "parentA";
60
+ readonly path: "/parentA/[paramA]";
61
+ }, "meta" | "props"> & {
62
+ id: string;
63
+ props: undefined;
64
+ meta: Readonly<{}>;
65
+ }], []>>;
52
66
  readonly name: "parentA.childA";
53
67
  readonly path: "/childA/[?paramB]";
54
68
  }, "meta" | "props"> & {
@@ -81,14 +95,61 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
81
95
  id: string;
82
96
  props: undefined;
83
97
  meta: Readonly<{}>;
84
- }], []>, []>;
98
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
99
+ readonly name: "parentA";
100
+ readonly path: "/parentA/[paramA]";
101
+ }, "meta" | "props"> & {
102
+ id: string;
103
+ props: undefined;
104
+ meta: Readonly<{}>;
105
+ }], []>>;
85
106
  readonly name: "parentA.childA";
86
107
  readonly path: "/childA/[?paramB]";
87
108
  }, "meta" | "props"> & {
88
109
  id: string;
89
110
  props: undefined;
90
111
  meta: Readonly<{}>;
91
- }], []>, []>, import('../main').Route<"parentA.childB", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childB/[paramD]", {
112
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA.childA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childA/[?paramB]", {
113
+ paramA: StringConstructor;
114
+ } & {
115
+ paramB: StringConstructor;
116
+ }>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
117
+ readonly name: "parentA";
118
+ readonly path: "/parentA/[paramA]";
119
+ }, "meta" | "props"> & {
120
+ id: string;
121
+ props: undefined;
122
+ meta: Readonly<{}>;
123
+ }, Omit<{
124
+ readonly parent: import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
125
+ readonly name: "parentA";
126
+ readonly path: "/parentA/[paramA]";
127
+ }, "meta" | "props"> & {
128
+ id: string;
129
+ props: undefined;
130
+ meta: Readonly<{}>;
131
+ }], []> & import('../main').InternalRouteHooks<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
132
+ readonly name: "parentA";
133
+ readonly path: "/parentA/[paramA]";
134
+ }, "meta" | "props"> & {
135
+ id: string;
136
+ props: undefined;
137
+ meta: Readonly<{}>;
138
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
139
+ readonly name: "parentA";
140
+ readonly path: "/parentA/[paramA]";
141
+ }, "meta" | "props"> & {
142
+ id: string;
143
+ props: undefined;
144
+ meta: Readonly<{}>;
145
+ }], []>>;
146
+ readonly name: "parentA.childA";
147
+ readonly path: "/childA/[?paramB]";
148
+ }, "meta" | "props"> & {
149
+ id: string;
150
+ props: undefined;
151
+ meta: Readonly<{}>;
152
+ }], []>>, import('../main').Route<"parentA.childB", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childB/[paramD]", {
92
153
  paramA: StringConstructor;
93
154
  } & {
94
155
  paramD: StringConstructor;
@@ -114,7 +175,14 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
114
175
  id: string;
115
176
  props: undefined;
116
177
  meta: Readonly<{}>;
117
- }], []>, []>;
178
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
179
+ readonly name: "parentA";
180
+ readonly path: "/parentA/[paramA]";
181
+ }, "meta" | "props"> & {
182
+ id: string;
183
+ props: undefined;
184
+ meta: Readonly<{}>;
185
+ }], []>>;
118
186
  readonly name: "parentA.childB";
119
187
  readonly path: "/childB/[paramD]";
120
188
  readonly component: {
@@ -150,7 +218,57 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
150
218
  id: string;
151
219
  props: undefined;
152
220
  meta: Readonly<{}>;
153
- }], []>, []>;
221
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
222
+ readonly name: "parentA";
223
+ readonly path: "/parentA/[paramA]";
224
+ }, "meta" | "props"> & {
225
+ id: string;
226
+ props: undefined;
227
+ meta: Readonly<{}>;
228
+ }], []>>;
229
+ readonly name: "parentA.childB";
230
+ readonly path: "/childB/[paramD]";
231
+ readonly component: {
232
+ template: string;
233
+ };
234
+ }, "meta" | "props"> & {
235
+ id: string;
236
+ props: undefined;
237
+ meta: Readonly<{}>;
238
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA.childB", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childB/[paramD]", {
239
+ paramA: StringConstructor;
240
+ } & {
241
+ paramD: StringConstructor;
242
+ }>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
243
+ readonly name: "parentA";
244
+ readonly path: "/parentA/[paramA]";
245
+ }, "meta" | "props"> & {
246
+ id: string;
247
+ props: undefined;
248
+ meta: Readonly<{}>;
249
+ }, Omit<{
250
+ readonly parent: import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
251
+ readonly name: "parentA";
252
+ readonly path: "/parentA/[paramA]";
253
+ }, "meta" | "props"> & {
254
+ id: string;
255
+ props: undefined;
256
+ meta: Readonly<{}>;
257
+ }], []> & import('../main').InternalRouteHooks<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
258
+ readonly name: "parentA";
259
+ readonly path: "/parentA/[paramA]";
260
+ }, "meta" | "props"> & {
261
+ id: string;
262
+ props: undefined;
263
+ meta: Readonly<{}>;
264
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
265
+ readonly name: "parentA";
266
+ readonly path: "/parentA/[paramA]";
267
+ }, "meta" | "props"> & {
268
+ id: string;
269
+ props: undefined;
270
+ meta: Readonly<{}>;
271
+ }], []>>;
154
272
  readonly name: "parentA.childB";
155
273
  readonly path: "/childB/[paramD]";
156
274
  readonly component: {
@@ -160,7 +278,7 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
160
278
  id: string;
161
279
  props: undefined;
162
280
  meta: Readonly<{}>;
163
- }], []>, []>, import('../main').Route<"parentA.childA.grandChildA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childA/[?paramB]/[paramC]", {
281
+ }], []>>, import('../main').Route<"parentA.childA.grandChildA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childA/[?paramB]/[paramC]", {
164
282
  paramA: StringConstructor;
165
283
  paramB: StringConstructor;
166
284
  } & {
@@ -187,7 +305,14 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
187
305
  id: string;
188
306
  props: undefined;
189
307
  meta: Readonly<{}>;
190
- }], []>, []>;
308
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
309
+ readonly name: "parentA";
310
+ readonly path: "/parentA/[paramA]";
311
+ }, "meta" | "props"> & {
312
+ id: string;
313
+ props: undefined;
314
+ meta: Readonly<{}>;
315
+ }], []>>;
191
316
  readonly name: "parentA.childA";
192
317
  readonly path: "/childA/[?paramB]";
193
318
  }, "meta" | "props"> & {
@@ -221,7 +346,14 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
221
346
  id: string;
222
347
  props: undefined;
223
348
  meta: Readonly<{}>;
224
- }], []>, []>;
349
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
350
+ readonly name: "parentA";
351
+ readonly path: "/parentA/[paramA]";
352
+ }, "meta" | "props"> & {
353
+ id: string;
354
+ props: undefined;
355
+ meta: Readonly<{}>;
356
+ }], []>>;
225
357
  readonly name: "parentA.childA";
226
358
  readonly path: "/childA/[?paramB]";
227
359
  }, "meta" | "props"> & {
@@ -254,14 +386,61 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
254
386
  id: string;
255
387
  props: undefined;
256
388
  meta: Readonly<{}>;
257
- }], []>, []>;
389
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
390
+ readonly name: "parentA";
391
+ readonly path: "/parentA/[paramA]";
392
+ }, "meta" | "props"> & {
393
+ id: string;
394
+ props: undefined;
395
+ meta: Readonly<{}>;
396
+ }], []>>;
258
397
  readonly name: "parentA.childA";
259
398
  readonly path: "/childA/[?paramB]";
260
399
  }, "meta" | "props"> & {
261
400
  id: string;
262
401
  props: undefined;
263
402
  meta: Readonly<{}>;
264
- }], []>, []>;
403
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA.childA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childA/[?paramB]", {
404
+ paramA: StringConstructor;
405
+ } & {
406
+ paramB: StringConstructor;
407
+ }>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
408
+ readonly name: "parentA";
409
+ readonly path: "/parentA/[paramA]";
410
+ }, "meta" | "props"> & {
411
+ id: string;
412
+ props: undefined;
413
+ meta: Readonly<{}>;
414
+ }, Omit<{
415
+ readonly parent: import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
416
+ readonly name: "parentA";
417
+ readonly path: "/parentA/[paramA]";
418
+ }, "meta" | "props"> & {
419
+ id: string;
420
+ props: undefined;
421
+ meta: Readonly<{}>;
422
+ }], []> & import('../main').InternalRouteHooks<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
423
+ readonly name: "parentA";
424
+ readonly path: "/parentA/[paramA]";
425
+ }, "meta" | "props"> & {
426
+ id: string;
427
+ props: undefined;
428
+ meta: Readonly<{}>;
429
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
430
+ readonly name: "parentA";
431
+ readonly path: "/parentA/[paramA]";
432
+ }, "meta" | "props"> & {
433
+ id: string;
434
+ props: undefined;
435
+ meta: Readonly<{}>;
436
+ }], []>>;
437
+ readonly name: "parentA.childA";
438
+ readonly path: "/childA/[?paramB]";
439
+ }, "meta" | "props"> & {
440
+ id: string;
441
+ props: undefined;
442
+ meta: Readonly<{}>;
443
+ }], []>>;
265
444
  readonly name: "parentA.childA.grandChildA";
266
445
  readonly path: "/[paramC]";
267
446
  readonly component: {
@@ -298,7 +477,186 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
298
477
  id: string;
299
478
  props: undefined;
300
479
  meta: Readonly<{}>;
301
- }], []>, []>;
480
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
481
+ readonly name: "parentA";
482
+ readonly path: "/parentA/[paramA]";
483
+ }, "meta" | "props"> & {
484
+ id: string;
485
+ props: undefined;
486
+ meta: Readonly<{}>;
487
+ }], []>>;
488
+ readonly name: "parentA.childA";
489
+ readonly path: "/childA/[?paramB]";
490
+ }, "meta" | "props"> & {
491
+ id: string;
492
+ props: undefined;
493
+ meta: Readonly<{}>;
494
+ }, Omit<{
495
+ readonly parent: import('../main').Route<"parentA.childA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childA/[?paramB]", {
496
+ paramA: StringConstructor;
497
+ } & {
498
+ paramB: StringConstructor;
499
+ }>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
500
+ readonly name: "parentA";
501
+ readonly path: "/parentA/[paramA]";
502
+ }, "meta" | "props"> & {
503
+ id: string;
504
+ props: undefined;
505
+ meta: Readonly<{}>;
506
+ }, Omit<{
507
+ readonly parent: import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
508
+ readonly name: "parentA";
509
+ readonly path: "/parentA/[paramA]";
510
+ }, "meta" | "props"> & {
511
+ id: string;
512
+ props: undefined;
513
+ meta: Readonly<{}>;
514
+ }], []> & import('../main').InternalRouteHooks<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
515
+ readonly name: "parentA";
516
+ readonly path: "/parentA/[paramA]";
517
+ }, "meta" | "props"> & {
518
+ id: string;
519
+ props: undefined;
520
+ meta: Readonly<{}>;
521
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
522
+ readonly name: "parentA";
523
+ readonly path: "/parentA/[paramA]";
524
+ }, "meta" | "props"> & {
525
+ id: string;
526
+ props: undefined;
527
+ meta: Readonly<{}>;
528
+ }], []>>;
529
+ readonly name: "parentA.childA";
530
+ readonly path: "/childA/[?paramB]";
531
+ }, "meta" | "props"> & {
532
+ id: string;
533
+ props: undefined;
534
+ meta: Readonly<{}>;
535
+ }], []> & import('../main').InternalRouteHooks<import('../main').Route<"parentA.childA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childA/[?paramB]", {
536
+ paramA: StringConstructor;
537
+ } & {
538
+ paramB: StringConstructor;
539
+ }>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
540
+ readonly name: "parentA";
541
+ readonly path: "/parentA/[paramA]";
542
+ }, "meta" | "props"> & {
543
+ id: string;
544
+ props: undefined;
545
+ meta: Readonly<{}>;
546
+ }, Omit<{
547
+ readonly parent: import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
548
+ readonly name: "parentA";
549
+ readonly path: "/parentA/[paramA]";
550
+ }, "meta" | "props"> & {
551
+ id: string;
552
+ props: undefined;
553
+ meta: Readonly<{}>;
554
+ }], []> & import('../main').InternalRouteHooks<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
555
+ readonly name: "parentA";
556
+ readonly path: "/parentA/[paramA]";
557
+ }, "meta" | "props"> & {
558
+ id: string;
559
+ props: undefined;
560
+ meta: Readonly<{}>;
561
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
562
+ readonly name: "parentA";
563
+ readonly path: "/parentA/[paramA]";
564
+ }, "meta" | "props"> & {
565
+ id: string;
566
+ props: undefined;
567
+ meta: Readonly<{}>;
568
+ }], []>>;
569
+ readonly name: "parentA.childA";
570
+ readonly path: "/childA/[?paramB]";
571
+ }, "meta" | "props"> & {
572
+ id: string;
573
+ props: undefined;
574
+ meta: Readonly<{}>;
575
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA.childA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childA/[?paramB]", {
576
+ paramA: StringConstructor;
577
+ } & {
578
+ paramB: StringConstructor;
579
+ }>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
580
+ readonly name: "parentA";
581
+ readonly path: "/parentA/[paramA]";
582
+ }, "meta" | "props"> & {
583
+ id: string;
584
+ props: undefined;
585
+ meta: Readonly<{}>;
586
+ }, Omit<{
587
+ readonly parent: import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
588
+ readonly name: "parentA";
589
+ readonly path: "/parentA/[paramA]";
590
+ }, "meta" | "props"> & {
591
+ id: string;
592
+ props: undefined;
593
+ meta: Readonly<{}>;
594
+ }], []> & import('../main').InternalRouteHooks<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
595
+ readonly name: "parentA";
596
+ readonly path: "/parentA/[paramA]";
597
+ }, "meta" | "props"> & {
598
+ id: string;
599
+ props: undefined;
600
+ meta: Readonly<{}>;
601
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
602
+ readonly name: "parentA";
603
+ readonly path: "/parentA/[paramA]";
604
+ }, "meta" | "props"> & {
605
+ id: string;
606
+ props: undefined;
607
+ meta: Readonly<{}>;
608
+ }], []>>;
609
+ readonly name: "parentA.childA";
610
+ readonly path: "/childA/[?paramB]";
611
+ }, "meta" | "props"> & {
612
+ id: string;
613
+ props: undefined;
614
+ meta: Readonly<{}>;
615
+ }], []>>;
616
+ readonly name: "parentA.childA.grandChildA";
617
+ readonly path: "/[paramC]";
618
+ readonly component: {
619
+ template: string;
620
+ };
621
+ }, "meta" | "props"> & {
622
+ id: string;
623
+ props: undefined;
624
+ meta: Readonly<{}>;
625
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA.childA.grandChildA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childA/[?paramB]/[paramC]", {
626
+ paramA: StringConstructor;
627
+ paramB: StringConstructor;
628
+ } & {
629
+ paramC: StringConstructor;
630
+ }>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
631
+ readonly name: "parentA";
632
+ readonly path: "/parentA/[paramA]";
633
+ }, "meta" | "props"> & {
634
+ id: string;
635
+ props: undefined;
636
+ meta: Readonly<{}>;
637
+ }, Omit<{
638
+ readonly parent: import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
639
+ readonly name: "parentA";
640
+ readonly path: "/parentA/[paramA]";
641
+ }, "meta" | "props"> & {
642
+ id: string;
643
+ props: undefined;
644
+ meta: Readonly<{}>;
645
+ }], []> & import('../main').InternalRouteHooks<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
646
+ readonly name: "parentA";
647
+ readonly path: "/parentA/[paramA]";
648
+ }, "meta" | "props"> & {
649
+ id: string;
650
+ props: undefined;
651
+ meta: Readonly<{}>;
652
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
653
+ readonly name: "parentA";
654
+ readonly path: "/parentA/[paramA]";
655
+ }, "meta" | "props"> & {
656
+ id: string;
657
+ props: undefined;
658
+ meta: Readonly<{}>;
659
+ }], []>>;
302
660
  readonly name: "parentA.childA";
303
661
  readonly path: "/childA/[?paramB]";
304
662
  }, "meta" | "props"> & {
@@ -332,7 +690,14 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
332
690
  id: string;
333
691
  props: undefined;
334
692
  meta: Readonly<{}>;
335
- }], []>, []>;
693
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
694
+ readonly name: "parentA";
695
+ readonly path: "/parentA/[paramA]";
696
+ }, "meta" | "props"> & {
697
+ id: string;
698
+ props: undefined;
699
+ meta: Readonly<{}>;
700
+ }], []>>;
336
701
  readonly name: "parentA.childA";
337
702
  readonly path: "/childA/[?paramB]";
338
703
  }, "meta" | "props"> & {
@@ -365,14 +730,61 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
365
730
  id: string;
366
731
  props: undefined;
367
732
  meta: Readonly<{}>;
368
- }], []>, []>;
733
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
734
+ readonly name: "parentA";
735
+ readonly path: "/parentA/[paramA]";
736
+ }, "meta" | "props"> & {
737
+ id: string;
738
+ props: undefined;
739
+ meta: Readonly<{}>;
740
+ }], []>>;
369
741
  readonly name: "parentA.childA";
370
742
  readonly path: "/childA/[?paramB]";
371
743
  }, "meta" | "props"> & {
372
744
  id: string;
373
745
  props: undefined;
374
746
  meta: Readonly<{}>;
375
- }], []>, []>;
747
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA.childA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]/childA/[?paramB]", {
748
+ paramA: StringConstructor;
749
+ } & {
750
+ paramB: StringConstructor;
751
+ }>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
752
+ readonly name: "parentA";
753
+ readonly path: "/parentA/[paramA]";
754
+ }, "meta" | "props"> & {
755
+ id: string;
756
+ props: undefined;
757
+ meta: Readonly<{}>;
758
+ }, Omit<{
759
+ readonly parent: import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
760
+ readonly name: "parentA";
761
+ readonly path: "/parentA/[paramA]";
762
+ }, "meta" | "props"> & {
763
+ id: string;
764
+ props: undefined;
765
+ meta: Readonly<{}>;
766
+ }], []> & import('../main').InternalRouteHooks<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
767
+ readonly name: "parentA";
768
+ readonly path: "/parentA/[paramA]";
769
+ }, "meta" | "props"> & {
770
+ id: string;
771
+ props: undefined;
772
+ meta: Readonly<{}>;
773
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentA", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentA/[paramA]", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
774
+ readonly name: "parentA";
775
+ readonly path: "/parentA/[paramA]";
776
+ }, "meta" | "props"> & {
777
+ id: string;
778
+ props: undefined;
779
+ meta: Readonly<{}>;
780
+ }], []>>;
781
+ readonly name: "parentA.childA";
782
+ readonly path: "/childA/[?paramB]";
783
+ }, "meta" | "props"> & {
784
+ id: string;
785
+ props: undefined;
786
+ meta: Readonly<{}>;
787
+ }], []>>;
376
788
  readonly name: "parentA.childA.grandChildA";
377
789
  readonly path: "/[paramC]";
378
790
  readonly component: {
@@ -382,7 +794,7 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
382
794
  id: string;
383
795
  props: undefined;
384
796
  meta: Readonly<{}>;
385
- }], []>, []>, import('../main').Route<"parentB", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentB", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
797
+ }], []>>, import('../main').Route<"parentB", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentB", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
386
798
  readonly name: "parentB";
387
799
  readonly path: "/parentB";
388
800
  readonly component: {
@@ -402,7 +814,17 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
402
814
  id: string;
403
815
  props: undefined;
404
816
  meta: Readonly<{}>;
405
- }], []>, []>, import('../main').Route<"parentC", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
817
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentB", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/parentB", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
818
+ readonly name: "parentB";
819
+ readonly path: "/parentB";
820
+ readonly component: {
821
+ template: string;
822
+ };
823
+ }, "meta" | "props"> & {
824
+ id: string;
825
+ props: undefined;
826
+ meta: Readonly<{}>;
827
+ }], []>>, import('../main').Route<"parentC", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
406
828
  readonly name: "parentC";
407
829
  readonly path: "/";
408
830
  readonly component: {
@@ -422,4 +844,14 @@ export declare const routes: readonly [import('../main').Route<"parentA", import
422
844
  id: string;
423
845
  props: undefined;
424
846
  meta: Readonly<{}>;
425
- }], []>, []>];
847
+ }], []>, []> & import('../types/redirects').RouteRedirects<import('../main').Route<"parentC", import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"/", {}>, import('../services/withParams').WithParams<"", {}>, import('../services/withParams').WithParams<"", {}>, Readonly<{}>, {}, [Omit<{
848
+ readonly name: "parentC";
849
+ readonly path: "/";
850
+ readonly component: {
851
+ template: string;
852
+ };
853
+ }, "meta" | "props"> & {
854
+ id: string;
855
+ props: undefined;
856
+ meta: Readonly<{}>;
857
+ }], []>>];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kitbag/router",
3
3
  "private": false,
4
- "version": "0.21.0",
4
+ "version": "0.22.0",
5
5
  "license": "MIT",
6
6
  "bugs": {
7
7
  "url": "https://github.com/kitbagjs/router/issues"
@@ -45,18 +45,18 @@
45
45
  "@vitejs/plugin-vue": "^6.0.3",
46
46
  "@vue/test-utils": "^2.4.6",
47
47
  "eslint": "^9.39.2",
48
- "globals": "^16.5.0",
49
- "happy-dom": "^20.0.11",
50
- "typedoc": "^0.28.15",
48
+ "globals": "^17.0.0",
49
+ "happy-dom": "^20.3.3",
50
+ "typedoc": "^0.28.16",
51
51
  "typedoc-plugin-markdown": "^4.9.0",
52
52
  "typedoc-vitepress-theme": "^1.1.2",
53
53
  "typescript": "^5.9.3",
54
54
  "valibot": "^1.0.0",
55
- "vite": "^7.3.0",
55
+ "vite": "^7.3.1",
56
56
  "vite-plugin-dts": "^4.5.4",
57
57
  "vitepress": "^1.6.4",
58
- "vitest": "^4.0.16",
59
- "vue-tsc": "^3.2.1",
58
+ "vitest": "^4.0.17",
59
+ "vue-tsc": "^3.2.2",
60
60
  "zod": "4.0.0"
61
61
  },
62
62
  "peerDependencies": {
@@ -1,10 +0,0 @@
1
- /**
2
- * An error thrown when context is missing in a route. When assigning a route or rejection to a route context, that route or rejection must also be included in the options sent to `createRouter`.
3
- */
4
- export declare class MissingRouteContextError extends Error {
5
- /**
6
- * Constructs a new MissingRouteContextError instance with a message indicating the missing context.
7
- * @param name - The name of the name that was duplicated.
8
- */
9
- constructor(name: string);
10
- }