@tanstack/router-core 1.132.0-alpha.4 → 1.132.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.
- package/dist/cjs/Matches.cjs +2 -1
- package/dist/cjs/Matches.cjs.map +1 -1
- package/dist/cjs/Matches.d.cts +2 -2
- package/dist/cjs/config.cjs +10 -0
- package/dist/cjs/config.cjs.map +1 -0
- package/dist/cjs/config.d.cts +17 -0
- package/dist/cjs/fileRoute.d.cts +3 -2
- package/dist/cjs/index.cjs +9 -2
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +10 -5
- package/dist/cjs/load-matches.cjs +5 -3
- package/dist/cjs/load-matches.cjs.map +1 -1
- package/dist/cjs/location.d.cts +38 -0
- package/dist/cjs/path.cjs +27 -64
- package/dist/cjs/path.cjs.map +1 -1
- package/dist/cjs/path.d.cts +6 -7
- package/dist/cjs/process-route-tree.cjs +144 -0
- package/dist/cjs/process-route-tree.cjs.map +1 -0
- package/dist/cjs/process-route-tree.d.cts +10 -0
- package/dist/cjs/redirect.cjs +1 -1
- package/dist/cjs/redirect.cjs.map +1 -1
- package/dist/cjs/rewrite.cjs +63 -0
- package/dist/cjs/rewrite.cjs.map +1 -0
- package/dist/cjs/rewrite.d.cts +22 -0
- package/dist/cjs/route.cjs.map +1 -1
- package/dist/cjs/route.d.cts +62 -44
- package/dist/cjs/router.cjs +102 -210
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +81 -44
- package/dist/cjs/scroll-restoration.cjs.map +1 -1
- package/dist/cjs/scroll-restoration.d.cts +9 -0
- package/dist/cjs/ssr/createRequestHandler.cjs +4 -1
- package/dist/cjs/ssr/createRequestHandler.cjs.map +1 -1
- package/dist/cjs/ssr/serializer/transformer.cjs +14 -12
- package/dist/cjs/ssr/serializer/transformer.cjs.map +1 -1
- package/dist/cjs/ssr/serializer/transformer.d.cts +55 -15
- package/dist/cjs/ssr/ssr-client.cjs.map +1 -1
- package/dist/cjs/ssr/ssr-server.cjs +5 -2
- package/dist/cjs/ssr/ssr-server.cjs.map +1 -1
- package/dist/cjs/ssr/ssr-server.d.cts +4 -1
- package/dist/cjs/utils.cjs +68 -46
- package/dist/cjs/utils.cjs.map +1 -1
- package/dist/esm/Matches.d.ts +2 -2
- package/dist/esm/Matches.js +2 -1
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/config.d.ts +17 -0
- package/dist/esm/config.js +10 -0
- package/dist/esm/config.js.map +1 -0
- package/dist/esm/fileRoute.d.ts +3 -2
- package/dist/esm/index.d.ts +10 -5
- package/dist/esm/index.js +10 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/load-matches.js +5 -3
- package/dist/esm/load-matches.js.map +1 -1
- package/dist/esm/location.d.ts +38 -0
- package/dist/esm/path.d.ts +6 -7
- package/dist/esm/path.js +27 -64
- package/dist/esm/path.js.map +1 -1
- package/dist/esm/process-route-tree.d.ts +10 -0
- package/dist/esm/process-route-tree.js +144 -0
- package/dist/esm/process-route-tree.js.map +1 -0
- package/dist/esm/redirect.js +1 -1
- package/dist/esm/redirect.js.map +1 -1
- package/dist/esm/rewrite.d.ts +22 -0
- package/dist/esm/rewrite.js +63 -0
- package/dist/esm/rewrite.js.map +1 -0
- package/dist/esm/route.d.ts +62 -44
- package/dist/esm/route.js.map +1 -1
- package/dist/esm/router.d.ts +81 -44
- package/dist/esm/router.js +104 -212
- package/dist/esm/router.js.map +1 -1
- package/dist/esm/scroll-restoration.d.ts +9 -0
- package/dist/esm/scroll-restoration.js.map +1 -1
- package/dist/esm/ssr/createRequestHandler.js +4 -1
- package/dist/esm/ssr/createRequestHandler.js.map +1 -1
- package/dist/esm/ssr/serializer/transformer.d.ts +55 -15
- package/dist/esm/ssr/serializer/transformer.js +14 -12
- package/dist/esm/ssr/serializer/transformer.js.map +1 -1
- package/dist/esm/ssr/ssr-client.js.map +1 -1
- package/dist/esm/ssr/ssr-server.d.ts +4 -1
- package/dist/esm/ssr/ssr-server.js +5 -2
- package/dist/esm/ssr/ssr-server.js.map +1 -1
- package/dist/esm/utils.js +68 -46
- package/dist/esm/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/Matches.ts +4 -3
- package/src/config.ts +42 -0
- package/src/fileRoute.ts +25 -3
- package/src/index.ts +23 -6
- package/src/load-matches.ts +31 -21
- package/src/location.ts +38 -0
- package/src/path.ts +44 -82
- package/src/process-route-tree.ts +233 -0
- package/src/redirect.ts +1 -1
- package/src/rewrite.ts +70 -0
- package/src/route.ts +311 -74
- package/src/router.ts +263 -389
- package/src/scroll-restoration.ts +1 -1
- package/src/ssr/createRequestHandler.ts +4 -1
- package/src/ssr/serializer/transformer.ts +168 -31
- package/src/ssr/server.ts +6 -0
- package/src/ssr/ssr-client.ts +2 -2
- package/src/ssr/ssr-server.ts +10 -7
- package/src/utils.ts +83 -61
package/src/route.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type {
|
|
|
15
15
|
} from './Matches'
|
|
16
16
|
import type { RootRouteId } from './root'
|
|
17
17
|
import type { ParseRoute, RouteById, RoutePaths } from './routeInfo'
|
|
18
|
-
import type { AnyRouter, RegisteredRouter } from './router'
|
|
18
|
+
import type { AnyRouter, Register, RegisteredRouter, SSROption } from './router'
|
|
19
19
|
import type { BuildLocationFn, NavigateFn } from './RouterProvider'
|
|
20
20
|
import type {
|
|
21
21
|
Assign,
|
|
@@ -41,6 +41,7 @@ import type {
|
|
|
41
41
|
ValidatorFn,
|
|
42
42
|
ValidatorObj,
|
|
43
43
|
} from './validators'
|
|
44
|
+
import type { ValidateSerializableLifecycleResult } from './ssr/serializer/transformer'
|
|
44
45
|
|
|
45
46
|
export type AnyPathParams = {}
|
|
46
47
|
|
|
@@ -377,6 +378,7 @@ export type MakeRemountDepsOptionsUnion<
|
|
|
377
378
|
: never
|
|
378
379
|
|
|
379
380
|
export interface RouteTypes<
|
|
381
|
+
in out TRegister,
|
|
380
382
|
in out TParentRoute extends AnyRoute,
|
|
381
383
|
in out TPath extends string,
|
|
382
384
|
in out TFullPath extends string,
|
|
@@ -391,6 +393,9 @@ export interface RouteTypes<
|
|
|
391
393
|
in out TLoaderFn,
|
|
392
394
|
in out TChildren,
|
|
393
395
|
in out TFileRouteTypes,
|
|
396
|
+
in out TSSR,
|
|
397
|
+
in out TServerMiddlewares,
|
|
398
|
+
in out THandlers,
|
|
394
399
|
> {
|
|
395
400
|
parentRoute: TParentRoute
|
|
396
401
|
path: TPath
|
|
@@ -422,8 +427,23 @@ export interface RouteTypes<
|
|
|
422
427
|
loaderData: ResolveLoaderData<TLoaderFn>
|
|
423
428
|
loaderDeps: TLoaderDeps
|
|
424
429
|
fileRouteTypes: TFileRouteTypes
|
|
430
|
+
ssr: ResolveSSR<TSSR>
|
|
431
|
+
allSsr: ResolveAllSSR<TParentRoute, TSSR>
|
|
425
432
|
}
|
|
426
433
|
|
|
434
|
+
export type ResolveSSR<TSSR> = TSSR extends (...args: ReadonlyArray<any>) => any
|
|
435
|
+
? LooseReturnType<TSSR>
|
|
436
|
+
: TSSR
|
|
437
|
+
|
|
438
|
+
export type ResolveAllSSR<
|
|
439
|
+
TParentRoute extends AnyRoute,
|
|
440
|
+
TSSR,
|
|
441
|
+
> = unknown extends TParentRoute
|
|
442
|
+
? ResolveSSR<TSSR>
|
|
443
|
+
: unknown extends TSSR
|
|
444
|
+
? TParentRoute['types']['ssr']
|
|
445
|
+
: ResolveSSR<TSSR>
|
|
446
|
+
|
|
427
447
|
export type ResolveFullPath<
|
|
428
448
|
TParentRoute extends AnyRoute,
|
|
429
449
|
TPath extends string,
|
|
@@ -440,6 +460,7 @@ export type RouteLazyFn<TRoute extends AnyRoute> = (
|
|
|
440
460
|
) => TRoute
|
|
441
461
|
|
|
442
462
|
export type RouteAddChildrenFn<
|
|
463
|
+
in out TRegister,
|
|
443
464
|
in out TParentRoute extends AnyRoute,
|
|
444
465
|
in out TPath extends string,
|
|
445
466
|
in out TFullPath extends string,
|
|
@@ -453,12 +474,16 @@ export type RouteAddChildrenFn<
|
|
|
453
474
|
in out TLoaderDeps extends Record<string, any>,
|
|
454
475
|
in out TLoaderFn,
|
|
455
476
|
in out TFileRouteTypes,
|
|
477
|
+
in out TSSR,
|
|
478
|
+
in out TServerMiddlewares,
|
|
479
|
+
in out THandlers,
|
|
456
480
|
> = <const TNewChildren>(
|
|
457
481
|
children: Constrain<
|
|
458
482
|
TNewChildren,
|
|
459
483
|
ReadonlyArray<AnyRoute> | Record<string, AnyRoute>
|
|
460
484
|
>,
|
|
461
485
|
) => Route<
|
|
486
|
+
TRegister,
|
|
462
487
|
TParentRoute,
|
|
463
488
|
TPath,
|
|
464
489
|
TFullPath,
|
|
@@ -472,10 +497,14 @@ export type RouteAddChildrenFn<
|
|
|
472
497
|
TLoaderDeps,
|
|
473
498
|
TLoaderFn,
|
|
474
499
|
TNewChildren,
|
|
475
|
-
TFileRouteTypes
|
|
500
|
+
TFileRouteTypes,
|
|
501
|
+
TSSR,
|
|
502
|
+
TServerMiddlewares,
|
|
503
|
+
THandlers
|
|
476
504
|
>
|
|
477
505
|
|
|
478
506
|
export type RouteAddFileChildrenFn<
|
|
507
|
+
in out TRegister,
|
|
479
508
|
in out TParentRoute extends AnyRoute,
|
|
480
509
|
in out TPath extends string,
|
|
481
510
|
in out TFullPath extends string,
|
|
@@ -489,9 +518,13 @@ export type RouteAddFileChildrenFn<
|
|
|
489
518
|
in out TLoaderDeps extends Record<string, any>,
|
|
490
519
|
in out TLoaderFn,
|
|
491
520
|
in out TFileRouteTypes,
|
|
521
|
+
in out TSSR,
|
|
522
|
+
in out TServerMiddlewares,
|
|
523
|
+
in out THandlers,
|
|
492
524
|
> = <const TNewChildren>(
|
|
493
525
|
children: TNewChildren,
|
|
494
526
|
) => Route<
|
|
527
|
+
TRegister,
|
|
495
528
|
TParentRoute,
|
|
496
529
|
TPath,
|
|
497
530
|
TFullPath,
|
|
@@ -505,10 +538,14 @@ export type RouteAddFileChildrenFn<
|
|
|
505
538
|
TLoaderDeps,
|
|
506
539
|
TLoaderFn,
|
|
507
540
|
TNewChildren,
|
|
508
|
-
TFileRouteTypes
|
|
541
|
+
TFileRouteTypes,
|
|
542
|
+
TSSR,
|
|
543
|
+
TServerMiddlewares,
|
|
544
|
+
THandlers
|
|
509
545
|
>
|
|
510
546
|
|
|
511
547
|
export type RouteAddFileTypesFn<
|
|
548
|
+
TRegister,
|
|
512
549
|
TParentRoute extends AnyRoute,
|
|
513
550
|
TPath extends string,
|
|
514
551
|
TFullPath extends string,
|
|
@@ -522,7 +559,11 @@ export type RouteAddFileTypesFn<
|
|
|
522
559
|
TLoaderDeps extends Record<string, any>,
|
|
523
560
|
TLoaderFn,
|
|
524
561
|
TChildren,
|
|
562
|
+
TSSR,
|
|
563
|
+
TServerMiddlewares,
|
|
564
|
+
THandlers,
|
|
525
565
|
> = <TNewFileRouteTypes>() => Route<
|
|
566
|
+
TRegister,
|
|
526
567
|
TParentRoute,
|
|
527
568
|
TPath,
|
|
528
569
|
TFullPath,
|
|
@@ -536,10 +577,14 @@ export type RouteAddFileTypesFn<
|
|
|
536
577
|
TLoaderDeps,
|
|
537
578
|
TLoaderFn,
|
|
538
579
|
TChildren,
|
|
539
|
-
TNewFileRouteTypes
|
|
580
|
+
TNewFileRouteTypes,
|
|
581
|
+
TSSR,
|
|
582
|
+
TServerMiddlewares,
|
|
583
|
+
THandlers
|
|
540
584
|
>
|
|
541
585
|
|
|
542
586
|
export interface Route<
|
|
587
|
+
in out TRegister,
|
|
543
588
|
in out TParentRoute extends AnyRoute,
|
|
544
589
|
in out TPath extends string,
|
|
545
590
|
in out TFullPath extends string,
|
|
@@ -554,11 +599,15 @@ export interface Route<
|
|
|
554
599
|
in out TLoaderFn,
|
|
555
600
|
in out TChildren,
|
|
556
601
|
in out TFileRouteTypes,
|
|
602
|
+
in out TSSR,
|
|
603
|
+
in out TServerMiddlewares,
|
|
604
|
+
in out THandlers,
|
|
557
605
|
> extends RouteExtensions<TId, TFullPath> {
|
|
558
606
|
path: TPath
|
|
559
607
|
parentRoute: TParentRoute
|
|
560
608
|
children?: TChildren
|
|
561
609
|
types: RouteTypes<
|
|
610
|
+
TRegister,
|
|
562
611
|
TParentRoute,
|
|
563
612
|
TPath,
|
|
564
613
|
TFullPath,
|
|
@@ -572,9 +621,13 @@ export interface Route<
|
|
|
572
621
|
TLoaderDeps,
|
|
573
622
|
TLoaderFn,
|
|
574
623
|
TChildren,
|
|
575
|
-
TFileRouteTypes
|
|
624
|
+
TFileRouteTypes,
|
|
625
|
+
TSSR,
|
|
626
|
+
TServerMiddlewares,
|
|
627
|
+
THandlers
|
|
576
628
|
>
|
|
577
629
|
options: RouteOptions<
|
|
630
|
+
TRegister,
|
|
578
631
|
TParentRoute,
|
|
579
632
|
TId,
|
|
580
633
|
TCustomId,
|
|
@@ -586,7 +639,10 @@ export interface Route<
|
|
|
586
639
|
TLoaderFn,
|
|
587
640
|
TRouterContext,
|
|
588
641
|
TRouteContextFn,
|
|
589
|
-
TBeforeLoadFn
|
|
642
|
+
TBeforeLoadFn,
|
|
643
|
+
TSSR,
|
|
644
|
+
TServerMiddlewares,
|
|
645
|
+
THandlers
|
|
590
646
|
>
|
|
591
647
|
isRoot: TParentRoute extends AnyRoute ? true : false
|
|
592
648
|
/** @internal */
|
|
@@ -596,6 +652,7 @@ export interface Route<
|
|
|
596
652
|
lazyFn?: () => Promise<
|
|
597
653
|
LazyRoute<
|
|
598
654
|
Route<
|
|
655
|
+
TRegister,
|
|
599
656
|
TParentRoute,
|
|
600
657
|
TPath,
|
|
601
658
|
TFullPath,
|
|
@@ -609,7 +666,10 @@ export interface Route<
|
|
|
609
666
|
TLoaderDeps,
|
|
610
667
|
TLoaderFn,
|
|
611
668
|
TChildren,
|
|
612
|
-
TFileRouteTypes
|
|
669
|
+
TFileRouteTypes,
|
|
670
|
+
TSSR,
|
|
671
|
+
TServerMiddlewares,
|
|
672
|
+
THandlers
|
|
613
673
|
>
|
|
614
674
|
>
|
|
615
675
|
>
|
|
@@ -636,6 +696,7 @@ export interface Route<
|
|
|
636
696
|
) => this
|
|
637
697
|
lazy: RouteLazyFn<
|
|
638
698
|
Route<
|
|
699
|
+
TRegister,
|
|
639
700
|
TParentRoute,
|
|
640
701
|
TPath,
|
|
641
702
|
TFullPath,
|
|
@@ -649,10 +710,14 @@ export interface Route<
|
|
|
649
710
|
TLoaderDeps,
|
|
650
711
|
TLoaderFn,
|
|
651
712
|
TChildren,
|
|
652
|
-
TFileRouteTypes
|
|
713
|
+
TFileRouteTypes,
|
|
714
|
+
TSSR,
|
|
715
|
+
TServerMiddlewares,
|
|
716
|
+
THandlers
|
|
653
717
|
>
|
|
654
718
|
>
|
|
655
719
|
addChildren: RouteAddChildrenFn<
|
|
720
|
+
TRegister,
|
|
656
721
|
TParentRoute,
|
|
657
722
|
TPath,
|
|
658
723
|
TFullPath,
|
|
@@ -665,9 +730,13 @@ export interface Route<
|
|
|
665
730
|
TBeforeLoadFn,
|
|
666
731
|
TLoaderDeps,
|
|
667
732
|
TLoaderFn,
|
|
668
|
-
TFileRouteTypes
|
|
733
|
+
TFileRouteTypes,
|
|
734
|
+
TSSR,
|
|
735
|
+
TServerMiddlewares,
|
|
736
|
+
THandlers
|
|
669
737
|
>
|
|
670
738
|
_addFileChildren: RouteAddFileChildrenFn<
|
|
739
|
+
TRegister,
|
|
671
740
|
TParentRoute,
|
|
672
741
|
TPath,
|
|
673
742
|
TFullPath,
|
|
@@ -680,9 +749,13 @@ export interface Route<
|
|
|
680
749
|
TBeforeLoadFn,
|
|
681
750
|
TLoaderDeps,
|
|
682
751
|
TLoaderFn,
|
|
683
|
-
TFileRouteTypes
|
|
752
|
+
TFileRouteTypes,
|
|
753
|
+
TSSR,
|
|
754
|
+
TServerMiddlewares,
|
|
755
|
+
THandlers
|
|
684
756
|
>
|
|
685
757
|
_addFileTypes: RouteAddFileTypesFn<
|
|
758
|
+
TRegister,
|
|
686
759
|
TParentRoute,
|
|
687
760
|
TPath,
|
|
688
761
|
TFullPath,
|
|
@@ -695,7 +768,10 @@ export interface Route<
|
|
|
695
768
|
TBeforeLoadFn,
|
|
696
769
|
TLoaderDeps,
|
|
697
770
|
TLoaderFn,
|
|
698
|
-
TChildren
|
|
771
|
+
TChildren,
|
|
772
|
+
TSSR,
|
|
773
|
+
TServerMiddlewares,
|
|
774
|
+
THandlers
|
|
699
775
|
>
|
|
700
776
|
}
|
|
701
777
|
|
|
@@ -713,6 +789,10 @@ export type AnyRoute = Route<
|
|
|
713
789
|
any,
|
|
714
790
|
any,
|
|
715
791
|
any,
|
|
792
|
+
any,
|
|
793
|
+
any,
|
|
794
|
+
any,
|
|
795
|
+
any,
|
|
716
796
|
any
|
|
717
797
|
>
|
|
718
798
|
|
|
@@ -721,6 +801,7 @@ export type AnyRouteWithContext<TContext> = AnyRoute & {
|
|
|
721
801
|
}
|
|
722
802
|
|
|
723
803
|
export type RouteOptions<
|
|
804
|
+
TRegister,
|
|
724
805
|
TParentRoute extends AnyRoute = AnyRoute,
|
|
725
806
|
TId extends string = string,
|
|
726
807
|
TCustomId extends string = string,
|
|
@@ -733,7 +814,11 @@ export type RouteOptions<
|
|
|
733
814
|
TRouterContext = {},
|
|
734
815
|
TRouteContextFn = AnyContext,
|
|
735
816
|
TBeforeLoadFn = AnyContext,
|
|
817
|
+
TSSR = unknown,
|
|
818
|
+
TServerMiddlewares = unknown,
|
|
819
|
+
THandlers = undefined,
|
|
736
820
|
> = BaseRouteOptions<
|
|
821
|
+
TRegister,
|
|
737
822
|
TParentRoute,
|
|
738
823
|
TId,
|
|
739
824
|
TCustomId,
|
|
@@ -744,7 +829,10 @@ export type RouteOptions<
|
|
|
744
829
|
TLoaderFn,
|
|
745
830
|
TRouterContext,
|
|
746
831
|
TRouteContextFn,
|
|
747
|
-
TBeforeLoadFn
|
|
832
|
+
TBeforeLoadFn,
|
|
833
|
+
TSSR,
|
|
834
|
+
TServerMiddlewares,
|
|
835
|
+
THandlers
|
|
748
836
|
> &
|
|
749
837
|
UpdatableRouteOptions<
|
|
750
838
|
NoInfer<TParentRoute>,
|
|
@@ -773,23 +861,43 @@ export type RouteContextFn<
|
|
|
773
861
|
>,
|
|
774
862
|
) => any
|
|
775
863
|
|
|
776
|
-
export type
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
864
|
+
export type FileBaseRouteOptions<
|
|
865
|
+
TRegister,
|
|
866
|
+
TParentRoute extends AnyRoute = AnyRoute,
|
|
867
|
+
TId extends string = string,
|
|
868
|
+
TPath extends string = string,
|
|
869
|
+
TSearchValidator = undefined,
|
|
870
|
+
TParams = {},
|
|
871
|
+
TLoaderDeps extends Record<string, any> = {},
|
|
872
|
+
TLoaderFn = undefined,
|
|
873
|
+
TRouterContext = {},
|
|
874
|
+
TRouteContextFn = AnyContext,
|
|
875
|
+
TBeforeLoadFn = AnyContext,
|
|
876
|
+
TRemountDepsFn = AnyContext,
|
|
877
|
+
TSSR = unknown,
|
|
878
|
+
TServerMiddlewares = unknown,
|
|
879
|
+
THandlers = undefined,
|
|
880
|
+
> = ParamsOptions<TPath, TParams> &
|
|
881
|
+
FilebaseRouteOptionsInterface<
|
|
882
|
+
TRegister,
|
|
784
883
|
TParentRoute,
|
|
884
|
+
TId,
|
|
885
|
+
TPath,
|
|
785
886
|
TSearchValidator,
|
|
786
887
|
TParams,
|
|
888
|
+
TLoaderDeps,
|
|
889
|
+
TLoaderFn,
|
|
787
890
|
TRouterContext,
|
|
788
|
-
TRouteContextFn
|
|
789
|
-
|
|
790
|
-
|
|
891
|
+
TRouteContextFn,
|
|
892
|
+
TBeforeLoadFn,
|
|
893
|
+
TRemountDepsFn,
|
|
894
|
+
TSSR,
|
|
895
|
+
TServerMiddlewares,
|
|
896
|
+
THandlers
|
|
897
|
+
>
|
|
791
898
|
|
|
792
|
-
export
|
|
899
|
+
export interface FilebaseRouteOptionsInterface<
|
|
900
|
+
TRegister,
|
|
793
901
|
TParentRoute extends AnyRoute = AnyRoute,
|
|
794
902
|
TId extends string = string,
|
|
795
903
|
TPath extends string = string,
|
|
@@ -801,20 +909,26 @@ export type FileBaseRouteOptions<
|
|
|
801
909
|
TRouteContextFn = AnyContext,
|
|
802
910
|
TBeforeLoadFn = AnyContext,
|
|
803
911
|
TRemountDepsFn = AnyContext,
|
|
804
|
-
|
|
912
|
+
TSSR = unknown,
|
|
913
|
+
TServerMiddlewares = unknown,
|
|
914
|
+
THandlers = undefined,
|
|
915
|
+
> {
|
|
805
916
|
validateSearch?: Constrain<TSearchValidator, AnyValidator, DefaultValidator>
|
|
806
917
|
|
|
807
918
|
shouldReload?:
|
|
808
919
|
| boolean
|
|
809
920
|
| ((
|
|
810
921
|
match: LoaderFnContext<
|
|
922
|
+
TRegister,
|
|
811
923
|
TParentRoute,
|
|
812
924
|
TId,
|
|
813
925
|
TParams,
|
|
814
926
|
TLoaderDeps,
|
|
815
927
|
TRouterContext,
|
|
816
928
|
TRouteContextFn,
|
|
817
|
-
TBeforeLoadFn
|
|
929
|
+
TBeforeLoadFn,
|
|
930
|
+
TServerMiddlewares,
|
|
931
|
+
THandlers
|
|
818
932
|
>,
|
|
819
933
|
) => any)
|
|
820
934
|
|
|
@@ -830,13 +944,14 @@ export type FileBaseRouteOptions<
|
|
|
830
944
|
) => any
|
|
831
945
|
>
|
|
832
946
|
|
|
833
|
-
ssr?:
|
|
947
|
+
ssr?: Constrain<
|
|
948
|
+
TSSR,
|
|
834
949
|
| undefined
|
|
835
|
-
|
|
|
836
|
-
| 'data-only'
|
|
950
|
+
| SSROption
|
|
837
951
|
| ((
|
|
838
952
|
ctx: SsrContextOptions<TParentRoute, TSearchValidator, TParams>,
|
|
839
|
-
) => Awaitable<undefined |
|
|
953
|
+
) => Awaitable<undefined | SSROption>)
|
|
954
|
+
>
|
|
840
955
|
|
|
841
956
|
// This async function is called before a route is loaded.
|
|
842
957
|
// If an error is thrown here, the route's loader will not be called.
|
|
@@ -846,13 +961,21 @@ export type FileBaseRouteOptions<
|
|
|
846
961
|
TBeforeLoadFn,
|
|
847
962
|
(
|
|
848
963
|
ctx: BeforeLoadContextOptions<
|
|
964
|
+
TRegister,
|
|
849
965
|
TParentRoute,
|
|
850
966
|
TSearchValidator,
|
|
851
967
|
TParams,
|
|
852
968
|
TRouterContext,
|
|
853
|
-
TRouteContextFn
|
|
969
|
+
TRouteContextFn,
|
|
970
|
+
TServerMiddlewares,
|
|
971
|
+
THandlers
|
|
854
972
|
>,
|
|
855
|
-
) =>
|
|
973
|
+
) => ValidateSerializableLifecycleResult<
|
|
974
|
+
TRegister,
|
|
975
|
+
TParentRoute,
|
|
976
|
+
TSSR,
|
|
977
|
+
TBeforeLoadFn
|
|
978
|
+
>
|
|
856
979
|
>
|
|
857
980
|
|
|
858
981
|
loaderDeps?: (
|
|
@@ -875,19 +998,28 @@ export type FileBaseRouteOptions<
|
|
|
875
998
|
TLoaderFn,
|
|
876
999
|
(
|
|
877
1000
|
ctx: LoaderFnContext<
|
|
1001
|
+
TRegister,
|
|
878
1002
|
TParentRoute,
|
|
879
1003
|
TId,
|
|
880
1004
|
TParams,
|
|
881
1005
|
TLoaderDeps,
|
|
882
1006
|
TRouterContext,
|
|
883
1007
|
TRouteContextFn,
|
|
884
|
-
TBeforeLoadFn
|
|
1008
|
+
TBeforeLoadFn,
|
|
1009
|
+
TServerMiddlewares,
|
|
1010
|
+
THandlers
|
|
885
1011
|
>,
|
|
886
|
-
) =>
|
|
1012
|
+
) => ValidateSerializableLifecycleResult<
|
|
1013
|
+
TRegister,
|
|
1014
|
+
TParentRoute,
|
|
1015
|
+
TSSR,
|
|
1016
|
+
TLoaderFn
|
|
1017
|
+
>
|
|
887
1018
|
>
|
|
888
1019
|
}
|
|
889
1020
|
|
|
890
1021
|
export type BaseRouteOptions<
|
|
1022
|
+
TRegister,
|
|
891
1023
|
TParentRoute extends AnyRoute = AnyRoute,
|
|
892
1024
|
TId extends string = string,
|
|
893
1025
|
TCustomId extends string = string,
|
|
@@ -899,8 +1031,12 @@ export type BaseRouteOptions<
|
|
|
899
1031
|
TRouterContext = {},
|
|
900
1032
|
TRouteContextFn = AnyContext,
|
|
901
1033
|
TBeforeLoadFn = AnyContext,
|
|
1034
|
+
TSSR = unknown,
|
|
1035
|
+
TServerMiddlewares = unknown,
|
|
1036
|
+
THandlers = undefined,
|
|
902
1037
|
> = RoutePathOptions<TCustomId, TPath> &
|
|
903
1038
|
FileBaseRouteOptions<
|
|
1039
|
+
TRegister,
|
|
904
1040
|
TParentRoute,
|
|
905
1041
|
TId,
|
|
906
1042
|
TPath,
|
|
@@ -910,7 +1046,11 @@ export type BaseRouteOptions<
|
|
|
910
1046
|
TLoaderFn,
|
|
911
1047
|
TRouterContext,
|
|
912
1048
|
TRouteContextFn,
|
|
913
|
-
TBeforeLoadFn
|
|
1049
|
+
TBeforeLoadFn,
|
|
1050
|
+
AnyContext,
|
|
1051
|
+
TSSR,
|
|
1052
|
+
TServerMiddlewares,
|
|
1053
|
+
THandlers
|
|
914
1054
|
> & {
|
|
915
1055
|
getParentRoute: () => TParentRoute
|
|
916
1056
|
}
|
|
@@ -964,11 +1104,14 @@ export interface SsrContextOptions<
|
|
|
964
1104
|
}
|
|
965
1105
|
|
|
966
1106
|
export interface BeforeLoadContextOptions<
|
|
1107
|
+
in out TRegister,
|
|
967
1108
|
in out TParentRoute extends AnyRoute,
|
|
968
1109
|
in out TSearchValidator,
|
|
969
1110
|
in out TParams,
|
|
970
1111
|
in out TRouterContext,
|
|
971
1112
|
in out TRouteContextFn,
|
|
1113
|
+
in out TServerMiddlewares,
|
|
1114
|
+
in out THandlers,
|
|
972
1115
|
> extends ContextOptions<TParentRoute, TParams>,
|
|
973
1116
|
FullSearchSchemaOption<TParentRoute, TSearchValidator> {
|
|
974
1117
|
context: Expand<
|
|
@@ -1188,6 +1331,7 @@ export interface UpdatableRouteOptions<
|
|
|
1188
1331
|
}
|
|
1189
1332
|
|
|
1190
1333
|
export type RouteLoaderFn<
|
|
1334
|
+
in out TRegister,
|
|
1191
1335
|
in out TParentRoute extends AnyRoute = AnyRoute,
|
|
1192
1336
|
in out TId extends string = string,
|
|
1193
1337
|
in out TParams = {},
|
|
@@ -1195,19 +1339,25 @@ export type RouteLoaderFn<
|
|
|
1195
1339
|
in out TRouterContext = {},
|
|
1196
1340
|
in out TRouteContextFn = AnyContext,
|
|
1197
1341
|
in out TBeforeLoadFn = AnyContext,
|
|
1342
|
+
in out TServerMiddlewares = unknown,
|
|
1343
|
+
in out THandlers = undefined,
|
|
1198
1344
|
> = (
|
|
1199
1345
|
match: LoaderFnContext<
|
|
1346
|
+
TRegister,
|
|
1200
1347
|
TParentRoute,
|
|
1201
1348
|
TId,
|
|
1202
1349
|
TParams,
|
|
1203
1350
|
TLoaderDeps,
|
|
1204
1351
|
TRouterContext,
|
|
1205
1352
|
TRouteContextFn,
|
|
1206
|
-
TBeforeLoadFn
|
|
1353
|
+
TBeforeLoadFn,
|
|
1354
|
+
TServerMiddlewares,
|
|
1355
|
+
THandlers
|
|
1207
1356
|
>,
|
|
1208
1357
|
) => any
|
|
1209
1358
|
|
|
1210
1359
|
export interface LoaderFnContext<
|
|
1360
|
+
in out TRegister = unknown,
|
|
1211
1361
|
in out TParentRoute extends AnyRoute = AnyRoute,
|
|
1212
1362
|
in out TId extends string = string,
|
|
1213
1363
|
in out TParams = {},
|
|
@@ -1215,6 +1365,8 @@ export interface LoaderFnContext<
|
|
|
1215
1365
|
in out TRouterContext = {},
|
|
1216
1366
|
in out TRouteContextFn = AnyContext,
|
|
1217
1367
|
in out TBeforeLoadFn = AnyContext,
|
|
1368
|
+
in out TServerMiddlewares = unknown,
|
|
1369
|
+
in out THandlers = undefined,
|
|
1218
1370
|
> {
|
|
1219
1371
|
abortController: AbortController
|
|
1220
1372
|
preload: boolean
|
|
@@ -1248,37 +1400,45 @@ export interface DefaultRootRouteOptionsExtensions {
|
|
|
1248
1400
|
export interface RootRouteOptionsExtensions
|
|
1249
1401
|
extends DefaultRootRouteOptionsExtensions {}
|
|
1250
1402
|
|
|
1251
|
-
export
|
|
1403
|
+
export interface RootRouteOptions<
|
|
1404
|
+
TRegister = unknown,
|
|
1252
1405
|
TSearchValidator = undefined,
|
|
1253
1406
|
TRouterContext = {},
|
|
1254
1407
|
TRouteContextFn = AnyContext,
|
|
1255
1408
|
TBeforeLoadFn = AnyContext,
|
|
1256
1409
|
TLoaderDeps extends Record<string, any> = {},
|
|
1257
1410
|
TLoaderFn = undefined,
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1411
|
+
TSSR = unknown,
|
|
1412
|
+
TServerMiddlewares = unknown,
|
|
1413
|
+
THandlers = undefined,
|
|
1414
|
+
> extends Omit<
|
|
1415
|
+
RouteOptions<
|
|
1416
|
+
TRegister,
|
|
1417
|
+
any, // TParentRoute
|
|
1418
|
+
RootRouteId, // TId
|
|
1419
|
+
RootRouteId, // TCustomId
|
|
1420
|
+
'', // TFullPath
|
|
1421
|
+
'', // TPath
|
|
1422
|
+
TSearchValidator,
|
|
1423
|
+
{}, // TParams
|
|
1424
|
+
TLoaderDeps,
|
|
1425
|
+
TLoaderFn,
|
|
1426
|
+
TRouterContext,
|
|
1427
|
+
TRouteContextFn,
|
|
1428
|
+
TBeforeLoadFn,
|
|
1429
|
+
TSSR,
|
|
1430
|
+
TServerMiddlewares,
|
|
1431
|
+
THandlers
|
|
1432
|
+
>,
|
|
1433
|
+
| 'path'
|
|
1434
|
+
| 'id'
|
|
1435
|
+
| 'getParentRoute'
|
|
1436
|
+
| 'caseSensitive'
|
|
1437
|
+
| 'parseParams'
|
|
1438
|
+
| 'stringifyParams'
|
|
1439
|
+
| 'params'
|
|
1440
|
+
>,
|
|
1441
|
+
RootRouteOptionsExtensions {}
|
|
1282
1442
|
|
|
1283
1443
|
export type RouteConstraints = {
|
|
1284
1444
|
TParentRoute: AnyRoute
|
|
@@ -1334,6 +1494,7 @@ export type NotFoundRouteProps = {
|
|
|
1334
1494
|
}
|
|
1335
1495
|
|
|
1336
1496
|
export class BaseRoute<
|
|
1497
|
+
in out TRegister = Register,
|
|
1337
1498
|
in out TParentRoute extends AnyRoute = AnyRoute,
|
|
1338
1499
|
in out TPath extends string = '/',
|
|
1339
1500
|
in out TFullPath extends string = ResolveFullPath<TParentRoute, TPath>,
|
|
@@ -1348,9 +1509,13 @@ export class BaseRoute<
|
|
|
1348
1509
|
in out TLoaderFn = undefined,
|
|
1349
1510
|
in out TChildren = unknown,
|
|
1350
1511
|
in out TFileRouteTypes = unknown,
|
|
1512
|
+
in out TSSR = unknown,
|
|
1513
|
+
in out TServerMiddlewares = unknown,
|
|
1514
|
+
in out THandlers = undefined,
|
|
1351
1515
|
> {
|
|
1352
1516
|
isRoot: TParentRoute extends AnyRoute ? true : false
|
|
1353
1517
|
options: RouteOptions<
|
|
1518
|
+
TRegister,
|
|
1354
1519
|
TParentRoute,
|
|
1355
1520
|
TId,
|
|
1356
1521
|
TCustomId,
|
|
@@ -1362,7 +1527,10 @@ export class BaseRoute<
|
|
|
1362
1527
|
TLoaderFn,
|
|
1363
1528
|
TRouterContext,
|
|
1364
1529
|
TRouteContextFn,
|
|
1365
|
-
TBeforeLoadFn
|
|
1530
|
+
TBeforeLoadFn,
|
|
1531
|
+
TSSR,
|
|
1532
|
+
TServerMiddlewares,
|
|
1533
|
+
THandlers
|
|
1366
1534
|
>
|
|
1367
1535
|
|
|
1368
1536
|
// The following properties are set up in this.init()
|
|
@@ -1395,6 +1563,7 @@ export class BaseRoute<
|
|
|
1395
1563
|
lazyFn?: () => Promise<
|
|
1396
1564
|
LazyRoute<
|
|
1397
1565
|
Route<
|
|
1566
|
+
TRegister,
|
|
1398
1567
|
TParentRoute,
|
|
1399
1568
|
TPath,
|
|
1400
1569
|
TFullPath,
|
|
@@ -1408,7 +1577,10 @@ export class BaseRoute<
|
|
|
1408
1577
|
TLoaderDeps,
|
|
1409
1578
|
TLoaderFn,
|
|
1410
1579
|
TChildren,
|
|
1411
|
-
TFileRouteTypes
|
|
1580
|
+
TFileRouteTypes,
|
|
1581
|
+
TSSR,
|
|
1582
|
+
TServerMiddlewares,
|
|
1583
|
+
THandlers
|
|
1412
1584
|
>
|
|
1413
1585
|
>
|
|
1414
1586
|
>
|
|
@@ -1419,6 +1591,7 @@ export class BaseRoute<
|
|
|
1419
1591
|
|
|
1420
1592
|
constructor(
|
|
1421
1593
|
options?: RouteOptions<
|
|
1594
|
+
TRegister,
|
|
1422
1595
|
TParentRoute,
|
|
1423
1596
|
TId,
|
|
1424
1597
|
TCustomId,
|
|
@@ -1430,7 +1603,10 @@ export class BaseRoute<
|
|
|
1430
1603
|
TLoaderFn,
|
|
1431
1604
|
TRouterContext,
|
|
1432
1605
|
TRouteContextFn,
|
|
1433
|
-
TBeforeLoadFn
|
|
1606
|
+
TBeforeLoadFn,
|
|
1607
|
+
TSSR,
|
|
1608
|
+
TServerMiddlewares,
|
|
1609
|
+
THandlers
|
|
1434
1610
|
>,
|
|
1435
1611
|
) {
|
|
1436
1612
|
this.options = (options as any) || {}
|
|
@@ -1442,6 +1618,7 @@ export class BaseRoute<
|
|
|
1442
1618
|
}
|
|
1443
1619
|
|
|
1444
1620
|
types!: RouteTypes<
|
|
1621
|
+
TRegister,
|
|
1445
1622
|
TParentRoute,
|
|
1446
1623
|
TPath,
|
|
1447
1624
|
TFullPath,
|
|
@@ -1455,7 +1632,10 @@ export class BaseRoute<
|
|
|
1455
1632
|
TLoaderDeps,
|
|
1456
1633
|
TLoaderFn,
|
|
1457
1634
|
TChildren,
|
|
1458
|
-
TFileRouteTypes
|
|
1635
|
+
TFileRouteTypes,
|
|
1636
|
+
TSSR,
|
|
1637
|
+
TServerMiddlewares,
|
|
1638
|
+
THandlers
|
|
1459
1639
|
>
|
|
1460
1640
|
|
|
1461
1641
|
init = (opts: { originalIndex: number }): void => {
|
|
@@ -1463,6 +1643,7 @@ export class BaseRoute<
|
|
|
1463
1643
|
|
|
1464
1644
|
const options = this.options as
|
|
1465
1645
|
| (RouteOptions<
|
|
1646
|
+
TRegister,
|
|
1466
1647
|
TParentRoute,
|
|
1467
1648
|
TId,
|
|
1468
1649
|
TCustomId,
|
|
@@ -1474,7 +1655,9 @@ export class BaseRoute<
|
|
|
1474
1655
|
TLoaderFn,
|
|
1475
1656
|
TRouterContext,
|
|
1476
1657
|
TRouteContextFn,
|
|
1477
|
-
TBeforeLoadFn
|
|
1658
|
+
TBeforeLoadFn,
|
|
1659
|
+
TSSR,
|
|
1660
|
+
TServerMiddlewares
|
|
1478
1661
|
> &
|
|
1479
1662
|
RoutePathOptionsIntersection<TCustomId, TPath>)
|
|
1480
1663
|
| undefined
|
|
@@ -1536,6 +1719,7 @@ export class BaseRoute<
|
|
|
1536
1719
|
}
|
|
1537
1720
|
|
|
1538
1721
|
addChildren: RouteAddChildrenFn<
|
|
1722
|
+
TRegister,
|
|
1539
1723
|
TParentRoute,
|
|
1540
1724
|
TPath,
|
|
1541
1725
|
TFullPath,
|
|
@@ -1548,12 +1732,16 @@ export class BaseRoute<
|
|
|
1548
1732
|
TBeforeLoadFn,
|
|
1549
1733
|
TLoaderDeps,
|
|
1550
1734
|
TLoaderFn,
|
|
1551
|
-
TFileRouteTypes
|
|
1735
|
+
TFileRouteTypes,
|
|
1736
|
+
TSSR,
|
|
1737
|
+
TServerMiddlewares,
|
|
1738
|
+
THandlers
|
|
1552
1739
|
> = (children) => {
|
|
1553
1740
|
return this._addFileChildren(children) as any
|
|
1554
1741
|
}
|
|
1555
1742
|
|
|
1556
1743
|
_addFileChildren: RouteAddFileChildrenFn<
|
|
1744
|
+
TRegister,
|
|
1557
1745
|
TParentRoute,
|
|
1558
1746
|
TPath,
|
|
1559
1747
|
TFullPath,
|
|
@@ -1566,7 +1754,10 @@ export class BaseRoute<
|
|
|
1566
1754
|
TBeforeLoadFn,
|
|
1567
1755
|
TLoaderDeps,
|
|
1568
1756
|
TLoaderFn,
|
|
1569
|
-
TFileRouteTypes
|
|
1757
|
+
TFileRouteTypes,
|
|
1758
|
+
TSSR,
|
|
1759
|
+
TServerMiddlewares,
|
|
1760
|
+
THandlers
|
|
1570
1761
|
> = (children) => {
|
|
1571
1762
|
if (Array.isArray(children)) {
|
|
1572
1763
|
this.children = children as TChildren
|
|
@@ -1580,6 +1771,7 @@ export class BaseRoute<
|
|
|
1580
1771
|
}
|
|
1581
1772
|
|
|
1582
1773
|
_addFileTypes: RouteAddFileTypesFn<
|
|
1774
|
+
TRegister,
|
|
1583
1775
|
TParentRoute,
|
|
1584
1776
|
TPath,
|
|
1585
1777
|
TFullPath,
|
|
@@ -1592,7 +1784,10 @@ export class BaseRoute<
|
|
|
1592
1784
|
TBeforeLoadFn,
|
|
1593
1785
|
TLoaderDeps,
|
|
1594
1786
|
TLoaderFn,
|
|
1595
|
-
TChildren
|
|
1787
|
+
TChildren,
|
|
1788
|
+
TSSR,
|
|
1789
|
+
TServerMiddlewares,
|
|
1790
|
+
THandlers
|
|
1596
1791
|
> = () => {
|
|
1597
1792
|
return this as any
|
|
1598
1793
|
}
|
|
@@ -1601,6 +1796,7 @@ export class BaseRoute<
|
|
|
1601
1796
|
loader: Constrain<
|
|
1602
1797
|
TNewLoaderFn,
|
|
1603
1798
|
RouteLoaderFn<
|
|
1799
|
+
TRegister,
|
|
1604
1800
|
TParentRoute,
|
|
1605
1801
|
TCustomId,
|
|
1606
1802
|
TParams,
|
|
@@ -1613,6 +1809,7 @@ export class BaseRoute<
|
|
|
1613
1809
|
}) => {
|
|
1614
1810
|
Object.assign(this.options, options)
|
|
1615
1811
|
return this as unknown as BaseRoute<
|
|
1812
|
+
TRegister,
|
|
1616
1813
|
TParentRoute,
|
|
1617
1814
|
TPath,
|
|
1618
1815
|
TFullPath,
|
|
@@ -1626,7 +1823,10 @@ export class BaseRoute<
|
|
|
1626
1823
|
TLoaderDeps,
|
|
1627
1824
|
TNewLoaderFn,
|
|
1628
1825
|
TChildren,
|
|
1629
|
-
TFileRouteTypes
|
|
1826
|
+
TFileRouteTypes,
|
|
1827
|
+
TSSR,
|
|
1828
|
+
TServerMiddlewares,
|
|
1829
|
+
THandlers
|
|
1630
1830
|
>
|
|
1631
1831
|
}
|
|
1632
1832
|
|
|
@@ -1650,6 +1850,7 @@ export class BaseRoute<
|
|
|
1650
1850
|
|
|
1651
1851
|
lazy: RouteLazyFn<
|
|
1652
1852
|
Route<
|
|
1853
|
+
TRegister,
|
|
1653
1854
|
TParentRoute,
|
|
1654
1855
|
TPath,
|
|
1655
1856
|
TFullPath,
|
|
@@ -1663,7 +1864,10 @@ export class BaseRoute<
|
|
|
1663
1864
|
TLoaderDeps,
|
|
1664
1865
|
TLoaderFn,
|
|
1665
1866
|
TChildren,
|
|
1666
|
-
TFileRouteTypes
|
|
1867
|
+
TFileRouteTypes,
|
|
1868
|
+
TSSR,
|
|
1869
|
+
TServerMiddlewares,
|
|
1870
|
+
THandlers
|
|
1667
1871
|
>
|
|
1668
1872
|
> = (lazyFn) => {
|
|
1669
1873
|
this.lazyFn = lazyFn
|
|
@@ -1684,6 +1888,7 @@ export class BaseRouteApi<TId, TRouter extends AnyRouter = RegisteredRouter> {
|
|
|
1684
1888
|
}
|
|
1685
1889
|
|
|
1686
1890
|
export interface RootRoute<
|
|
1891
|
+
in out TRegister,
|
|
1687
1892
|
in out TSearchValidator = undefined,
|
|
1688
1893
|
in out TRouterContext = {},
|
|
1689
1894
|
in out TRouteContextFn = AnyContext,
|
|
@@ -1692,7 +1897,11 @@ export interface RootRoute<
|
|
|
1692
1897
|
in out TLoaderFn = undefined,
|
|
1693
1898
|
in out TChildren = unknown,
|
|
1694
1899
|
in out TFileRouteTypes = unknown,
|
|
1900
|
+
in out TSSR = unknown,
|
|
1901
|
+
in out TServerMiddlewares = unknown,
|
|
1902
|
+
in out THandlers = undefined,
|
|
1695
1903
|
> extends Route<
|
|
1904
|
+
TRegister,
|
|
1696
1905
|
any, // TParentRoute
|
|
1697
1906
|
'/', // TPath
|
|
1698
1907
|
'/', // TFullPath
|
|
@@ -1706,10 +1915,14 @@ export interface RootRoute<
|
|
|
1706
1915
|
TLoaderDeps,
|
|
1707
1916
|
TLoaderFn,
|
|
1708
1917
|
TChildren, // TChildren
|
|
1709
|
-
TFileRouteTypes
|
|
1918
|
+
TFileRouteTypes,
|
|
1919
|
+
TSSR,
|
|
1920
|
+
TServerMiddlewares,
|
|
1921
|
+
THandlers
|
|
1710
1922
|
> {}
|
|
1711
1923
|
|
|
1712
1924
|
export class BaseRootRoute<
|
|
1925
|
+
in out TRegister = Register,
|
|
1713
1926
|
in out TSearchValidator = undefined,
|
|
1714
1927
|
in out TRouterContext = {},
|
|
1715
1928
|
in out TRouteContextFn = AnyContext,
|
|
@@ -1718,7 +1931,11 @@ export class BaseRootRoute<
|
|
|
1718
1931
|
in out TLoaderFn = undefined,
|
|
1719
1932
|
in out TChildren = unknown,
|
|
1720
1933
|
in out TFileRouteTypes = unknown,
|
|
1934
|
+
in out TSSR = unknown,
|
|
1935
|
+
in out TServerMiddlewares = unknown,
|
|
1936
|
+
in out THandlers = undefined,
|
|
1721
1937
|
> extends BaseRoute<
|
|
1938
|
+
TRegister,
|
|
1722
1939
|
any, // TParentRoute
|
|
1723
1940
|
'/', // TPath
|
|
1724
1941
|
'/', // TFullPath
|
|
@@ -1732,16 +1949,23 @@ export class BaseRootRoute<
|
|
|
1732
1949
|
TLoaderDeps,
|
|
1733
1950
|
TLoaderFn,
|
|
1734
1951
|
TChildren, // TChildren
|
|
1735
|
-
TFileRouteTypes
|
|
1952
|
+
TFileRouteTypes,
|
|
1953
|
+
TSSR,
|
|
1954
|
+
TServerMiddlewares,
|
|
1955
|
+
THandlers
|
|
1736
1956
|
> {
|
|
1737
1957
|
constructor(
|
|
1738
1958
|
options?: RootRouteOptions<
|
|
1959
|
+
TRegister,
|
|
1739
1960
|
TSearchValidator,
|
|
1740
1961
|
TRouterContext,
|
|
1741
1962
|
TRouteContextFn,
|
|
1742
1963
|
TBeforeLoadFn,
|
|
1743
1964
|
TLoaderDeps,
|
|
1744
|
-
TLoaderFn
|
|
1965
|
+
TLoaderFn,
|
|
1966
|
+
TSSR,
|
|
1967
|
+
TServerMiddlewares,
|
|
1968
|
+
THandlers
|
|
1745
1969
|
>,
|
|
1746
1970
|
) {
|
|
1747
1971
|
super(options as any)
|
|
@@ -1749,3 +1973,16 @@ export class BaseRootRoute<
|
|
|
1749
1973
|
}
|
|
1750
1974
|
|
|
1751
1975
|
//
|
|
1976
|
+
|
|
1977
|
+
export interface RouteLike {
|
|
1978
|
+
id: string
|
|
1979
|
+
isRoot?: boolean
|
|
1980
|
+
path?: string
|
|
1981
|
+
fullPath: string
|
|
1982
|
+
rank?: number
|
|
1983
|
+
parentRoute?: RouteLike
|
|
1984
|
+
children?: Array<RouteLike>
|
|
1985
|
+
options?: {
|
|
1986
|
+
caseSensitive?: boolean
|
|
1987
|
+
}
|
|
1988
|
+
}
|