1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | import { AfterContentInit } from '@angular/core';
|
9 | import { ChangeDetectorRef } from '@angular/core';
|
10 | import { Compiler } from '@angular/core';
|
11 | import { ComponentRef } from '@angular/core';
|
12 | import { ElementRef } from '@angular/core';
|
13 | import { EnvironmentInjector } from '@angular/core';
|
14 | import { EnvironmentProviders } from '@angular/core';
|
15 | import { EventEmitter } from '@angular/core';
|
16 | import * as i0 from '@angular/core';
|
17 | import { InjectionToken } from '@angular/core';
|
18 | import { Injector } from '@angular/core';
|
19 | import { LocationStrategy } from '@angular/common';
|
20 | import { ModuleWithProviders } from '@angular/core';
|
21 | import { NgModuleFactory } from '@angular/core';
|
22 | import { Observable } from 'rxjs';
|
23 | import { OnChanges } from '@angular/core';
|
24 | import { OnDestroy } from '@angular/core';
|
25 | import { OnInit } from '@angular/core';
|
26 | import { Provider } from '@angular/core';
|
27 | import { ProviderToken } from '@angular/core';
|
28 | import { QueryList } from '@angular/core';
|
29 | import { Renderer2 } from '@angular/core';
|
30 | import { SimpleChanges } from '@angular/core';
|
31 | import { Title } from '@angular/platform-browser';
|
32 | import { Type } from '@angular/core';
|
33 | import { Version } from '@angular/core';
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 | export declare class ActivatedRoute {
|
55 |
|
56 | outlet: string;
|
57 |
|
58 | component: Type<any> | null;
|
59 |
|
60 | snapshot: ActivatedRouteSnapshot;
|
61 |
|
62 | readonly title: Observable<string | undefined>;
|
63 |
|
64 | url: Observable<UrlSegment[]>;
|
65 |
|
66 | params: Observable<Params>;
|
67 |
|
68 | queryParams: Observable<Params>;
|
69 |
|
70 | fragment: Observable<string | null>;
|
71 |
|
72 | data: Observable<Data>;
|
73 |
|
74 | get routeConfig(): Route | null;
|
75 |
|
76 | get root(): ActivatedRoute;
|
77 |
|
78 | get parent(): ActivatedRoute | null;
|
79 |
|
80 | get firstChild(): ActivatedRoute | null;
|
81 |
|
82 | get children(): ActivatedRoute[];
|
83 |
|
84 | get pathFromRoot(): ActivatedRoute[];
|
85 | |
86 |
|
87 |
|
88 |
|
89 |
|
90 | get paramMap(): Observable<ParamMap>;
|
91 | |
92 |
|
93 |
|
94 |
|
95 | get queryParamMap(): Observable<ParamMap>;
|
96 | toString(): string;
|
97 | }
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 |
|
122 | export declare class ActivatedRouteSnapshot {
|
123 |
|
124 | url: UrlSegment[];
|
125 | |
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 | params: Params;
|
145 |
|
146 | queryParams: Params;
|
147 |
|
148 | fragment: string | null;
|
149 |
|
150 | data: Data;
|
151 |
|
152 | outlet: string;
|
153 |
|
154 | component: Type<any> | null;
|
155 |
|
156 | readonly routeConfig: Route | null;
|
157 |
|
158 | get title(): string | undefined;
|
159 |
|
160 | get root(): ActivatedRouteSnapshot;
|
161 |
|
162 | get parent(): ActivatedRouteSnapshot | null;
|
163 |
|
164 | get firstChild(): ActivatedRouteSnapshot | null;
|
165 |
|
166 | get children(): ActivatedRouteSnapshot[];
|
167 |
|
168 | get pathFromRoot(): ActivatedRouteSnapshot[];
|
169 | get paramMap(): ParamMap;
|
170 | get queryParamMap(): ParamMap;
|
171 | toString(): string;
|
172 | }
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 | export declare class ActivationEnd {
|
183 |
|
184 | snapshot: ActivatedRouteSnapshot;
|
185 | readonly type = EventType.ActivationEnd;
|
186 | constructor(
|
187 |
|
188 | snapshot: ActivatedRouteSnapshot);
|
189 | toString(): string;
|
190 | }
|
191 |
|
192 | /**
|
193 | * An event triggered at the start of the activation part
|
194 | * of the Resolve phase of routing.
|
195 | * @see {@link ActivationEnd}
|
196 | * @see {@link ResolveStart}
|
197 | *
|
198 | * @publicApi
|
199 | */
|
200 | export declare class ActivationStart {
|
201 |
|
202 | snapshot: ActivatedRouteSnapshot;
|
203 | readonly type = EventType.ActivationStart;
|
204 | constructor(
|
205 |
|
206 | snapshot: ActivatedRouteSnapshot);
|
207 | toString(): string;
|
208 | }
|
209 |
|
210 | /**
|
211 | * @description
|
212 | *
|
213 | * This base route reuse strategy only reuses routes when the matched router configs are
|
214 | * identical. This prevents components from being destroyed and recreated
|
215 | * when just the route parameters, query parameters or fragment change
|
216 | * (that is, the existing component is _reused_).
|
217 | *
|
218 | * This strategy does not store any routes for later reuse.
|
219 | *
|
220 | * Angular uses this strategy by default.
|
221 | *
|
222 | *
|
223 | * It can be used as a base class for custom route reuse strategies, i.e. you can create your own
|
224 | * class that extends the `BaseRouteReuseStrategy` one.
|
225 | * @publicApi
|
226 | */
|
227 | export declare abstract class BaseRouteReuseStrategy implements RouteReuseStrategy {
|
228 | |
229 |
|
230 |
|
231 |
|
232 | shouldDetach(route: ActivatedRouteSnapshot): boolean;
|
233 | |
234 |
|
235 |
|
236 | store(route: ActivatedRouteSnapshot, detachedTree: DetachedRouteHandle): void;
|
237 |
|
238 | shouldAttach(route: ActivatedRouteSnapshot): boolean;
|
239 |
|
240 | retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null;
|
241 | |
242 |
|
243 |
|
244 |
|
245 |
|
246 | shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;
|
247 | }
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 |
|
282 |
|
283 |
|
284 |
|
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 | export declare interface CanActivate {
|
307 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
308 | }
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 | export declare interface CanActivateChild {
|
373 | canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
374 | }
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 | export declare type CanActivateChildFn = (childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 | export declare type CanActivateFn = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 |
|
468 |
|
469 |
|
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 | export declare interface CanDeactivate<T> {
|
476 | canDeactivate(component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
477 | }
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 | export declare type CanDeactivateFn<T> = (component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState: RouterStateSnapshot) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 |
|
525 |
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 | export declare interface CanLoad {
|
551 | canLoad(route: Route, segments: UrlSegment[]): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
552 | }
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 | export declare type CanLoadFn = (route: Route, segments: UrlSegment[]) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
564 |
|
565 |
|
566 |
|
567 |
|
568 |
|
569 |
|
570 |
|
571 |
|
572 |
|
573 |
|
574 |
|
575 |
|
576 |
|
577 |
|
578 |
|
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 |
|
586 |
|
587 |
|
588 |
|
589 |
|
590 |
|
591 |
|
592 |
|
593 |
|
594 |
|
595 |
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 |
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 |
|
620 |
|
621 |
|
622 |
|
623 |
|
624 |
|
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 | export declare interface CanMatch {
|
631 | canMatch(route: Route, segments: UrlSegment[]): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
632 | }
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 |
|
639 |
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 |
|
647 |
|
648 |
|
649 | export declare type CanMatchFn = (route: Route, segments: UrlSegment[]) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
650 |
|
651 |
|
652 |
|
653 |
|
654 |
|
655 |
|
656 |
|
657 |
|
658 | export declare class ChildActivationEnd {
|
659 |
|
660 | snapshot: ActivatedRouteSnapshot;
|
661 | readonly type = EventType.ChildActivationEnd;
|
662 | constructor(
|
663 |
|
664 | snapshot: ActivatedRouteSnapshot);
|
665 | toString(): string;
|
666 | }
|
667 |
|
668 | /**
|
669 | * An event triggered at the start of the child-activation
|
670 | * part of the Resolve phase of routing.
|
671 | * @see {@link ChildActivationEnd}
|
672 | * @see {@link ResolveStart}
|
673 | *
|
674 | * @publicApi
|
675 | */
|
676 | export declare class ChildActivationStart {
|
677 |
|
678 | snapshot: ActivatedRouteSnapshot;
|
679 | readonly type = EventType.ChildActivationStart;
|
680 | constructor(
|
681 |
|
682 | snapshot: ActivatedRouteSnapshot);
|
683 | toString(): string;
|
684 | }
|
685 |
|
686 | /**
|
687 | * Store contextual information about the children (= nested) `RouterOutlet`
|
688 | *
|
689 | * @publicApi
|
690 | */
|
691 | export declare class ChildrenOutletContexts {
|
692 | private contexts;
|
693 |
|
694 | onChildOutletCreated(childName: string, outlet: RouterOutletContract): void;
|
695 | |
696 |
|
697 |
|
698 |
|
699 |
|
700 | onChildOutletDestroyed(childName: string): void;
|
701 | |
702 |
|
703 |
|
704 |
|
705 | onOutletDeactivated(): Map<string, OutletContext>;
|
706 | onOutletReAttached(contexts: Map<string, OutletContext>): void;
|
707 | getOrCreateContext(childName: string): OutletContext;
|
708 | getContext(childName: string): OutletContext | null;
|
709 | static ɵfac: i0.ɵɵFactoryDeclaration<ChildrenOutletContexts, never>;
|
710 | static ɵprov: i0.ɵɵInjectableDeclaration<ChildrenOutletContexts>;
|
711 | }
|
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 |
|
721 | declare type ComponentInputBindingFeature = RouterFeature<RouterFeatureKind.ComponentInputBindingFeature>;
|
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 | export declare function convertToParamMap(params: Params): ParamMap;
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 |
|
739 |
|
740 |
|
741 |
|
742 |
|
743 |
|
744 |
|
745 |
|
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 |
|
752 |
|
753 |
|
754 |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 | export declare function createUrlTreeFromSnapshot(relativeTo: ActivatedRouteSnapshot, commands: any[], queryParams?: Params | null, fragment?: string | null): UrlTree;
|
784 |
|
785 |
|
786 |
|
787 |
|
788 |
|
789 |
|
790 |
|
791 |
|
792 |
|
793 | export declare type Data = {
|
794 | [key: string | symbol]: any;
|
795 | };
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 | export declare type DebugTracingFeature = RouterFeature<RouterFeatureKind.DebugTracingFeature>;
|
806 |
|
807 |
|
808 |
|
809 |
|
810 |
|
811 |
|
812 |
|
813 |
|
814 |
|
815 | export declare interface DefaultExport<T> {
|
816 | |
817 |
|
818 |
|
819 |
|
820 | default: T;
|
821 | }
|
822 |
|
823 |
|
824 |
|
825 |
|
826 | export declare class DefaultTitleStrategy extends TitleStrategy {
|
827 | readonly title: Title;
|
828 | constructor(title: Title);
|
829 | /**
|
830 | * Sets the title of the browser to the given value.
|
831 | *
|
832 | * @param title The `pageTitle` from the deepest primary route.
|
833 | */
|
834 | updateTitle(snapshot: RouterStateSnapshot): void;
|
835 | static ɵfac: i0.ɵɵFactoryDeclaration<DefaultTitleStrategy, never>;
|
836 | static ɵprov: i0.ɵɵInjectableDeclaration<DefaultTitleStrategy>;
|
837 | }
|
838 |
|
839 | /**
|
840 | * Matches the route configuration (`route`) against the actual URL (`segments`).
|
841 | *
|
842 | * When no matcher is defined on a `Route`, this is the matcher used by the Router by default.
|
843 | *
|
844 | * @param segments The remaining unmatched segments in the current navigation
|
845 | * @param segmentGroup The current segment group being matched
|
846 | * @param route The `Route` to match against.
|
847 | *
|
848 | * @see {@link UrlMatchResult}
|
849 | * @see {@link Route}
|
850 | *
|
851 | * @returns The resulting match information or `null` if the `route` should not match.
|
852 | * @publicApi
|
853 | */
|
854 | export declare function defaultUrlMatcher(segments: UrlSegment[], segmentGroup: UrlSegmentGroup, route: Route): UrlMatchResult | null;
|
855 |
|
856 |
|
857 |
|
858 |
|
859 |
|
860 |
|
861 |
|
862 |
|
863 |
|
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 |
|
870 |
|
871 |
|
872 |
|
873 |
|
874 | export declare class DefaultUrlSerializer implements UrlSerializer {
|
875 |
|
876 | parse(url: string): UrlTree;
|
877 |
|
878 | serialize(tree: UrlTree): string;
|
879 | }
|
880 |
|
881 |
|
882 |
|
883 |
|
884 |
|
885 |
|
886 |
|
887 |
|
888 |
|
889 |
|
890 |
|
891 |
|
892 |
|
893 |
|
894 |
|
895 |
|
896 |
|
897 |
|
898 | export declare type DeprecatedGuard = ProviderToken<any> | any;
|
899 |
|
900 |
|
901 |
|
902 |
|
903 |
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 | export declare type DetachedRouteHandle = {};
|
911 |
|
912 |
|
913 |
|
914 |
|
915 |
|
916 |
|
917 |
|
918 |
|
919 |
|
920 |
|
921 | export declare type DisabledInitialNavigationFeature = RouterFeature<RouterFeatureKind.DisabledInitialNavigationFeature>;
|
922 |
|
923 |
|
924 |
|
925 |
|
926 |
|
927 |
|
928 |
|
929 |
|
930 |
|
931 |
|
932 | export declare type EnabledBlockingInitialNavigationFeature = RouterFeature<RouterFeatureKind.EnabledBlockingInitialNavigationFeature>;
|
933 |
|
934 |
|
935 |
|
936 |
|
937 |
|
938 |
|
939 |
|
940 |
|
941 |
|
942 |
|
943 |
|
944 |
|
945 |
|
946 |
|
947 |
|
948 |
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 |
|
957 |
|
958 |
|
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 |
|
966 |
|
967 | declare type Event_2 = NavigationStart | NavigationEnd | NavigationCancel | NavigationError | RoutesRecognized | GuardsCheckStart | GuardsCheckEnd | RouteConfigLoadStart | RouteConfigLoadEnd | ChildActivationStart | ChildActivationEnd | ActivationStart | ActivationEnd | Scroll | ResolveStart | ResolveEnd | NavigationSkipped;
|
968 | export { Event_2 as Event }
|
969 |
|
970 |
|
971 |
|
972 |
|
973 |
|
974 |
|
975 | export declare const enum EventType {
|
976 | NavigationStart = 0,
|
977 | NavigationEnd = 1,
|
978 | NavigationCancel = 2,
|
979 | NavigationError = 3,
|
980 | RoutesRecognized = 4,
|
981 | ResolveStart = 5,
|
982 | ResolveEnd = 6,
|
983 | GuardsCheckStart = 7,
|
984 | GuardsCheckEnd = 8,
|
985 | RouteConfigLoadStart = 9,
|
986 | RouteConfigLoadEnd = 10,
|
987 | ChildActivationStart = 11,
|
988 | ChildActivationEnd = 12,
|
989 | ActivationStart = 13,
|
990 | ActivationEnd = 14,
|
991 | Scroll = 15,
|
992 | NavigationSkipped = 16
|
993 | }
|
994 |
|
995 |
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 |
|
1003 |
|
1004 | export declare interface ExtraOptions extends InMemoryScrollingOptions, RouterConfigOptions {
|
1005 | |
1006 |
|
1007 |
|
1008 |
|
1009 | enableTracing?: boolean;
|
1010 | |
1011 |
|
1012 |
|
1013 |
|
1014 | useHash?: boolean;
|
1015 | |
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 |
|
1025 |
|
1026 | initialNavigation?: InitialNavigation;
|
1027 | |
1028 |
|
1029 |
|
1030 |
|
1031 | bindToComponentInputs?: boolean;
|
1032 | |
1033 |
|
1034 |
|
1035 |
|
1036 |
|
1037 |
|
1038 |
|
1039 | errorHandler?: (error: any) => any;
|
1040 | |
1041 |
|
1042 |
|
1043 |
|
1044 | preloadingStrategy?: any;
|
1045 | |
1046 |
|
1047 |
|
1048 |
|
1049 |
|
1050 |
|
1051 |
|
1052 |
|
1053 | scrollOffset?: [number, number] | (() => [number, number]);
|
1054 | /**
|
1055 | * A custom handler for malformed URI errors. The handler is invoked when `encodedURI` contains
|
1056 | * invalid character sequences.
|
1057 | * The default implementation is to redirect to the root URL, dropping
|
1058 | * any path or parameter information. The function takes three parameters:
|
1059 | *
|
1060 | * - `'URIError'` - Error thrown when parsing a bad URL.
|
1061 | * - `'UrlSerializer'` - UrlSerializer that’s configured with the router.
|
1062 | * - `'url'` - The malformed URL that caused the URIError
|
1063 | *
|
1064 | * @deprecated URI parsing errors should be handled in the `UrlSerializer` instead.
|
1065 | * */
|
1066 | malformedUriErrorHandler?: (error: URIError, urlSerializer: UrlSerializer, url: string) => UrlTree;
|
1067 | }
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 |
|
1073 |
|
1074 |
|
1075 |
|
1076 | export declare class GuardsCheckEnd extends RouterEvent {
|
1077 |
|
1078 | urlAfterRedirects: string;
|
1079 |
|
1080 | state: RouterStateSnapshot;
|
1081 |
|
1082 | shouldActivate: boolean;
|
1083 | readonly type = EventType.GuardsCheckEnd;
|
1084 | constructor(
|
1085 |
|
1086 | id: number,
|
1087 |
|
1088 | url: string,
|
1089 |
|
1090 | urlAfterRedirects: string,
|
1091 |
|
1092 | state: RouterStateSnapshot,
|
1093 |
|
1094 | shouldActivate: boolean);
|
1095 | toString(): string;
|
1096 | }
|
1097 |
|
1098 | /**
|
1099 | * An event triggered at the start of the Guard phase of routing.
|
1100 | *
|
1101 | * @see {@link GuardsCheckEnd}
|
1102 | *
|
1103 | * @publicApi
|
1104 | */
|
1105 | export declare class GuardsCheckStart extends RouterEvent {
|
1106 |
|
1107 | urlAfterRedirects: string;
|
1108 |
|
1109 | state: RouterStateSnapshot;
|
1110 | readonly type = EventType.GuardsCheckStart;
|
1111 | constructor(
|
1112 |
|
1113 | id: number,
|
1114 |
|
1115 | url: string,
|
1116 |
|
1117 | urlAfterRedirects: string,
|
1118 |
|
1119 | state: RouterStateSnapshot);
|
1120 | toString(): string;
|
1121 | }
|
1122 |
|
1123 | declare namespace i1 {
|
1124 | export {
|
1125 | RouterOutletContract,
|
1126 | RouterOutlet,
|
1127 | INPUT_BINDER,
|
1128 | RoutedComponentInputBinder
|
1129 | }
|
1130 | }
|
1131 |
|
1132 | declare namespace i2 {
|
1133 | export {
|
1134 | RouterLink,
|
1135 | RouterLink as RouterLinkWithHref
|
1136 | }
|
1137 | }
|
1138 |
|
1139 | declare namespace i3 {
|
1140 | export {
|
1141 | RouterLinkActive
|
1142 | }
|
1143 | }
|
1144 |
|
1145 | declare namespace i4 {
|
1146 | export {
|
1147 | ɵEmptyOutletComponent,
|
1148 | ɵEmptyOutletComponent as EmptyOutletComponent
|
1149 | }
|
1150 | }
|
1151 |
|
1152 |
|
1153 |
|
1154 |
|
1155 |
|
1156 |
|
1157 |
|
1158 |
|
1159 |
|
1160 |
|
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 |
|
1167 |
|
1168 |
|
1169 |
|
1170 |
|
1171 | export declare type InitialNavigation = 'disabled' | 'enabledBlocking' | 'enabledNonBlocking';
|
1172 |
|
1173 |
|
1174 |
|
1175 |
|
1176 |
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 | export declare type InitialNavigationFeature = EnabledBlockingInitialNavigationFeature | DisabledInitialNavigationFeature;
|
1184 |
|
1185 |
|
1186 |
|
1187 |
|
1188 |
|
1189 |
|
1190 |
|
1191 |
|
1192 |
|
1193 | export declare type InMemoryScrollingFeature = RouterFeature<RouterFeatureKind.InMemoryScrollingFeature>;
|
1194 |
|
1195 |
|
1196 |
|
1197 |
|
1198 |
|
1199 |
|
1200 |
|
1201 | export declare interface InMemoryScrollingOptions {
|
1202 | |
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 | anchorScrolling?: 'disabled' | 'enabled';
|
1210 | |
1211 |
|
1212 |
|
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 |
|
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 |
|
1235 |
|
1236 |
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 | scrollPositionRestoration?: 'disabled' | 'enabled' | 'top';
|
1245 | }
|
1246 |
|
1247 | declare const INPUT_BINDER: InjectionToken<RoutedComponentInputBinder>;
|
1248 |
|
1249 |
|
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 |
|
1255 |
|
1256 | export declare interface IsActiveMatchOptions {
|
1257 | |
1258 |
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 |
|
1264 |
|
1265 |
|
1266 |
|
1267 |
|
1268 |
|
1269 |
|
1270 | matrixParams: 'exact' | 'subset' | 'ignored';
|
1271 | |
1272 |
|
1273 |
|
1274 |
|
1275 |
|
1276 |
|
1277 |
|
1278 |
|
1279 | queryParams: 'exact' | 'subset' | 'ignored';
|
1280 | |
1281 |
|
1282 |
|
1283 |
|
1284 |
|
1285 |
|
1286 |
|
1287 |
|
1288 | paths: 'exact' | 'subset';
|
1289 | |
1290 |
|
1291 |
|
1292 |
|
1293 |
|
1294 | fragment: 'exact' | 'ignored';
|
1295 | }
|
1296 |
|
1297 |
|
1298 |
|
1299 |
|
1300 |
|
1301 |
|
1302 |
|
1303 |
|
1304 | export declare type LoadChildren = LoadChildrenCallback;
|
1305 |
|
1306 |
|
1307 |
|
1308 |
|
1309 |
|
1310 |
|
1311 |
|
1312 |
|
1313 |
|
1314 |
|
1315 |
|
1316 |
|
1317 |
|
1318 |
|
1319 |
|
1320 |
|
1321 |
|
1322 |
|
1323 |
|
1324 |
|
1325 |
|
1326 |
|
1327 |
|
1328 |
|
1329 |
|
1330 |
|
1331 |
|
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 |
|
1341 | export declare type LoadChildrenCallback = () => Type<any> | NgModuleFactory<any> | Routes | Observable<Type<any> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes>> | Promise<NgModuleFactory<any> | Type<any> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes>>;
|
1342 |
|
1343 | declare interface LoadedRouterConfig {
|
1344 | routes: Route[];
|
1345 | injector: EnvironmentInjector | undefined;
|
1346 | }
|
1347 |
|
1348 |
|
1349 |
|
1350 |
|
1351 |
|
1352 |
|
1353 |
|
1354 |
|
1355 |
|
1356 |
|
1357 | export declare function mapToCanActivate(providers: Array<Type<{
|
1358 | canActivate: CanActivateFn;
|
1359 | }>>): CanActivateFn[];
|
1360 |
|
1361 |
|
1362 |
|
1363 |
|
1364 |
|
1365 |
|
1366 |
|
1367 |
|
1368 |
|
1369 |
|
1370 | export declare function mapToCanActivateChild(providers: Array<Type<{
|
1371 | canActivateChild: CanActivateChildFn;
|
1372 | }>>): CanActivateChildFn[];
|
1373 |
|
1374 |
|
1375 |
|
1376 |
|
1377 |
|
1378 |
|
1379 |
|
1380 |
|
1381 |
|
1382 |
|
1383 | export declare function mapToCanDeactivate<T = unknown>(providers: Array<Type<{
|
1384 | canDeactivate: CanDeactivateFn<T>;
|
1385 | }>>): CanDeactivateFn<T>[];
|
1386 |
|
1387 |
|
1388 |
|
1389 |
|
1390 |
|
1391 |
|
1392 |
|
1393 |
|
1394 |
|
1395 |
|
1396 | export declare function mapToCanMatch(providers: Array<Type<{
|
1397 | canMatch: CanMatchFn;
|
1398 | }>>): CanMatchFn[];
|
1399 |
|
1400 |
|
1401 |
|
1402 |
|
1403 |
|
1404 |
|
1405 |
|
1406 |
|
1407 |
|
1408 |
|
1409 | export declare function mapToResolve<T>(provider: Type<{
|
1410 | resolve: ResolveFn<T>;
|
1411 | }>): ResolveFn<T>;
|
1412 |
|
1413 |
|
1414 |
|
1415 |
|
1416 |
|
1417 |
|
1418 |
|
1419 |
|
1420 |
|
1421 |
|
1422 |
|
1423 |
|
1424 |
|
1425 |
|
1426 |
|
1427 |
|
1428 |
|
1429 |
|
1430 |
|
1431 |
|
1432 |
|
1433 |
|
1434 |
|
1435 |
|
1436 |
|
1437 | export declare interface Navigation {
|
1438 | |
1439 |
|
1440 |
|
1441 | id: number;
|
1442 | |
1443 |
|
1444 |
|
1445 |
|
1446 | initialUrl: UrlTree;
|
1447 | |
1448 |
|
1449 |
|
1450 | extractedUrl: UrlTree;
|
1451 | |
1452 |
|
1453 |
|
1454 |
|
1455 |
|
1456 | finalUrl?: UrlTree;
|
1457 | |
1458 |
|
1459 |
|
1460 |
|
1461 |
|
1462 |
|
1463 |
|
1464 | trigger: 'imperative' | 'popstate' | 'hashchange';
|
1465 | |
1466 |
|
1467 |
|
1468 |
|
1469 | extras: NavigationExtras;
|
1470 | |
1471 |
|
1472 |
|
1473 |
|
1474 |
|
1475 | previousNavigation: Navigation | null;
|
1476 | }
|
1477 |
|
1478 |
|
1479 |
|
1480 |
|
1481 |
|
1482 |
|
1483 |
|
1484 |
|
1485 |
|
1486 |
|
1487 |
|
1488 |
|
1489 |
|
1490 |
|
1491 | export declare interface NavigationBehaviorOptions {
|
1492 | |
1493 |
|
1494 |
|
1495 |
|
1496 |
|
1497 |
|
1498 |
|
1499 |
|
1500 |
|
1501 | onSameUrlNavigation?: Extract<OnSameUrlNavigation, 'reload'>;
|
1502 | |
1503 |
|
1504 |
|
1505 |
|
1506 |
|
1507 |
|
1508 |
|
1509 |
|
1510 | skipLocationChange?: boolean;
|
1511 | |
1512 |
|
1513 |
|
1514 |
|
1515 |
|
1516 |
|
1517 |
|
1518 |
|
1519 | replaceUrl?: boolean;
|
1520 | |
1521 |
|
1522 |
|
1523 |
|
1524 |
|
1525 |
|
1526 |
|
1527 |
|
1528 |
|
1529 |
|
1530 |
|
1531 |
|
1532 |
|
1533 |
|
1534 |
|
1535 | state?: {
|
1536 | [k: string]: any;
|
1537 | };
|
1538 | }
|
1539 |
|
1540 |
|
1541 |
|
1542 |
|
1543 |
|
1544 |
|
1545 |
|
1546 |
|
1547 |
|
1548 |
|
1549 |
|
1550 |
|
1551 | export declare class NavigationCancel extends RouterEvent {
|
1552 | |
1553 |
|
1554 |
|
1555 |
|
1556 | reason: string;
|
1557 | |
1558 |
|
1559 |
|
1560 |
|
1561 |
|
1562 | readonly code?: NavigationCancellationCode | undefined;
|
1563 | readonly type = EventType.NavigationCancel;
|
1564 | constructor(
|
1565 |
|
1566 | id: number,
|
1567 |
|
1568 | url: string,
|
1569 | |
1570 |
|
1571 |
|
1572 |
|
1573 | reason: string,
|
1574 | |
1575 |
|
1576 |
|
1577 |
|
1578 |
|
1579 | code?: NavigationCancellationCode | undefined);
|
1580 | /** @docsNotRequired */
|
1581 | toString(): string;
|
1582 | }
|
1583 |
|
1584 | /**
|
1585 | * A code for the `NavigationCancel` event of the `Router` to indicate the
|
1586 | * reason a navigation failed.
|
1587 | *
|
1588 | * @publicApi
|
1589 | */
|
1590 | export declare const enum NavigationCancellationCode {
|
1591 | |
1592 |
|
1593 |
|
1594 | Redirect = 0,
|
1595 | |
1596 |
|
1597 |
|
1598 | SupersededByNewNavigation = 1,
|
1599 | |
1600 |
|
1601 |
|
1602 | NoDataFromResolver = 2,
|
1603 | |
1604 |
|
1605 |
|
1606 | GuardRejected = 3
|
1607 | }
|
1608 |
|
1609 |
|
1610 |
|
1611 |
|
1612 |
|
1613 |
|
1614 |
|
1615 |
|
1616 |
|
1617 |
|
1618 | export declare class NavigationEnd extends RouterEvent {
|
1619 |
|
1620 | urlAfterRedirects: string;
|
1621 | readonly type = EventType.NavigationEnd;
|
1622 | constructor(
|
1623 |
|
1624 | id: number,
|
1625 |
|
1626 | url: string,
|
1627 |
|
1628 | urlAfterRedirects: string);
|
1629 | /** @docsNotRequired */
|
1630 | toString(): string;
|
1631 | }
|
1632 |
|
1633 | /**
|
1634 | * An event triggered when a navigation fails due to an unexpected error.
|
1635 | *
|
1636 | * @see {@link NavigationStart}
|
1637 | * @see {@link NavigationEnd}
|
1638 | * @see {@link NavigationCancel}
|
1639 | *
|
1640 | * @publicApi
|
1641 | */
|
1642 | export declare class NavigationError extends RouterEvent {
|
1643 |
|
1644 | error: any;
|
1645 | |
1646 |
|
1647 |
|
1648 |
|
1649 |
|
1650 |
|
1651 | readonly target?: RouterStateSnapshot | undefined;
|
1652 | readonly type = EventType.NavigationError;
|
1653 | constructor(
|
1654 |
|
1655 | id: number,
|
1656 |
|
1657 | url: string,
|
1658 |
|
1659 | error: any,
|
1660 | |
1661 |
|
1662 |
|
1663 |
|
1664 |
|
1665 |
|
1666 | target?: RouterStateSnapshot | undefined);
|
1667 | /** @docsNotRequired */
|
1668 | toString(): string;
|
1669 | }
|
1670 |
|
1671 | /**
|
1672 | * A type alias for providers returned by `withNavigationErrorHandler` for use with `provideRouter`.
|
1673 | *
|
1674 | * @see {@link withNavigationErrorHandler}
|
1675 | * @see {@link provideRouter}
|
1676 | *
|
1677 | * @publicApi
|
1678 | */
|
1679 | export declare type NavigationErrorHandlerFeature = RouterFeature<RouterFeatureKind.NavigationErrorHandlerFeature>;
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 |
|
1687 |
|
1688 |
|
1689 |
|
1690 |
|
1691 |
|
1692 |
|
1693 |
|
1694 |
|
1695 |
|
1696 |
|
1697 | export declare interface NavigationExtras extends UrlCreationOptions, NavigationBehaviorOptions {
|
1698 | }
|
1699 |
|
1700 |
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 |
|
1707 |
|
1708 | export declare class NavigationSkipped extends RouterEvent {
|
1709 | |
1710 |
|
1711 |
|
1712 |
|
1713 | reason: string;
|
1714 | |
1715 |
|
1716 |
|
1717 |
|
1718 |
|
1719 | readonly code?: NavigationSkippedCode | undefined;
|
1720 | readonly type = EventType.NavigationSkipped;
|
1721 | constructor(
|
1722 |
|
1723 | id: number,
|
1724 |
|
1725 | url: string,
|
1726 | |
1727 |
|
1728 |
|
1729 |
|
1730 | reason: string,
|
1731 | |
1732 |
|
1733 |
|
1734 |
|
1735 |
|
1736 | code?: NavigationSkippedCode | undefined);
|
1737 | }
|
1738 |
|
1739 | /**
|
1740 | * A code for the `NavigationSkipped` event of the `Router` to indicate the
|
1741 | * reason a navigation was skipped.
|
1742 | *
|
1743 | * @publicApi
|
1744 | */
|
1745 | export declare const enum NavigationSkippedCode {
|
1746 | |
1747 |
|
1748 |
|
1749 | IgnoredSameUrlNavigation = 0,
|
1750 | |
1751 |
|
1752 |
|
1753 |
|
1754 |
|
1755 |
|
1756 | IgnoredByUrlHandlingStrategy = 1
|
1757 | }
|
1758 |
|
1759 |
|
1760 |
|
1761 |
|
1762 |
|
1763 |
|
1764 | export declare class NavigationStart extends RouterEvent {
|
1765 | readonly type = EventType.NavigationStart;
|
1766 | |
1767 |
|
1768 |
|
1769 |
|
1770 |
|
1771 |
|
1772 |
|
1773 |
|
1774 | navigationTrigger?: NavigationTrigger;
|
1775 | |
1776 |
|
1777 |
|
1778 |
|
1779 |
|
1780 |
|
1781 |
|
1782 |
|
1783 |
|
1784 |
|
1785 |
|
1786 |
|
1787 |
|
1788 |
|
1789 |
|
1790 |
|
1791 |
|
1792 | restoredState?: {
|
1793 | [k: string]: any;
|
1794 | navigationId: number;
|
1795 | } | null;
|
1796 | constructor(
|
1797 |
|
1798 | id: number,
|
1799 |
|
1800 | url: string,
|
1801 |
|
1802 | navigationTrigger?: NavigationTrigger,
|
1803 |
|
1804 | restoredState?: {
|
1805 | [k: string]: any;
|
1806 | navigationId: number;
|
1807 | } | null);
|
1808 | /** @docsNotRequired */
|
1809 | toString(): string;
|
1810 | }
|
1811 |
|
1812 | /**
|
1813 | * Identifies the call or event that triggered a navigation.
|
1814 | *
|
1815 | * * 'imperative': Triggered by `router.navigateByUrl()` or `router.navigate()`.
|
1816 | * * 'popstate' : Triggered by a `popstate` event.
|
1817 | * * 'hashchange'-: Triggered by a `hashchange` event.
|
1818 | *
|
1819 | * @publicApi
|
1820 | */
|
1821 | declare type NavigationTrigger = 'imperative' | 'popstate' | 'hashchange';
|
1822 |
|
1823 | /**
|
1824 | * @description
|
1825 | *
|
1826 | * Provides a preloading strategy that does not preload any modules.
|
1827 | *
|
1828 | * This strategy is enabled by default.
|
1829 | *
|
1830 | * @publicApi
|
1831 | */
|
1832 | export declare class NoPreloading implements PreloadingStrategy {
|
1833 | preload(route: Route, fn: () => Observable<any>): Observable<any>;
|
1834 | static ɵfac: i0.ɵɵFactoryDeclaration<NoPreloading, never>;
|
1835 | static ɵprov: i0.ɵɵInjectableDeclaration<NoPreloading>;
|
1836 | }
|
1837 |
|
1838 |
|
1839 |
|
1840 |
|
1841 |
|
1842 |
|
1843 |
|
1844 |
|
1845 |
|
1846 |
|
1847 |
|
1848 |
|
1849 |
|
1850 |
|
1851 |
|
1852 |
|
1853 |
|
1854 |
|
1855 |
|
1856 |
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 | export declare type OnSameUrlNavigation = 'reload' | 'ignore';
|
1863 |
|
1864 |
|
1865 |
|
1866 |
|
1867 |
|
1868 |
|
1869 | export declare class OutletContext {
|
1870 | outlet: RouterOutletContract | null;
|
1871 | route: ActivatedRoute | null;
|
1872 | injector: EnvironmentInjector | null;
|
1873 | children: ChildrenOutletContexts;
|
1874 | attachRef: ComponentRef<any> | null;
|
1875 | }
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 |
|
1885 |
|
1886 |
|
1887 | export declare interface ParamMap {
|
1888 | |
1889 |
|
1890 |
|
1891 |
|
1892 |
|
1893 | has(name: string): boolean;
|
1894 | |
1895 |
|
1896 |
|
1897 |
|
1898 |
|
1899 |
|
1900 |
|
1901 | get(name: string): string | null;
|
1902 | |
1903 |
|
1904 |
|
1905 |
|
1906 |
|
1907 |
|
1908 |
|
1909 | getAll(name: string): string[];
|
1910 |
|
1911 | readonly keys: string[];
|
1912 | }
|
1913 |
|
1914 |
|
1915 |
|
1916 |
|
1917 |
|
1918 |
|
1919 |
|
1920 |
|
1921 | export declare type Params = {
|
1922 | [key: string]: any;
|
1923 | };
|
1924 |
|
1925 |
|
1926 |
|
1927 |
|
1928 |
|
1929 |
|
1930 |
|
1931 |
|
1932 |
|
1933 |
|
1934 |
|
1935 |
|
1936 | export declare class PreloadAllModules implements PreloadingStrategy {
|
1937 | preload(route: Route, fn: () => Observable<any>): Observable<any>;
|
1938 | static ɵfac: i0.ɵɵFactoryDeclaration<PreloadAllModules, never>;
|
1939 | static ɵprov: i0.ɵɵInjectableDeclaration<PreloadAllModules>;
|
1940 | }
|
1941 |
|
1942 |
|
1943 |
|
1944 |
|
1945 |
|
1946 |
|
1947 |
|
1948 |
|
1949 |
|
1950 |
|
1951 | export declare type PreloadingFeature = RouterFeature<RouterFeatureKind.PreloadingFeature>;
|
1952 |
|
1953 |
|
1954 |
|
1955 |
|
1956 |
|
1957 |
|
1958 |
|
1959 |
|
1960 | export declare abstract class PreloadingStrategy {
|
1961 | abstract preload(route: Route, fn: () => Observable<any>): Observable<any>;
|
1962 | }
|
1963 |
|
1964 |
|
1965 |
|
1966 |
|
1967 |
|
1968 |
|
1969 | export declare const PRIMARY_OUTLET = "primary";
|
1970 |
|
1971 |
|
1972 |
|
1973 |
|
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 |
|
1979 |
|
1980 |
|
1981 |
|
1982 |
|
1983 |
|
1984 |
|
1985 |
|
1986 |
|
1987 |
|
1988 |
|
1989 |
|
1990 |
|
1991 |
|
1992 |
|
1993 |
|
1994 |
|
1995 |
|
1996 |
|
1997 |
|
1998 |
|
1999 |
|
2000 |
|
2001 |
|
2002 |
|
2003 |
|
2004 |
|
2005 |
|
2006 |
|
2007 | export declare function provideRouter(routes: Routes, ...features: RouterFeatures[]): EnvironmentProviders;
|
2008 |
|
2009 |
|
2010 |
|
2011 |
|
2012 |
|
2013 |
|
2014 |
|
2015 |
|
2016 |
|
2017 |
|
2018 |
|
2019 |
|
2020 |
|
2021 |
|
2022 |
|
2023 |
|
2024 |
|
2025 |
|
2026 | export declare function provideRoutes(routes: Routes): Provider[];
|
2027 |
|
2028 |
|
2029 |
|
2030 |
|
2031 |
|
2032 |
|
2033 |
|
2034 |
|
2035 |
|
2036 |
|
2037 |
|
2038 |
|
2039 |
|
2040 | export declare type QueryParamsHandling = 'merge' | 'preserve' | '';
|
2041 |
|
2042 |
|
2043 |
|
2044 |
|
2045 |
|
2046 |
|
2047 |
|
2048 |
|
2049 |
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 |
|
2058 |
|
2059 |
|
2060 |
|
2061 |
|
2062 |
|
2063 |
|
2064 |
|
2065 |
|
2066 |
|
2067 |
|
2068 |
|
2069 |
|
2070 |
|
2071 |
|
2072 |
|
2073 |
|
2074 |
|
2075 |
|
2076 |
|
2077 |
|
2078 |
|
2079 |
|
2080 |
|
2081 |
|
2082 |
|
2083 |
|
2084 |
|
2085 |
|
2086 |
|
2087 |
|
2088 |
|
2089 |
|
2090 |
|
2091 |
|
2092 |
|
2093 |
|
2094 |
|
2095 |
|
2096 |
|
2097 |
|
2098 |
|
2099 |
|
2100 |
|
2101 |
|
2102 |
|
2103 |
|
2104 |
|
2105 |
|
2106 |
|
2107 |
|
2108 |
|
2109 |
|
2110 |
|
2111 |
|
2112 |
|
2113 |
|
2114 |
|
2115 |
|
2116 |
|
2117 |
|
2118 |
|
2119 |
|
2120 |
|
2121 |
|
2122 |
|
2123 |
|
2124 |
|
2125 |
|
2126 |
|
2127 |
|
2128 |
|
2129 |
|
2130 |
|
2131 |
|
2132 |
|
2133 |
|
2134 |
|
2135 |
|
2136 |
|
2137 |
|
2138 |
|
2139 | export declare interface Resolve<T> {
|
2140 | resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<T> | Promise<T> | T;
|
2141 | }
|
2142 |
|
2143 |
|
2144 |
|
2145 |
|
2146 |
|
2147 |
|
2148 |
|
2149 |
|
2150 |
|
2151 | export declare type ResolveData = {
|
2152 | [key: string | symbol]: ResolveFn<unknown> | DeprecatedGuard;
|
2153 | };
|
2154 |
|
2155 |
|
2156 |
|
2157 |
|
2158 |
|
2159 |
|
2160 |
|
2161 | export declare class ResolveEnd extends RouterEvent {
|
2162 |
|
2163 | urlAfterRedirects: string;
|
2164 |
|
2165 | state: RouterStateSnapshot;
|
2166 | readonly type = EventType.ResolveEnd;
|
2167 | constructor(
|
2168 |
|
2169 | id: number,
|
2170 |
|
2171 | url: string,
|
2172 |
|
2173 | urlAfterRedirects: string,
|
2174 |
|
2175 | state: RouterStateSnapshot);
|
2176 | toString(): string;
|
2177 | }
|
2178 |
|
2179 | /**
|
2180 | * Function type definition for a data provider.
|
2181 |
|
2182 | * A data provider can be used with the router to resolve data during navigation.
|
2183 | * The router waits for the data to be resolved before the route is finally activated.
|
2184 | *
|
2185 | * The following example implements a function that retrieves the data
|
2186 | * needed to activate the requested route.
|
2187 | *
|
2188 | * {@example router/route_functional_guards.ts region="ResolveFn"}
|
2189 | *
|
2190 | * And you can access to your resolved data from `HeroComponent`:
|
2191 | *
|
2192 | * {@example router/route_functional_guards.ts region="ResolveDataUse"}
|
2193 | *
|
2194 | * @usageNotes
|
2195 | *
|
2196 | * When both guard and resolvers are specified, the resolvers are not executed until
|
2197 | * all guards have run and succeeded.
|
2198 | * For example, consider the following route configuration:
|
2199 | *
|
2200 | * ```
|
2201 | * {
|
2202 | * path: 'base'
|
2203 | * canActivate: [baseGuard],
|
2204 | * resolve: {data: baseDataResolver}
|
2205 | * children: [
|
2206 | * {
|
2207 | * path: 'child',
|
2208 | * canActivate: [childGuard],
|
2209 | * component: ChildComponent,
|
2210 | * resolve: {childData: childDataResolver}
|
2211 | * }
|
2212 | * ]
|
2213 | * }
|
2214 | * ```
|
2215 | * The order of execution is: baseGuard, childGuard, baseDataResolver, childDataResolver.
|
2216 | *
|
2217 | * @publicApi
|
2218 | * @see {@link Route}
|
2219 | */
|
2220 | export declare type ResolveFn<T> = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => Observable<T> | Promise<T> | T;
|
2221 |
|
2222 | /**
|
2223 | * An event triggered at the start of the Resolve phase of routing.
|
2224 | *
|
2225 | * Runs in the "resolve" phase whether or not there is anything to resolve.
|
2226 | * In future, may change to only run when there are things to be resolved.
|
2227 | *
|
2228 | * @see {@link ResolveEnd}
|
2229 | *
|
2230 | * @publicApi
|
2231 | */
|
2232 | export declare class ResolveStart extends RouterEvent {
|
2233 | /** @docsNotRequired */
|
2234 | urlAfterRedirects: string;
|
2235 | /** @docsNotRequired */
|
2236 | state: RouterStateSnapshot;
|
2237 | readonly type = EventType.ResolveStart;
|
2238 | constructor(
|
2239 | /** @docsNotRequired */
|
2240 | id: number,
|
2241 | /** @docsNotRequired */
|
2242 | url: string,
|
2243 | /** @docsNotRequired */
|
2244 | urlAfterRedirects: string,
|
2245 | /** @docsNotRequired */
|
2246 | state: RouterStateSnapshot);
|
2247 | toString(): string;
|
2248 | }
|
2249 |
|
2250 | /**
|
2251 | * A configuration object that defines a single route.
|
2252 | * A set of routes are collected in a `Routes` array to define a `Router` configuration.
|
2253 | * The router attempts to match segments of a given URL against each route,
|
2254 | * using the configuration options defined in this object.
|
2255 | *
|
2256 | * Supports static, parameterized, redirect, and wildcard routes, as well as
|
2257 | * custom route data and resolve methods.
|
2258 | *
|
2259 | * For detailed usage information, see the [Routing Guide](guide/router).
|
2260 | *
|
2261 | * @usageNotes
|
2262 | *
|
2263 | * ### Simple Configuration
|
2264 | *
|
2265 | * The following route specifies that when navigating to, for example,
|
2266 | * `/team/11/user/bob`, the router creates the 'Team' component
|
2267 | * with the 'User' child component in it.
|
2268 | *
|
2269 | * ```
|
2270 | * [{
|
2271 | * path: 'team/:id',
|
2272 | * component: Team,
|
2273 | * children: [{
|
2274 | * path: 'user/:name',
|
2275 | * component: User
|
2276 | * }]
|
2277 | * }]
|
2278 | * ```
|
2279 | *
|
2280 | * ### Multiple Outlets
|
2281 | *
|
2282 | * The following route creates sibling components with multiple outlets.
|
2283 | * When navigating to `/team/11(aux:chat/jim)`, the router creates the 'Team' component next to
|
2284 | * the 'Chat' component. The 'Chat' component is placed into the 'aux' outlet.
|
2285 | *
|
2286 | * ```
|
2287 | * [{
|
2288 | * path: 'team/:id',
|
2289 | * component: Team
|
2290 | * }, {
|
2291 | * path: 'chat/:user',
|
2292 | * component: Chat
|
2293 | * outlet: 'aux'
|
2294 | * }]
|
2295 | * ```
|
2296 | *
|
2297 | * ### Wild Cards
|
2298 | *
|
2299 | * The following route uses wild-card notation to specify a component
|
2300 | * that is always instantiated regardless of where you navigate to.
|
2301 | *
|
2302 | * ```
|
2303 | * [{
|
2304 | * path: '**',
|
2305 | * component: WildcardComponent
|
2306 | * }]
|
2307 | * ```
|
2308 | *
|
2309 | * ### Redirects
|
2310 | *
|
2311 | * The following route uses the `redirectTo` property to ignore a segment of
|
2312 | * a given URL when looking for a child path.
|
2313 | *
|
2314 | * When navigating to '/team/11/legacy/user/jim', the router changes the URL segment
|
2315 | * '/team/11/legacy/user/jim' to '/team/11/user/jim', and then instantiates
|
2316 | * the Team component with the User child component in it.
|
2317 | *
|
2318 | * ```
|
2319 | * [{
|
2320 | * path: 'team/:id',
|
2321 | * component: Team,
|
2322 | * children: [{
|
2323 | * path: 'legacy/user/:name',
|
2324 | * redirectTo: 'user/:name'
|
2325 | * }, {
|
2326 | * path: 'user/:name',
|
2327 | * component: User
|
2328 | * }]
|
2329 | * }]
|
2330 | * ```
|
2331 | *
|
2332 | * The redirect path can be relative, as shown in this example, or absolute.
|
2333 | * If we change the `redirectTo` value in the example to the absolute URL segment '/user/:name',
|
2334 | * the result URL is also absolute, '/user/jim'.
|
2335 |
|
2336 | * ### Empty Path
|
2337 | *
|
2338 | * Empty-path route configurations can be used to instantiate components that do not 'consume'
|
2339 | * any URL segments.
|
2340 | *
|
2341 | * In the following configuration, when navigating to
|
2342 | * `/team/11`, the router instantiates the 'AllUsers' component.
|
2343 | *
|
2344 | * ```
|
2345 | * [{
|
2346 | * path: 'team/:id',
|
2347 | * component: Team,
|
2348 | * children: [{
|
2349 | * path: '',
|
2350 | * component: AllUsers
|
2351 | * }, {
|
2352 | * path: 'user/:name',
|
2353 | * component: User
|
2354 | * }]
|
2355 | * }]
|
2356 | * ```
|
2357 | *
|
2358 | * Empty-path routes can have children. In the following example, when navigating
|
2359 | * to `/team/11/user/jim`, the router instantiates the wrapper component with
|
2360 | * the user component in it.
|
2361 | *
|
2362 | * Note that an empty path route inherits its parent's parameters and data.
|
2363 | *
|
2364 | * ```
|
2365 | * [{
|
2366 | * path: 'team/:id',
|
2367 | * component: Team,
|
2368 | * children: [{
|
2369 | * path: '',
|
2370 | * component: WrapperCmp,
|
2371 | * children: [{
|
2372 | * path: 'user/:name',
|
2373 | * component: User
|
2374 | * }]
|
2375 | * }]
|
2376 | * }]
|
2377 | * ```
|
2378 | *
|
2379 | * ### Matching Strategy
|
2380 | *
|
2381 | * The default path-match strategy is 'prefix', which means that the router
|
2382 | * checks URL elements from the left to see if the URL matches a specified path.
|
2383 | * For example, '/team/11/user' matches 'team/:id'.
|
2384 | *
|
2385 | * ```
|
2386 | * [{
|
2387 | * path: '',
|
2388 | * pathMatch: 'prefix',
|
2389 | * redirectTo: 'main'
|
2390 | * }, {
|
2391 | * path: 'main',
|
2392 | * component: Main
|
2393 | * }]
|
2394 | * ```
|
2395 | *
|
2396 | * You can specify the path-match strategy 'full' to make sure that the path
|
2397 | * covers the whole unconsumed URL. It is important to do this when redirecting
|
2398 | * empty-path routes. Otherwise, because an empty path is a prefix of any URL,
|
2399 | * the router would apply the redirect even when navigating to the redirect destination,
|
2400 | * creating an endless loop.
|
2401 | *
|
2402 | * In the following example, supplying the 'full' `pathMatch` strategy ensures
|
2403 | * that the router applies the redirect if and only if navigating to '/'.
|
2404 | *
|
2405 | * ```
|
2406 | * [{
|
2407 | * path: '',
|
2408 | * pathMatch: 'full',
|
2409 | * redirectTo: 'main'
|
2410 | * }, {
|
2411 | * path: 'main',
|
2412 | * component: Main
|
2413 | * }]
|
2414 | * ```
|
2415 | *
|
2416 | * ### Componentless Routes
|
2417 | *
|
2418 | * You can share parameters between sibling components.
|
2419 | * For example, suppose that two sibling components should go next to each other,
|
2420 | * and both of them require an ID parameter. You can accomplish this using a route
|
2421 | * that does not specify a component at the top level.
|
2422 | *
|
2423 | * In the following example, 'MainChild' and 'AuxChild' are siblings.
|
2424 | * When navigating to 'parent/10/(a//aux:b)', the route instantiates
|
2425 | * the main child and aux child components next to each other.
|
2426 | * For this to work, the application component must have the primary and aux outlets defined.
|
2427 | *
|
2428 | * ```
|
2429 | * [{
|
2430 | * path: 'parent/:id',
|
2431 | * children: [
|
2432 | * { path: 'a', component: MainChild },
|
2433 | * { path: 'b', component: AuxChild, outlet: 'aux' }
|
2434 | * ]
|
2435 | * }]
|
2436 | * ```
|
2437 | *
|
2438 | * The router merges the parameters, data, and resolve of the componentless
|
2439 | * parent into the parameters, data, and resolve of the children.
|
2440 | *
|
2441 | * This is especially useful when child components are defined
|
2442 | * with an empty path string, as in the following example.
|
2443 | * With this configuration, navigating to '/parent/10' creates
|
2444 | * the main child and aux components.
|
2445 | *
|
2446 | * ```
|
2447 | * [{
|
2448 | * path: 'parent/:id',
|
2449 | * children: [
|
2450 | * { path: '', component: MainChild },
|
2451 | * { path: '', component: AuxChild, outlet: 'aux' }
|
2452 | * ]
|
2453 | * }]
|
2454 | * ```
|
2455 | *
|
2456 | * ### Lazy Loading
|
2457 | *
|
2458 | * Lazy loading speeds up application load time by splitting the application
|
2459 | * into multiple bundles and loading them on demand.
|
2460 | * To use lazy loading, provide the `loadChildren` property in the `Route` object,
|
2461 | * instead of the `children` property.
|
2462 | *
|
2463 | * Given the following example route, the router will lazy load
|
2464 | * the associated module on demand using the browser native import system.
|
2465 | *
|
2466 | * ```
|
2467 | * [{
|
2468 | * path: 'lazy',
|
2469 | * loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule),
|
2470 | * }];
|
2471 | * ```
|
2472 | *
|
2473 | * @publicApi
|
2474 | */
|
2475 | export declare interface Route {
|
2476 | /**
|
2477 | * Used to define a page title for the route. This can be a static string or an `Injectable` that
|
2478 | * implements `Resolve`.
|
2479 | *
|
2480 | * @see {@link TitleStrategy}
|
2481 | */
|
2482 | title?: string | Type<Resolve<string>> | ResolveFn<string>;
|
2483 | /**
|
2484 | * The path to match against. Cannot be used together with a custom `matcher` function.
|
2485 | * A URL string that uses router matching notation.
|
2486 | * Can be a wild card (`**`) that matches any URL (see Usage Notes below).
|
2487 | * Default is "/" (the root path).
|
2488 | *
|
2489 | */
|
2490 | path?: string;
|
2491 | /**
|
2492 | * The path-matching strategy, one of 'prefix' or 'full'.
|
2493 | * Default is 'prefix'.
|
2494 | *
|
2495 | * By default, the router checks URL elements from the left to see if the URL
|
2496 | * matches a given path and stops when there is a config match. Importantly there must still be a
|
2497 | * config match for each segment of the URL. For example, '/team/11/user' matches the prefix
|
2498 | * 'team/:id' if one of the route's children matches the segment 'user'. That is, the URL
|
2499 | * '/team/11/user' matches the config
|
2500 | * `{path: 'team/:id', children: [{path: ':user', component: User}]}`
|
2501 | * but does not match when there are no children as in `{path: 'team/:id', component: Team}`.
|
2502 | *
|
2503 | * The path-match strategy 'full' matches against the entire URL.
|
2504 | * It is important to do this when redirecting empty-path routes.
|
2505 | * Otherwise, because an empty path is a prefix of any URL,
|
2506 | * the router would apply the redirect even when navigating
|
2507 | * to the redirect destination, creating an endless loop.
|
2508 | *
|
2509 | */
|
2510 | pathMatch?: 'prefix' | 'full';
|
2511 | /**
|
2512 | * A custom URL-matching function. Cannot be used together with `path`.
|
2513 | */
|
2514 | matcher?: UrlMatcher;
|
2515 | /**
|
2516 | * The component to instantiate when the path matches.
|
2517 | * Can be empty if child routes specify components.
|
2518 | */
|
2519 | component?: Type<any>;
|
2520 | /**
|
2521 | * An object specifying a lazy-loaded component.
|
2522 | */
|
2523 | loadComponent?: () => Type<unknown> | Observable<Type<unknown> | DefaultExport<Type<unknown>>> | Promise<Type<unknown> | DefaultExport<Type<unknown>>>;
|
2524 | /**
|
2525 | * A URL to redirect to when the path matches.
|
2526 | *
|
2527 | * Absolute if the URL begins with a slash (/), otherwise relative to the path URL.
|
2528 | * Note that no further redirects are evaluated after an absolute redirect.
|
2529 | *
|
2530 | * When not present, router does not redirect.
|
2531 | */
|
2532 | redirectTo?: string;
|
2533 | /**
|
2534 | * Name of a `RouterOutlet` object where the component can be placed
|
2535 | * when the path matches.
|
2536 | */
|
2537 | outlet?: string;
|
2538 | /**
|
2539 | * An array of `CanActivateFn` or DI tokens used to look up `CanActivate()`
|
2540 | * handlers, in order to determine if the current user is allowed to
|
2541 | * activate the component. By default, any user can activate.
|
2542 | *
|
2543 | * When using a function rather than DI tokens, the function can call `inject` to get any required
|
2544 | * dependencies. This `inject` call must be done in a synchronous context.
|
2545 | */
|
2546 | canActivate?: Array<CanActivateFn | DeprecatedGuard>;
|
2547 | /**
|
2548 | * An array of `CanMatchFn` or DI tokens used to look up `CanMatch()`
|
2549 | * handlers, in order to determine if the current user is allowed to
|
2550 | * match the `Route`. By default, any route can match.
|
2551 | *
|
2552 | * When using a function rather than DI tokens, the function can call `inject` to get any required
|
2553 | * dependencies. This `inject` call must be done in a synchronous context.
|
2554 | */
|
2555 | canMatch?: Array<CanMatchFn | DeprecatedGuard>;
|
2556 | /**
|
2557 | * An array of `CanActivateChildFn` or DI tokens used to look up `CanActivateChild()` handlers,
|
2558 | * in order to determine if the current user is allowed to activate
|
2559 | * a child of the component. By default, any user can activate a child.
|
2560 | *
|
2561 | * When using a function rather than DI tokens, the function can call `inject` to get any required
|
2562 | * dependencies. This `inject` call must be done in a synchronous context.
|
2563 | */
|
2564 | canActivateChild?: Array<CanActivateChildFn | DeprecatedGuard>;
|
2565 | /**
|
2566 | * An array of `CanDeactivateFn` or DI tokens used to look up `CanDeactivate()`
|
2567 | * handlers, in order to determine if the current user is allowed to
|
2568 | * deactivate the component. By default, any user can deactivate.
|
2569 | *
|
2570 | * When using a function rather than DI tokens, the function can call `inject` to get any required
|
2571 | * dependencies. This `inject` call must be done in a synchronous context.
|
2572 | */
|
2573 | canDeactivate?: Array<CanDeactivateFn<any> | DeprecatedGuard>;
|
2574 | /**
|
2575 | * An array of `CanLoadFn` or DI tokens used to look up `CanLoad()`
|
2576 | * handlers, in order to determine if the current user is allowed to
|
2577 | * load the component. By default, any user can load.
|
2578 | *
|
2579 | * When using a function rather than DI tokens, the function can call `inject` to get any required
|
2580 | * dependencies. This `inject` call must be done in a synchronous context.
|
2581 | * @deprecated Use `canMatch` instead
|
2582 | */
|
2583 | canLoad?: Array<CanLoadFn | DeprecatedGuard>;
|
2584 | /**
|
2585 | * Additional developer-defined data provided to the component via
|
2586 | * `ActivatedRoute`. By default, no additional data is passed.
|
2587 | */
|
2588 | data?: Data;
|
2589 | /**
|
2590 | * A map of DI tokens used to look up data resolvers. See `Resolve`.
|
2591 | */
|
2592 | resolve?: ResolveData;
|
2593 | /**
|
2594 | * An array of child `Route` objects that specifies a nested route
|
2595 | * configuration.
|
2596 | */
|
2597 | children?: Routes;
|
2598 | /**
|
2599 | * An object specifying lazy-loaded child routes.
|
2600 | */
|
2601 | loadChildren?: LoadChildren;
|
2602 | /**
|
2603 | * A policy for when to run guards and resolvers on a route.
|
2604 | *
|
2605 | * Guards and/or resolvers will always run when a route is activated or deactivated. When a route
|
2606 | * is unchanged, the default behavior is the same as `paramsChange`.
|
2607 | *
|
2608 | * `paramsChange` : Rerun the guards and resolvers when path or
|
2609 | * path param changes. This does not include query parameters. This option is the default.
|
2610 | * - `always` : Run on every execution.
|
2611 | * - `pathParamsChange` : Rerun guards and resolvers when the path params
|
2612 | * change. This does not compare matrix or query parameters.
|
2613 | * - `paramsOrQueryParamsChange` : Run when path, matrix, or query parameters change.
|
2614 | * - `pathParamsOrQueryParamsChange` : Rerun guards and resolvers when the path params
|
2615 | * change or query params have changed. This does not include matrix parameters.
|
2616 | *
|
2617 | * @see {@link RunGuardsAndResolvers}
|
2618 | */
|
2619 | runGuardsAndResolvers?: RunGuardsAndResolvers;
|
2620 | /**
|
2621 | * A `Provider` array to use for this `Route` and its `children`.
|
2622 | *
|
2623 | * The `Router` will create a new `EnvironmentInjector` for this
|
2624 | * `Route` and use it for this `Route` and its `children`. If this
|
2625 | * route also has a `loadChildren` function which returns an `NgModuleRef`, this injector will be
|
2626 | * used as the parent of the lazy loaded module.
|
2627 | */
|
2628 | providers?: Array<Provider | EnvironmentProviders>;
|
2629 | }
|
2630 |
|
2631 | /**
|
2632 | * An event triggered when a route has been lazy loaded.
|
2633 | *
|
2634 | * @see {@link RouteConfigLoadStart}
|
2635 | *
|
2636 | * @publicApi
|
2637 | */
|
2638 | export declare class RouteConfigLoadEnd {
|
2639 | /** @docsNotRequired */
|
2640 | route: Route;
|
2641 | readonly type = EventType.RouteConfigLoadEnd;
|
2642 | constructor(
|
2643 | /** @docsNotRequired */
|
2644 | route: Route);
|
2645 | toString(): string;
|
2646 | }
|
2647 |
|
2648 | /**
|
2649 | * An event triggered before lazy loading a route configuration.
|
2650 | *
|
2651 | * @see {@link RouteConfigLoadEnd}
|
2652 | *
|
2653 | * @publicApi
|
2654 | */
|
2655 | export declare class RouteConfigLoadStart {
|
2656 | /** @docsNotRequired */
|
2657 | route: Route;
|
2658 | readonly type = EventType.RouteConfigLoadStart;
|
2659 | constructor(
|
2660 | /** @docsNotRequired */
|
2661 | route: Route);
|
2662 | toString(): string;
|
2663 | }
|
2664 |
|
2665 | /**
|
2666 | * Injectable used as a tree-shakable provider for opting in to binding router data to component
|
2667 | * inputs.
|
2668 | *
|
2669 | * The RouterOutlet registers itself with this service when an `ActivatedRoute` is attached or
|
2670 | * activated. When this happens, the service subscribes to the `ActivatedRoute` observables (params,
|
2671 | * queryParams, data) and sets the inputs of the component using `ComponentRef.setInput`.
|
2672 | * Importantly, when an input does not have an item in the route data with a matching key, this
|
2673 | * input is set to `undefined`. If it were not done this way, the previous information would be
|
2674 | * retained if the data got removed from the route (i.e. if a query parameter is removed).
|
2675 | *
|
2676 | * The `RouterOutlet` should unregister itself when destroyed via `unsubscribeFromRouteData` so that
|
2677 | * the subscriptions are cleaned up.
|
2678 | */
|
2679 | declare class RoutedComponentInputBinder {
|
2680 | private outletDataSubscriptions;
|
2681 | bindActivatedRouteToOutletComponent(outlet: RouterOutlet): void;
|
2682 | unsubscribeFromRouteData(outlet: RouterOutlet): void;
|
2683 | private subscribeToRouteData;
|
2684 | static ɵfac: i0.ɵɵFactoryDeclaration<RoutedComponentInputBinder, never>;
|
2685 | static ɵprov: i0.ɵɵInjectableDeclaration<RoutedComponentInputBinder>;
|
2686 | }
|
2687 |
|
2688 | /**
|
2689 | * @description
|
2690 | *
|
2691 | * A service that provides navigation among views and URL manipulation capabilities.
|
2692 | *
|
2693 | * @see {@link Route}
|
2694 | * @see [Routing and Navigation Guide](guide/router).
|
2695 | *
|
2696 | * @ngModule RouterModule
|
2697 | *
|
2698 | * @publicApi
|
2699 | */
|
2700 | export declare class Router {
|
2701 | private disposed;
|
2702 | private locationSubscription?;
|
2703 | private get navigationId();
|
2704 | /**
|
2705 | * The id of the currently active page in the router.
|
2706 | * Updated to the transition's target id on a successful navigation.
|
2707 | *
|
2708 | * This is used to track what page the router last activated. When an attempted navigation fails,
|
2709 | * the router can then use this to compute how to restore the state back to the previously active
|
2710 | * page.
|
2711 | */
|
2712 | private currentPageId;
|
2713 | /**
|
2714 | * The ɵrouterPageId of whatever page is currently active in the browser history. This is
|
2715 | * important for computing the target page id for new navigations because we need to ensure each
|
2716 | * page id in the browser history is 1 more than the previous entry.
|
2717 | */
|
2718 | private get browserPageId();
|
2719 | private console;
|
2720 | private isNgZoneEnabled;
|
2721 | /**
|
2722 | * The private `Subject` type for the public events exposed in the getter. This is used internally
|
2723 | * to push events to. The separate field allows us to expose separate types in the public API
|
2724 | * (i.e., an Observable rather than the Subject).
|
2725 | */
|
2726 | private _events;
|
2727 | /**
|
2728 | * An event stream for routing events.
|
2729 | */
|
2730 | get events(): Observable<Event_2>;
|
2731 | /**
|
2732 | * The current state of routing in this NgModule.
|
2733 | */
|
2734 | readonly routerState: RouterState;
|
2735 | private options;
|
2736 | private pendingTasks;
|
2737 | /**
|
2738 | * A handler for navigation errors in this NgModule.
|
2739 | *
|
2740 | * @deprecated Subscribe to the `Router` events and watch for `NavigationError` instead.
|
2741 | * `provideRouter` has the `withNavigationErrorHandler` feature to make this easier.
|
2742 | * @see {@link withNavigationErrorHandler}
|
2743 | */
|
2744 | errorHandler: (error: any) => any;
|
2745 | /**
|
2746 | * A handler for errors thrown by `Router.parseUrl(url)`
|
2747 | * when `url` contains an invalid character.
|
2748 | * The most common case is a `%` sign
|
2749 | * that's not encoded and is not part of a percent encoded sequence.
|
2750 | *
|
2751 | * @deprecated URI parsing errors should be handled in the `UrlSerializer`.
|
2752 | *
|
2753 | * @see {@link RouterModule}
|
2754 | */
|
2755 | malformedUriErrorHandler: (error: URIError, urlSerializer: UrlSerializer, url: string) => UrlTree;
|
2756 | /**
|
2757 | * True if at least one navigation event has occurred,
|
2758 | * false otherwise.
|
2759 | */
|
2760 | navigated: boolean;
|
2761 | private lastSuccessfulId;
|
2762 | /**
|
2763 | * A strategy for extracting and merging URLs.
|
2764 | * Used for AngularJS to Angular migrations.
|
2765 | *
|
2766 | * @deprecated Configure using `providers` instead:
|
2767 | * `{provide: UrlHandlingStrategy, useClass: MyStrategy}`.
|
2768 | */
|
2769 | urlHandlingStrategy: UrlHandlingStrategy;
|
2770 | /**
|
2771 | * A strategy for re-using routes.
|
2772 | *
|
2773 | * @deprecated Configure using `providers` instead:
|
2774 | * `{provide: RouteReuseStrategy, useClass: MyStrategy}`.
|
2775 | */
|
2776 | routeReuseStrategy: RouteReuseStrategy;
|
2777 | /**
|
2778 | * A strategy for setting the title based on the `routerState`.
|
2779 | *
|
2780 | * @deprecated Configure using `providers` instead:
|
2781 | * `{provide: TitleStrategy, useClass: MyStrategy}`.
|
2782 | */
|
2783 | titleStrategy?: TitleStrategy;
|
2784 | /**
|
2785 | * How to handle a navigation request to the current URL.
|
2786 | *
|
2787 | *
|
2788 | * @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
2789 | * @see {@link withRouterConfig}
|
2790 | * @see {@link provideRouter}
|
2791 | * @see {@link RouterModule}
|
2792 | */
|
2793 | onSameUrlNavigation: OnSameUrlNavigation;
|
2794 | /**
|
2795 | * How to merge parameters, data, resolved data, and title from parent to child
|
2796 | * routes. One of:
|
2797 | *
|
2798 | * - `'emptyOnly'` : Inherit parent parameters, data, and resolved data
|
2799 | * for path-less or component-less routes.
|
2800 | * - `'always'` : Inherit parent parameters, data, and resolved data
|
2801 | * for all child routes.
|
2802 | *
|
2803 | * @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
2804 | * @see {@link withRouterConfig}
|
2805 | * @see {@link provideRouter}
|
2806 | * @see {@link RouterModule}
|
2807 | */
|
2808 | paramsInheritanceStrategy: 'emptyOnly' | 'always';
|
2809 | /**
|
2810 | * Determines when the router updates the browser URL.
|
2811 | * By default (`"deferred"`), updates the browser URL after navigation has finished.
|
2812 | * Set to `'eager'` to update the browser URL at the beginning of navigation.
|
2813 | * You can choose to update early so that, if navigation fails,
|
2814 | * you can show an error message with the URL that failed.
|
2815 | *
|
2816 | * @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
2817 | * @see {@link withRouterConfig}
|
2818 | * @see {@link provideRouter}
|
2819 | * @see {@link RouterModule}
|
2820 | */
|
2821 | urlUpdateStrategy: 'deferred' | 'eager';
|
2822 | /**
|
2823 | * Configures how the Router attempts to restore state when a navigation is cancelled.
|
2824 | *
|
2825 | * 'replace' - Always uses `location.replaceState` to set the browser state to the state of the
|
2826 | * router before the navigation started. This means that if the URL of the browser is updated
|
2827 | * _before_ the navigation is canceled, the Router will simply replace the item in history rather
|
2828 | * than trying to restore to the previous location in the session history. This happens most
|
2829 | * frequently with `urlUpdateStrategy: 'eager'` and navigations with the browser back/forward
|
2830 | * buttons.
|
2831 | *
|
2832 | * 'computed' - Will attempt to return to the same index in the session history that corresponds
|
2833 | * to the Angular route when the navigation gets cancelled. For example, if the browser back
|
2834 | * button is clicked and the navigation is cancelled, the Router will trigger a forward navigation
|
2835 | * and vice versa.
|
2836 | *
|
2837 | * Note: the 'computed' option is incompatible with any `UrlHandlingStrategy` which only
|
2838 | * handles a portion of the URL because the history restoration navigates to the previous place in
|
2839 | * the browser history rather than simply resetting a portion of the URL.
|
2840 | *
|
2841 | * The default value is `replace`.
|
2842 | *
|
2843 | * @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
2844 | * @see {@link withRouterConfig}
|
2845 | * @see {@link provideRouter}
|
2846 | * @see {@link RouterModule}
|
2847 | */
|
2848 | canceledNavigationResolution: 'replace' | 'computed';
|
2849 | config: Routes;
|
2850 | private readonly navigationTransitions;
|
2851 | private readonly urlSerializer;
|
2852 | private readonly location;
|
2853 | /**
|
2854 | * Indicates whether the application has opted in to binding Router data to component inputs.
|
2855 | *
|
2856 | * This option is enabled by the `withComponentInputBinding` feature of `provideRouter` or
|
2857 | * `bindToComponentInputs` in the `ExtraOptions` of `RouterModule.forRoot`.
|
2858 | */
|
2859 | readonly componentInputBindingEnabled: boolean;
|
2860 | constructor();
|
2861 | private eventsSubscription;
|
2862 | private subscribeToNavigationEvents;
|
2863 | /**
|
2864 | * Sets up the location change listener and performs the initial navigation.
|
2865 | */
|
2866 | initialNavigation(): void;
|
2867 | /**
|
2868 | * Sets up the location change listener. This listener detects navigations triggered from outside
|
2869 | * the Router (the browser back/forward buttons, for example) and schedules a corresponding Router
|
2870 | * navigation so that the correct events, guards, etc. are triggered.
|
2871 | */
|
2872 | setUpLocationChangeListener(): void;
|
2873 | /**
|
2874 | * Schedules a router navigation to synchronize Router state with the browser state.
|
2875 | *
|
2876 | * This is done as a response to a popstate event and the initial navigation. These
|
2877 | * two scenarios represent times when the browser URL/state has been updated and
|
2878 | * the Router needs to respond to ensure its internal state matches.
|
2879 | */
|
2880 | private navigateToSyncWithBrowser;
|
2881 | /** The current URL. */
|
2882 | get url(): string;
|
2883 | /**
|
2884 | * Returns the current `Navigation` object when the router is navigating,
|
2885 | * and `null` when idle.
|
2886 | */
|
2887 | getCurrentNavigation(): Navigation | null;
|
2888 | /**
|
2889 | * The `Navigation` object of the most recent navigation to succeed and `null` if there
|
2890 | * has not been a successful navigation yet.
|
2891 | */
|
2892 | get lastSuccessfulNavigation(): Navigation | null;
|
2893 | /**
|
2894 | * Resets the route configuration used for navigation and generating links.
|
2895 | *
|
2896 | * @param config The route array for the new configuration.
|
2897 | *
|
2898 | * @usageNotes
|
2899 | *
|
2900 | * ```
|
2901 | * router.resetConfig([
|
2902 | * { path: 'team/:id', component: TeamCmp, children: [
|
2903 | * { path: 'simple', component: SimpleCmp },
|
2904 | * { path: 'user/:name', component: UserCmp }
|
2905 | * ]}
|
2906 | * ]);
|
2907 | * ```
|
2908 | */
|
2909 | resetConfig(config: Routes): void;
|
2910 | /** @nodoc */
|
2911 | ngOnDestroy(): void;
|
2912 | /** Disposes of the router. */
|
2913 | dispose(): void;
|
2914 | /**
|
2915 | * Appends URL segments to the current URL tree to create a new URL tree.
|
2916 | *
|
2917 | * @param commands An array of URL fragments with which to construct the new URL tree.
|
2918 | * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path
|
2919 | * segments, followed by the parameters for each segment.
|
2920 | * The fragments are applied to the current URL tree or the one provided in the `relativeTo`
|
2921 | * property of the options object, if supplied.
|
2922 | * @param navigationExtras Options that control the navigation strategy.
|
2923 | * @returns The new URL tree.
|
2924 | *
|
2925 | * @usageNotes
|
2926 | *
|
2927 | * ```
|
2928 | *
|
2929 | * router.createUrlTree(['/team', 33, 'user', 11]);
|
2930 | *
|
2931 | *
|
2932 | * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);
|
2933 | *
|
2934 | *
|
2935 | * router.createUrlTree(['/team/33/user', userId]);
|
2936 | *
|
2937 | *
|
2938 | *
|
2939 | * router.createUrlTree([{segmentPath: '/one/two'}]);
|
2940 | *
|
2941 | *
|
2942 | * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);
|
2943 | *
|
2944 | *
|
2945 | * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);
|
2946 | *
|
2947 | *
|
2948 | *
|
2949 | *
|
2950 | * router.createUrlTree(['details'], {relativeTo: route});
|
2951 | *
|
2952 | *
|
2953 | * router.createUrlTree(['../22'], {relativeTo: route});
|
2954 | *
|
2955 | *
|
2956 | * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});
|
2957 | *
|
2958 | * Note that a value of `null` or `undefined` for `relativeTo` indicates that the
|
2959 | * tree should be created relative to the root.
|
2960 | * ```
|
2961 | */
|
2962 | createUrlTree(commands: any[], navigationExtras?: UrlCreationOptions): UrlTree;
|
2963 | /**
|
2964 | * Navigates to a view using an absolute route path.
|
2965 | *
|
2966 | * @param url An absolute path for a defined route. The function does not apply any delta to the
|
2967 | * current URL.
|
2968 | * @param extras An object containing properties that modify the navigation strategy.
|
2969 | *
|
2970 | * @returns A Promise that resolves to 'true' when navigation succeeds,
|
2971 | * to 'false' when navigation fails, or is rejected on error.
|
2972 | *
|
2973 | * @usageNotes
|
2974 | *
|
2975 | * The following calls request navigation to an absolute path.
|
2976 | *
|
2977 | * ```
|
2978 | * router.navigateByUrl("/team/33/user/11");
|
2979 | *
|
2980 | *
|
2981 | * router.navigateByUrl("/team/33/user/11", { skipLocationChange: true });
|
2982 | * ```
|
2983 | *
|
2984 | * @see [Routing and Navigation guide](guide/router)
|
2985 | *
|
2986 | */
|
2987 | navigateByUrl(url: string | UrlTree, extras?: NavigationBehaviorOptions): Promise<boolean>;
|
2988 | /**
|
2989 | * Navigate based on the provided array of commands and a starting point.
|
2990 | * If no starting route is provided, the navigation is absolute.
|
2991 | *
|
2992 | * @param commands An array of URL fragments with which to construct the target URL.
|
2993 | * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path
|
2994 | * segments, followed by the parameters for each segment.
|
2995 | * The fragments are applied to the current URL or the one provided in the `relativeTo` property
|
2996 | * of the options object, if supplied.
|
2997 | * @param extras An options object that determines how the URL should be constructed or
|
2998 | * interpreted.
|
2999 | *
|
3000 | * @returns A Promise that resolves to `true` when navigation succeeds, to `false` when navigation
|
3001 | * fails,
|
3002 | * or is rejected on error.
|
3003 | *
|
3004 | * @usageNotes
|
3005 | *
|
3006 | * The following calls request navigation to a dynamic route path relative to the current URL.
|
3007 | *
|
3008 | * ```
|
3009 | * router.navigate(['team', 33, 'user', 11], {relativeTo: route});
|
3010 | *
|
3011 | *
|
3012 | * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});
|
3013 | * ```
|
3014 | *
|
3015 | * @see [Routing and Navigation guide](guide/router)
|
3016 | *
|
3017 | */
|
3018 | navigate(commands: any[], extras?: NavigationExtras): Promise<boolean>;
|
3019 | /** Serializes a `UrlTree` into a string */
|
3020 | serializeUrl(url: UrlTree): string;
|
3021 | /** Parses a string into a `UrlTree` */
|
3022 | parseUrl(url: string): UrlTree;
|
3023 | /**
|
3024 | * Returns whether the url is activated.
|
3025 | *
|
3026 | * @deprecated
|
3027 | * Use `IsActiveMatchOptions` instead.
|
3028 | *
|
3029 | * - The equivalent `IsActiveMatchOptions` for `true` is
|
3030 | * `{paths: 'exact', queryParams: 'exact', fragment: 'ignored', matrixParams: 'ignored'}`.
|
3031 | * - The equivalent for `false` is
|
3032 | * `{paths: 'subset', queryParams: 'subset', fragment: 'ignored', matrixParams: 'ignored'}`.
|
3033 | */
|
3034 | isActive(url: string | UrlTree, exact: boolean): boolean;
|
3035 | /**
|
3036 | * Returns whether the url is activated.
|
3037 | */
|
3038 | isActive(url: string | UrlTree, matchOptions: IsActiveMatchOptions): boolean;
|
3039 | private removeEmptyProps;
|
3040 | private resetState;
|
3041 | private resetUrlToCurrentUrlTree;
|
3042 | private generateNgRouterState;
|
3043 | static ɵfac: i0.ɵɵFactoryDeclaration<Router, never>;
|
3044 | static ɵprov: i0.ɵɵInjectableDeclaration<Router>;
|
3045 | }
|
3046 |
|
3047 | /**
|
3048 | * A [DI token](guide/glossary/#di-token) for the router service.
|
3049 | *
|
3050 | * @publicApi
|
3051 | */
|
3052 | export declare const ROUTER_CONFIGURATION: InjectionToken<ExtraOptions>;
|
3053 |
|
3054 | /**
|
3055 | * A [DI token](guide/glossary/#di-token) for the router initializer that
|
3056 | * is called after the app is bootstrapped.
|
3057 | *
|
3058 | * @publicApi
|
3059 | */
|
3060 | export declare const ROUTER_INITIALIZER: InjectionToken<(compRef: ComponentRef<any>) => void>;
|
3061 |
|
3062 | declare class RouterConfigLoader {
|
3063 | private componentLoaders;
|
3064 | private childrenLoaders;
|
3065 | onLoadStartListener?: (r: Route) => void;
|
3066 | onLoadEndListener?: (r: Route) => void;
|
3067 | private readonly compiler;
|
3068 | loadComponent(route: Route): Observable<Type<unknown>>;
|
3069 | loadChildren(parentInjector: Injector, route: Route): Observable<LoadedRouterConfig>;
|
3070 | static ɵfac: i0.ɵɵFactoryDeclaration<RouterConfigLoader, never>;
|
3071 | static ɵprov: i0.ɵɵInjectableDeclaration<RouterConfigLoader>;
|
3072 | }
|
3073 |
|
3074 | /**
|
3075 | * Extra configuration options that can be used with the `withRouterConfig` function.
|
3076 | *
|
3077 | * @publicApi
|
3078 | */
|
3079 | export declare interface RouterConfigOptions {
|
3080 | /**
|
3081 | * Configures how the Router attempts to restore state when a navigation is cancelled.
|
3082 | *
|
3083 | * 'replace' - Always uses `location.replaceState` to set the browser state to the state of the
|
3084 | * router before the navigation started. This means that if the URL of the browser is updated
|
3085 | * _before_ the navigation is canceled, the Router will simply replace the item in history rather
|
3086 | * than trying to restore to the previous location in the session history. This happens most
|
3087 | * frequently with `urlUpdateStrategy: 'eager'` and navigations with the browser back/forward
|
3088 | * buttons.
|
3089 | *
|
3090 | * 'computed' - Will attempt to return to the same index in the session history that corresponds
|
3091 | * to the Angular route when the navigation gets cancelled. For example, if the browser back
|
3092 | * button is clicked and the navigation is cancelled, the Router will trigger a forward navigation
|
3093 | * and vice versa.
|
3094 | *
|
3095 | * Note: the 'computed' option is incompatible with any `UrlHandlingStrategy` which only
|
3096 | * handles a portion of the URL because the history restoration navigates to the previous place in
|
3097 | * the browser history rather than simply resetting a portion of the URL.
|
3098 | *
|
3099 | * The default value is `replace` when not set.
|
3100 | */
|
3101 | canceledNavigationResolution?: 'replace' | 'computed';
|
3102 | /**
|
3103 | * Configures the default for handling a navigation request to the current URL.
|
3104 | *
|
3105 | * If unset, the `Router` will use `'ignore'`.
|
3106 | *
|
3107 | * @see {@link OnSameUrlNavigation}
|
3108 | */
|
3109 | onSameUrlNavigation?: OnSameUrlNavigation;
|
3110 | /**
|
3111 | * Defines how the router merges parameters, data, and resolved data from parent to child
|
3112 | * routes. By default ('emptyOnly'), inherits parent parameters only for
|
3113 | * path-less or component-less routes.
|
3114 | *
|
3115 | * Set to 'always' to enable unconditional inheritance of parent parameters.
|
3116 | *
|
3117 | * Note that when dealing with matrix parameters, "parent" refers to the parent `Route`
|
3118 | * config which does not necessarily mean the "URL segment to the left". When the `Route` `path`
|
3119 | * contains multiple segments, the matrix parameters must appear on the last segment. For example,
|
3120 | * matrix parameters for `{path: 'a/b', component: MyComp}` should appear as `a/b;foo=bar` and not
|
3121 | * `a;foo=bar/b`.
|
3122 | *
|
3123 | */
|
3124 | paramsInheritanceStrategy?: 'emptyOnly' | 'always';
|
3125 | /**
|
3126 | * Defines when the router updates the browser URL. By default ('deferred'),
|
3127 | * update after successful navigation.
|
3128 | * Set to 'eager' if prefer to update the URL at the beginning of navigation.
|
3129 | * Updating the URL early allows you to handle a failure of navigation by
|
3130 | * showing an error message with the URL that failed.
|
3131 | */
|
3132 | urlUpdateStrategy?: 'deferred' | 'eager';
|
3133 | }
|
3134 |
|
3135 | /**
|
3136 | * A type alias for providers returned by `withRouterConfig` for use with `provideRouter`.
|
3137 | *
|
3138 | * @see {@link withRouterConfig}
|
3139 | * @see {@link provideRouter}
|
3140 | *
|
3141 | * @publicApi
|
3142 | */
|
3143 | export declare type RouterConfigurationFeature = RouterFeature<RouterFeatureKind.RouterConfigurationFeature>;
|
3144 |
|
3145 | /**
|
3146 | * @description
|
3147 | *
|
3148 | * Provides a way to customize when activated routes get reused.
|
3149 | *
|
3150 | * @publicApi
|
3151 | */
|
3152 | export declare abstract class RouteReuseStrategy {
|
3153 | /** Determines if this route (and its subtree) should be detached to be reused later */
|
3154 | abstract shouldDetach(route: ActivatedRouteSnapshot): boolean;
|
3155 | /**
|
3156 | * Stores the detached route.
|
3157 | *
|
3158 | * Storing a `null` value should erase the previously stored value.
|
3159 | */
|
3160 | abstract store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle | null): void;
|
3161 | /** Determines if this route (and its subtree) should be reattached */
|
3162 | abstract shouldAttach(route: ActivatedRouteSnapshot): boolean;
|
3163 | /** Retrieves the previously stored route */
|
3164 | abstract retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null;
|
3165 | /** Determines if a route should be reused */
|
3166 | abstract shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;
|
3167 | static ɵfac: i0.ɵɵFactoryDeclaration<RouteReuseStrategy, never>;
|
3168 | static ɵprov: i0.ɵɵInjectableDeclaration<RouteReuseStrategy>;
|
3169 | }
|
3170 |
|
3171 | /**
|
3172 | * Base for events the router goes through, as opposed to events tied to a specific
|
3173 | * route. Fired one time for any given navigation.
|
3174 | *
|
3175 | * The following code shows how a class subscribes to router events.
|
3176 | *
|
3177 | * ```ts
|
3178 | * import {Event, RouterEvent, Router} from '@angular/router';
|
3179 | *
|
3180 | * class MyService {
|
3181 | * constructor(public router: Router) {
|
3182 | * router.events.pipe(
|
3183 | * filter((e: Event | RouterEvent): e is RouterEvent => e instanceof RouterEvent)
|
3184 | * ).subscribe((e: RouterEvent) => {
|
3185 | *
|
3186 | * });
|
3187 | * }
|
3188 | * }
|
3189 | * ```
|
3190 | *
|
3191 | * @see {@link Event}
|
3192 | * @see [Router events summary](guide/router-reference#router-events)
|
3193 | * @publicApi
|
3194 | */
|
3195 | export declare class RouterEvent {
|
3196 | /** A unique ID that the router assigns to every router navigation. */
|
3197 | id: number;
|
3198 | /** The URL that is the destination for this navigation. */
|
3199 | url: string;
|
3200 | constructor(
|
3201 | /** A unique ID that the router assigns to every router navigation. */
|
3202 | id: number,
|
3203 | /** The URL that is the destination for this navigation. */
|
3204 | url: string);
|
3205 | }
|
3206 |
|
3207 | /**
|
3208 | * Helper type to represent a Router feature.
|
3209 | *
|
3210 | * @publicApi
|
3211 | */
|
3212 | export declare interface RouterFeature<FeatureKind extends RouterFeatureKind> {
|
3213 | ɵkind: FeatureKind;
|
3214 | ɵproviders: Provider[];
|
3215 | }
|
3216 |
|
3217 | /**
|
3218 | * The list of features as an enum to uniquely type each feature.
|
3219 | */
|
3220 | declare const enum RouterFeatureKind {
|
3221 | PreloadingFeature = 0,
|
3222 | DebugTracingFeature = 1,
|
3223 | EnabledBlockingInitialNavigationFeature = 2,
|
3224 | DisabledInitialNavigationFeature = 3,
|
3225 | InMemoryScrollingFeature = 4,
|
3226 | RouterConfigurationFeature = 5,
|
3227 | RouterHashLocationFeature = 6,
|
3228 | NavigationErrorHandlerFeature = 7,
|
3229 | ComponentInputBindingFeature = 8
|
3230 | }
|
3231 |
|
3232 | /**
|