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 { ComponentFactoryResolver } from '@angular/core';
|
12 | import { ComponentRef } from '@angular/core';
|
13 | import { ElementRef } from '@angular/core';
|
14 | import { EnvironmentInjector } from '@angular/core';
|
15 | import { EnvironmentProviders } from '@angular/core';
|
16 | import { EventEmitter } from '@angular/core';
|
17 | import * as i0 from '@angular/core';
|
18 | import { InjectionToken } from '@angular/core';
|
19 | import { Injector } from '@angular/core';
|
20 | import { LocationStrategy } from '@angular/common';
|
21 | import { ModuleWithProviders } from '@angular/core';
|
22 | import { NgModuleFactory } from '@angular/core';
|
23 | import { Observable } from 'rxjs';
|
24 | import { OnChanges } from '@angular/core';
|
25 | import { OnDestroy } from '@angular/core';
|
26 | import { OnInit } from '@angular/core';
|
27 | import { Provider } from '@angular/core';
|
28 | import { ProviderToken } from '@angular/core';
|
29 | import { QueryList } from '@angular/core';
|
30 | import { Renderer2 } from '@angular/core';
|
31 | import { SimpleChanges } from '@angular/core';
|
32 | import { Title } from '@angular/platform-browser';
|
33 | import { Type } from '@angular/core';
|
34 | import { Version } from '@angular/core';
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | export declare class ActivatedRoute {
|
56 |
|
57 | url: Observable<UrlSegment[]>;
|
58 |
|
59 | params: Observable<Params>;
|
60 |
|
61 | queryParams: Observable<Params>;
|
62 |
|
63 | fragment: Observable<string | null>;
|
64 |
|
65 | data: Observable<Data>;
|
66 |
|
67 | outlet: string;
|
68 |
|
69 | component: Type<any> | null;
|
70 |
|
71 | snapshot: ActivatedRouteSnapshot;
|
72 |
|
73 | readonly title: Observable<string | undefined>;
|
74 |
|
75 | get routeConfig(): Route | null;
|
76 |
|
77 | get root(): ActivatedRoute;
|
78 |
|
79 | get parent(): ActivatedRoute | null;
|
80 |
|
81 | get firstChild(): ActivatedRoute | null;
|
82 |
|
83 | get children(): ActivatedRoute[];
|
84 |
|
85 | get pathFromRoot(): ActivatedRoute[];
|
86 | |
87 |
|
88 |
|
89 |
|
90 |
|
91 | get paramMap(): Observable<ParamMap>;
|
92 | |
93 |
|
94 |
|
95 |
|
96 | get queryParamMap(): Observable<ParamMap>;
|
97 | toString(): string;
|
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 |
|
123 | export declare class ActivatedRouteSnapshot {
|
124 |
|
125 | url: UrlSegment[];
|
126 | |
127 |
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 | params: Params;
|
146 |
|
147 | queryParams: Params;
|
148 |
|
149 | fragment: string | null;
|
150 |
|
151 | data: Data;
|
152 |
|
153 | outlet: string;
|
154 |
|
155 | component: Type<any> | null;
|
156 |
|
157 | readonly routeConfig: Route | null;
|
158 |
|
159 | get title(): string | undefined;
|
160 |
|
161 | get root(): ActivatedRouteSnapshot;
|
162 |
|
163 | get parent(): ActivatedRouteSnapshot | null;
|
164 |
|
165 | get firstChild(): ActivatedRouteSnapshot | null;
|
166 |
|
167 | get children(): ActivatedRouteSnapshot[];
|
168 |
|
169 | get pathFromRoot(): ActivatedRouteSnapshot[];
|
170 | get paramMap(): ParamMap;
|
171 | get queryParamMap(): ParamMap;
|
172 | toString(): string;
|
173 | }
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 |
|
183 | export declare class ActivationEnd {
|
184 |
|
185 | snapshot: ActivatedRouteSnapshot;
|
186 | readonly type = EventType.ActivationEnd;
|
187 | constructor(
|
188 |
|
189 | snapshot: ActivatedRouteSnapshot);
|
190 | toString(): string;
|
191 | }
|
192 |
|
193 | /**
|
194 | * An event triggered at the start of the activation part
|
195 | * of the Resolve phase of routing.
|
196 | * @see `ActivationEnd`
|
197 | * @see `ResolveStart`
|
198 | *
|
199 | * @publicApi
|
200 | */
|
201 | export declare class ActivationStart {
|
202 |
|
203 | snapshot: ActivatedRouteSnapshot;
|
204 | readonly type = EventType.ActivationStart;
|
205 | constructor(
|
206 |
|
207 | snapshot: ActivatedRouteSnapshot);
|
208 | toString(): string;
|
209 | }
|
210 |
|
211 | /**
|
212 | * @description
|
213 | *
|
214 | * This base route reuse strategy only reuses routes when the matched router configs are
|
215 | * identical. This prevents components from being destroyed and recreated
|
216 | * when just the route parameters, query parameters or fragment change
|
217 | * (that is, the existing component is _reused_).
|
218 | *
|
219 | * This strategy does not store any routes for later reuse.
|
220 | *
|
221 | * Angular uses this strategy by default.
|
222 | *
|
223 | *
|
224 | * It can be used as a base class for custom route reuse strategies, i.e. you can create your own
|
225 | * class that extends the `BaseRouteReuseStrategy` one.
|
226 | * @publicApi
|
227 | */
|
228 | export declare abstract class BaseRouteReuseStrategy implements RouteReuseStrategy {
|
229 | |
230 |
|
231 |
|
232 |
|
233 | shouldDetach(route: ActivatedRouteSnapshot): boolean;
|
234 | |
235 |
|
236 |
|
237 | store(route: ActivatedRouteSnapshot, detachedTree: DetachedRouteHandle): void;
|
238 |
|
239 | shouldAttach(route: ActivatedRouteSnapshot): boolean;
|
240 |
|
241 | retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null;
|
242 | |
243 |
|
244 |
|
245 |
|
246 |
|
247 | shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;
|
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 |
|
307 | export declare interface CanActivate {
|
308 | canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
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 |
|
373 | export declare interface CanActivateChild {
|
374 | canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
375 | }
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 | export declare type CanActivateChildFn = (childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
393 |
|
394 |
|
395 |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 |
|
412 |
|
413 |
|
414 | export declare type CanActivateFn = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
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 |
|
476 | export declare interface CanDeactivate<T> {
|
477 | canDeactivate(component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
478 | }
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 | export declare type CanDeactivateFn<T> = (component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState: RouterStateSnapshot) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
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 |
|
551 | export declare interface CanLoad {
|
552 | canLoad(route: Route, segments: UrlSegment[]): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
553 | }
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 | export declare type CanLoadFn = (route: Route, segments: UrlSegment[]) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
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 |
|
631 | export declare interface CanMatch {
|
632 | canMatch(route: Route, segments: UrlSegment[]): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
633 | }
|
634 |
|
635 |
|
636 |
|
637 |
|
638 |
|
639 |
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 |
|
647 |
|
648 |
|
649 |
|
650 | export declare type CanMatchFn = (route: Route, segments: UrlSegment[]) => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
|
651 |
|
652 |
|
653 |
|
654 |
|
655 |
|
656 |
|
657 |
|
658 |
|
659 | export declare class ChildActivationEnd {
|
660 |
|
661 | snapshot: ActivatedRouteSnapshot;
|
662 | readonly type = EventType.ChildActivationEnd;
|
663 | constructor(
|
664 |
|
665 | snapshot: ActivatedRouteSnapshot);
|
666 | toString(): string;
|
667 | }
|
668 |
|
669 | /**
|
670 | * An event triggered at the start of the child-activation
|
671 | * part of the Resolve phase of routing.
|
672 | * @see `ChildActivationEnd`
|
673 | * @see `ResolveStart`
|
674 | *
|
675 | * @publicApi
|
676 | */
|
677 | export declare class ChildActivationStart {
|
678 |
|
679 | snapshot: ActivatedRouteSnapshot;
|
680 | readonly type = EventType.ChildActivationStart;
|
681 | constructor(
|
682 |
|
683 | snapshot: ActivatedRouteSnapshot);
|
684 | toString(): string;
|
685 | }
|
686 |
|
687 | /**
|
688 | * Store contextual information about the children (= nested) `RouterOutlet`
|
689 | *
|
690 | * @publicApi
|
691 | */
|
692 | export declare class ChildrenOutletContexts {
|
693 | private contexts;
|
694 |
|
695 | onChildOutletCreated(childName: string, outlet: RouterOutletContract): void;
|
696 | |
697 |
|
698 |
|
699 |
|
700 |
|
701 | onChildOutletDestroyed(childName: string): void;
|
702 | |
703 |
|
704 |
|
705 |
|
706 | onOutletDeactivated(): Map<string, OutletContext>;
|
707 | onOutletReAttached(contexts: Map<string, OutletContext>): void;
|
708 | getOrCreateContext(childName: string): OutletContext;
|
709 | getContext(childName: string): OutletContext | null;
|
710 | static ɵfac: i0.ɵɵFactoryDeclaration<ChildrenOutletContexts, never>;
|
711 | static ɵprov: i0.ɵɵInjectableDeclaration<ChildrenOutletContexts>;
|
712 | }
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 |
|
721 | export declare function convertToParamMap(params: Params): ParamMap;
|
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
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 | export declare function createUrlTreeFromSnapshot(relativeTo: ActivatedRouteSnapshot, commands: any[], queryParams?: Params | null, fragment?: string | null): UrlTree;
|
775 |
|
776 |
|
777 |
|
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 |
|
784 | export declare type Data = {
|
785 | [key: string | symbol]: any;
|
786 | };
|
787 |
|
788 |
|
789 |
|
790 |
|
791 |
|
792 |
|
793 |
|
794 |
|
795 |
|
796 | export declare type DebugTracingFeature = RouterFeature<RouterFeatureKind.DebugTracingFeature>;
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 |
|
806 | export declare interface DefaultExport<T> {
|
807 | |
808 |
|
809 |
|
810 |
|
811 | default: T;
|
812 | }
|
813 |
|
814 |
|
815 |
|
816 |
|
817 | export declare class DefaultTitleStrategy extends TitleStrategy {
|
818 | readonly title: Title;
|
819 | constructor(title: Title);
|
820 | /**
|
821 | * Sets the title of the browser to the given value.
|
822 | *
|
823 | * @param title The `pageTitle` from the deepest primary route.
|
824 | */
|
825 | updateTitle(snapshot: RouterStateSnapshot): void;
|
826 | static ɵfac: i0.ɵɵFactoryDeclaration<DefaultTitleStrategy, never>;
|
827 | static ɵprov: i0.ɵɵInjectableDeclaration<DefaultTitleStrategy>;
|
828 | }
|
829 |
|
830 | /**
|
831 | * Matches the route configuration (`route`) against the actual URL (`segments`).
|
832 | *
|
833 | * When no matcher is defined on a `Route`, this is the matcher used by the Router by default.
|
834 | *
|
835 | * @param segments The remaining unmatched segments in the current navigation
|
836 | * @param segmentGroup The current segment group being matched
|
837 | * @param route The `Route` to match against.
|
838 | *
|
839 | * @see UrlMatchResult
|
840 | * @see Route
|
841 | *
|
842 | * @returns The resulting match information or `null` if the `route` should not match.
|
843 | * @publicApi
|
844 | */
|
845 | export declare function defaultUrlMatcher(segments: UrlSegment[], segmentGroup: UrlSegmentGroup, route: Route): UrlMatchResult | null;
|
846 |
|
847 | /**
|
848 | * @description
|
849 | *
|
850 | * A default implementation of the `UrlSerializer`.
|
851 | *
|
852 | * Example URLs:
|
853 | *
|
854 | * ```
|
855 | * /inbox/33(popup:compose)
|
856 | * /inbox/33;open=true/messages/44
|
857 | * ```
|
858 | *
|
859 | * DefaultUrlSerializer uses parentheses to serialize secondary segments (e.g., popup:compose), the
|
860 | * colon syntax to specify the outlet, and the ';parameter=value' syntax (e.g., open=true) to
|
861 | * specify route specific parameters.
|
862 | *
|
863 | * @publicApi
|
864 | */
|
865 | export declare class DefaultUrlSerializer implements UrlSerializer {
|
866 |
|
867 | parse(url: string): UrlTree;
|
868 |
|
869 | serialize(tree: UrlTree): string;
|
870 | }
|
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 |
|
878 |
|
879 |
|
880 |
|
881 |
|
882 |
|
883 |
|
884 |
|
885 |
|
886 |
|
887 |
|
888 | export declare type DeprecatedGuard = ProviderToken<any> | any;
|
889 |
|
890 |
|
891 |
|
892 |
|
893 |
|
894 |
|
895 |
|
896 |
|
897 |
|
898 |
|
899 |
|
900 | export declare type DetachedRouteHandle = {};
|
901 |
|
902 |
|
903 |
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 |
|
911 | export declare type DisabledInitialNavigationFeature = RouterFeature<RouterFeatureKind.DisabledInitialNavigationFeature>;
|
912 |
|
913 |
|
914 |
|
915 |
|
916 |
|
917 |
|
918 |
|
919 |
|
920 |
|
921 |
|
922 | export declare type EnabledBlockingInitialNavigationFeature = RouterFeature<RouterFeatureKind.EnabledBlockingInitialNavigationFeature>;
|
923 |
|
924 |
|
925 |
|
926 |
|
927 |
|
928 |
|
929 |
|
930 |
|
931 |
|
932 |
|
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 | declare type Event_2 = RouterEvent | NavigationStart | NavigationEnd | NavigationCancel | NavigationError | RoutesRecognized | GuardsCheckStart | GuardsCheckEnd | RouteConfigLoadStart | RouteConfigLoadEnd | ChildActivationStart | ChildActivationEnd | ActivationStart | ActivationEnd | Scroll | ResolveStart | ResolveEnd | NavigationSkipped;
|
958 | export { Event_2 as Event }
|
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 | export declare const enum EventType {
|
966 | NavigationStart = 0,
|
967 | NavigationEnd = 1,
|
968 | NavigationCancel = 2,
|
969 | NavigationError = 3,
|
970 | RoutesRecognized = 4,
|
971 | ResolveStart = 5,
|
972 | ResolveEnd = 6,
|
973 | GuardsCheckStart = 7,
|
974 | GuardsCheckEnd = 8,
|
975 | RouteConfigLoadStart = 9,
|
976 | RouteConfigLoadEnd = 10,
|
977 | ChildActivationStart = 11,
|
978 | ChildActivationEnd = 12,
|
979 | ActivationStart = 13,
|
980 | ActivationEnd = 14,
|
981 | Scroll = 15,
|
982 | NavigationSkipped = 16
|
983 | }
|
984 |
|
985 |
|
986 |
|
987 |
|
988 |
|
989 |
|
990 |
|
991 |
|
992 |
|
993 |
|
994 | export declare interface ExtraOptions extends InMemoryScrollingOptions, RouterConfigOptions {
|
995 | |
996 |
|
997 |
|
998 |
|
999 | enableTracing?: boolean;
|
1000 | |
1001 |
|
1002 |
|
1003 |
|
1004 | useHash?: boolean;
|
1005 | |
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 | initialNavigation?: InitialNavigation;
|
1017 | |
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 | errorHandler?: (error: any) => any;
|
1025 | |
1026 |
|
1027 |
|
1028 |
|
1029 | preloadingStrategy?: any;
|
1030 | |
1031 |
|
1032 |
|
1033 |
|
1034 |
|
1035 |
|
1036 |
|
1037 |
|
1038 | scrollOffset?: [number, number] | (() => [number, number]);
|
1039 | /**
|
1040 | * A custom handler for malformed URI errors. The handler is invoked when `encodedURI` contains
|
1041 | * invalid character sequences.
|
1042 | * The default implementation is to redirect to the root URL, dropping
|
1043 | * any path or parameter information. The function takes three parameters:
|
1044 | *
|
1045 | * - `'URIError'` - Error thrown when parsing a bad URL.
|
1046 | * - `'UrlSerializer'` - UrlSerializer that’s configured with the router.
|
1047 | * - `'url'` - The malformed URL that caused the URIError
|
1048 | *
|
1049 | * @deprecated URI parsing errors should be handled in the `UrlSerializer` instead.
|
1050 | * */
|
1051 | malformedUriErrorHandler?: (error: URIError, urlSerializer: UrlSerializer, url: string) => UrlTree;
|
1052 | }
|
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 |
|
1058 |
|
1059 |
|
1060 |
|
1061 | export declare class GuardsCheckEnd extends RouterEvent {
|
1062 |
|
1063 | urlAfterRedirects: string;
|
1064 |
|
1065 | state: RouterStateSnapshot;
|
1066 |
|
1067 | shouldActivate: boolean;
|
1068 | readonly type = EventType.GuardsCheckEnd;
|
1069 | constructor(
|
1070 |
|
1071 | id: number,
|
1072 |
|
1073 | url: string,
|
1074 |
|
1075 | urlAfterRedirects: string,
|
1076 |
|
1077 | state: RouterStateSnapshot,
|
1078 |
|
1079 | shouldActivate: boolean);
|
1080 | toString(): string;
|
1081 | }
|
1082 |
|
1083 | /**
|
1084 | * An event triggered at the start of the Guard phase of routing.
|
1085 | *
|
1086 | * @see `GuardsCheckEnd`
|
1087 | *
|
1088 | * @publicApi
|
1089 | */
|
1090 | export declare class GuardsCheckStart extends RouterEvent {
|
1091 |
|
1092 | urlAfterRedirects: string;
|
1093 |
|
1094 | state: RouterStateSnapshot;
|
1095 | readonly type = EventType.GuardsCheckStart;
|
1096 | constructor(
|
1097 |
|
1098 | id: number,
|
1099 |
|
1100 | url: string,
|
1101 |
|
1102 | urlAfterRedirects: string,
|
1103 |
|
1104 | state: RouterStateSnapshot);
|
1105 | toString(): string;
|
1106 | }
|
1107 |
|
1108 | declare namespace i1 {
|
1109 | export {
|
1110 | RouterOutletContract,
|
1111 | RouterOutlet
|
1112 | }
|
1113 | }
|
1114 |
|
1115 | declare namespace i2 {
|
1116 | export {
|
1117 | RouterLink,
|
1118 | RouterLink as RouterLinkWithHref
|
1119 | }
|
1120 | }
|
1121 |
|
1122 | declare namespace i3 {
|
1123 | export {
|
1124 | RouterLinkActive
|
1125 | }
|
1126 | }
|
1127 |
|
1128 | declare namespace i4 {
|
1129 | export {
|
1130 | ɵEmptyOutletComponent,
|
1131 | ɵEmptyOutletComponent as EmptyOutletComponent
|
1132 | }
|
1133 | }
|
1134 |
|
1135 |
|
1136 |
|
1137 |
|
1138 |
|
1139 |
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 |
|
1149 |
|
1150 |
|
1151 |
|
1152 |
|
1153 |
|
1154 | export declare type InitialNavigation = 'disabled' | 'enabledBlocking' | 'enabledNonBlocking';
|
1155 |
|
1156 |
|
1157 |
|
1158 |
|
1159 |
|
1160 |
|
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 | export declare type InitialNavigationFeature = EnabledBlockingInitialNavigationFeature | DisabledInitialNavigationFeature;
|
1167 |
|
1168 |
|
1169 |
|
1170 |
|
1171 |
|
1172 |
|
1173 |
|
1174 |
|
1175 |
|
1176 | export declare type InMemoryScrollingFeature = RouterFeature<RouterFeatureKind.InMemoryScrollingFeature>;
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 | export declare interface InMemoryScrollingOptions {
|
1185 | |
1186 |
|
1187 |
|
1188 |
|
1189 |
|
1190 |
|
1191 |
|
1192 | anchorScrolling?: 'disabled' | 'enabled';
|
1193 | |
1194 |
|
1195 |
|
1196 |
|
1197 |
|
1198 |
|
1199 |
|
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 | scrollPositionRestoration?: 'disabled' | 'enabled' | 'top';
|
1228 | }
|
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 |
|
1235 |
|
1236 |
|
1237 | export declare interface IsActiveMatchOptions {
|
1238 | |
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 | matrixParams: 'exact' | 'subset' | 'ignored';
|
1252 | |
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 |
|
1259 |
|
1260 | queryParams: 'exact' | 'subset' | 'ignored';
|
1261 | |
1262 |
|
1263 |
|
1264 |
|
1265 |
|
1266 |
|
1267 |
|
1268 |
|
1269 | paths: 'exact' | 'subset';
|
1270 | |
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 | fragment: 'exact' | 'ignored';
|
1276 | }
|
1277 |
|
1278 |
|
1279 |
|
1280 |
|
1281 |
|
1282 |
|
1283 |
|
1284 |
|
1285 | export declare type LoadChildren = LoadChildrenCallback;
|
1286 |
|
1287 |
|
1288 |
|
1289 |
|
1290 |
|
1291 |
|
1292 |
|
1293 |
|
1294 |
|
1295 |
|
1296 |
|
1297 |
|
1298 |
|
1299 |
|
1300 |
|
1301 |
|
1302 |
|
1303 |
|
1304 |
|
1305 |
|
1306 |
|
1307 |
|
1308 |
|
1309 |
|
1310 |
|
1311 |
|
1312 |
|
1313 |
|
1314 |
|
1315 |
|
1316 |
|
1317 |
|
1318 |
|
1319 |
|
1320 |
|
1321 |
|
1322 | 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>>;
|
1323 |
|
1324 | declare interface LoadedRouterConfig {
|
1325 | routes: Route[];
|
1326 | injector: EnvironmentInjector | undefined;
|
1327 | }
|
1328 |
|
1329 |
|
1330 |
|
1331 |
|
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 |
|
1341 |
|
1342 |
|
1343 |
|
1344 |
|
1345 |
|
1346 |
|
1347 |
|
1348 |
|
1349 |
|
1350 |
|
1351 |
|
1352 |
|
1353 | export declare interface Navigation {
|
1354 | |
1355 |
|
1356 |
|
1357 | id: number;
|
1358 | |
1359 |
|
1360 |
|
1361 |
|
1362 | initialUrl: UrlTree;
|
1363 | |
1364 |
|
1365 |
|
1366 | extractedUrl: UrlTree;
|
1367 | |
1368 |
|
1369 |
|
1370 |
|
1371 |
|
1372 | finalUrl?: UrlTree;
|
1373 | |
1374 |
|
1375 |
|
1376 |
|
1377 |
|
1378 |
|
1379 |
|
1380 | trigger: 'imperative' | 'popstate' | 'hashchange';
|
1381 | |
1382 |
|
1383 |
|
1384 |
|
1385 | extras: NavigationExtras;
|
1386 | |
1387 |
|
1388 |
|
1389 |
|
1390 |
|
1391 | previousNavigation: Navigation | null;
|
1392 | }
|
1393 |
|
1394 |
|
1395 |
|
1396 |
|
1397 |
|
1398 |
|
1399 |
|
1400 |
|
1401 |
|
1402 |
|
1403 |
|
1404 |
|
1405 |
|
1406 |
|
1407 | export declare interface NavigationBehaviorOptions {
|
1408 | |
1409 |
|
1410 |
|
1411 |
|
1412 |
|
1413 |
|
1414 |
|
1415 |
|
1416 |
|
1417 | onSameUrlNavigation?: Extract<OnSameUrlNavigation, 'reload'>;
|
1418 | |
1419 |
|
1420 |
|
1421 |
|
1422 |
|
1423 |
|
1424 |
|
1425 |
|
1426 | skipLocationChange?: boolean;
|
1427 | |
1428 |
|
1429 |
|
1430 |
|
1431 |
|
1432 |
|
1433 |
|
1434 |
|
1435 | replaceUrl?: boolean;
|
1436 | |
1437 |
|
1438 |
|
1439 |
|
1440 |
|
1441 |
|
1442 |
|
1443 |
|
1444 |
|
1445 |
|
1446 |
|
1447 |
|
1448 |
|
1449 |
|
1450 |
|
1451 | state?: {
|
1452 | [k: string]: any;
|
1453 | };
|
1454 | }
|
1455 |
|
1456 |
|
1457 |
|
1458 |
|
1459 |
|
1460 |
|
1461 |
|
1462 |
|
1463 |
|
1464 |
|
1465 |
|
1466 |
|
1467 | export declare class NavigationCancel extends RouterEvent {
|
1468 | |
1469 |
|
1470 |
|
1471 |
|
1472 | reason: string;
|
1473 | |
1474 |
|
1475 |
|
1476 |
|
1477 |
|
1478 | readonly code?: NavigationCancellationCode | undefined;
|
1479 | readonly type = EventType.NavigationCancel;
|
1480 | constructor(
|
1481 |
|
1482 | id: number,
|
1483 |
|
1484 | url: string,
|
1485 | |
1486 |
|
1487 |
|
1488 |
|
1489 | reason: string,
|
1490 | |
1491 |
|
1492 |
|
1493 |
|
1494 |
|
1495 | code?: NavigationCancellationCode | undefined);
|
1496 | /** @docsNotRequired */
|
1497 | toString(): string;
|
1498 | }
|
1499 |
|
1500 | /**
|
1501 | * A code for the `NavigationCancel` event of the `Router` to indicate the
|
1502 | * reason a navigation failed.
|
1503 | *
|
1504 | * @publicApi
|
1505 | */
|
1506 | export declare const enum NavigationCancellationCode {
|
1507 | |
1508 |
|
1509 |
|
1510 | Redirect = 0,
|
1511 | |
1512 |
|
1513 |
|
1514 | SupersededByNewNavigation = 1,
|
1515 | |
1516 |
|
1517 |
|
1518 | NoDataFromResolver = 2,
|
1519 | |
1520 |
|
1521 |
|
1522 | GuardRejected = 3
|
1523 | }
|
1524 |
|
1525 |
|
1526 |
|
1527 |
|
1528 |
|
1529 |
|
1530 |
|
1531 |
|
1532 |
|
1533 |
|
1534 | export declare class NavigationEnd extends RouterEvent {
|
1535 |
|
1536 | urlAfterRedirects: string;
|
1537 | readonly type = EventType.NavigationEnd;
|
1538 | constructor(
|
1539 |
|
1540 | id: number,
|
1541 |
|
1542 | url: string,
|
1543 |
|
1544 | urlAfterRedirects: string);
|
1545 | /** @docsNotRequired */
|
1546 | toString(): string;
|
1547 | }
|
1548 |
|
1549 | /**
|
1550 | * An event triggered when a navigation fails due to an unexpected error.
|
1551 | *
|
1552 | * @see `NavigationStart`
|
1553 | * @see `NavigationEnd`
|
1554 | * @see `NavigationCancel`
|
1555 | *
|
1556 | * @publicApi
|
1557 | */
|
1558 | export declare class NavigationError extends RouterEvent {
|
1559 |
|
1560 | error: any;
|
1561 | |
1562 |
|
1563 |
|
1564 |
|
1565 |
|
1566 |
|
1567 | readonly target?: RouterStateSnapshot | undefined;
|
1568 | readonly type = EventType.NavigationError;
|
1569 | constructor(
|
1570 |
|
1571 | id: number,
|
1572 |
|
1573 | url: string,
|
1574 |
|
1575 | error: any,
|
1576 | |
1577 |
|
1578 |
|
1579 |
|
1580 |
|
1581 |
|
1582 | target?: RouterStateSnapshot | undefined);
|
1583 | /** @docsNotRequired */
|
1584 | toString(): string;
|
1585 | }
|
1586 |
|
1587 | /**
|
1588 | * A type alias for providers returned by `withNavigationErrorHandler` for use with `provideRouter`.
|
1589 | *
|
1590 | * @see `withNavigationErrorHandler`
|
1591 | * @see `provideRouter`
|
1592 | *
|
1593 | * @publicApi
|
1594 | */
|
1595 | export declare type NavigationErrorHandlerFeature = RouterFeature<RouterFeatureKind.NavigationErrorHandlerFeature>;
|
1596 |
|
1597 | /**
|
1598 | * @description
|
1599 | *
|
1600 | * Options that modify the `Router` navigation strategy.
|
1601 | * Supply an object containing any of these properties to a `Router` navigation function to
|
1602 | * control how the target URL should be constructed or interpreted.
|
1603 | *
|
1604 | * @see [Router.navigate() method](api/router/Router#navigate)
|
1605 | * @see [Router.navigateByUrl() method](api/router/Router#navigatebyurl)
|
1606 | * @see [Router.createUrlTree() method](api/router/Router#createurltree)
|
1607 | * @see [Routing and Navigation guide](guide/router)
|
1608 | * @see UrlCreationOptions
|
1609 | * @see NavigationBehaviorOptions
|
1610 | *
|
1611 | * @publicApi
|
1612 | */
|
1613 | export declare interface NavigationExtras extends UrlCreationOptions, NavigationBehaviorOptions {
|
1614 | }
|
1615 |
|
1616 |
|
1617 |
|
1618 |
|
1619 |
|
1620 |
|
1621 |
|
1622 |
|
1623 |
|
1624 | export declare class NavigationSkipped extends RouterEvent {
|
1625 | |
1626 |
|
1627 |
|
1628 |
|
1629 | reason: string;
|
1630 | |
1631 |
|
1632 |
|
1633 |
|
1634 |
|
1635 | readonly code?: NavigationSkippedCode | undefined;
|
1636 | readonly type = EventType.NavigationSkipped;
|
1637 | constructor(
|
1638 |
|
1639 | id: number,
|
1640 |
|
1641 | url: string,
|
1642 | |
1643 |
|
1644 |
|
1645 |
|
1646 | reason: string,
|
1647 | |
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 | code?: NavigationSkippedCode | undefined);
|
1653 | }
|
1654 |
|
1655 | /**
|
1656 | * A code for the `NavigationSkipped` event of the `Router` to indicate the
|
1657 | * reason a navigation was skipped.
|
1658 | *
|
1659 | * @publicApi
|
1660 | */
|
1661 | export declare const enum NavigationSkippedCode {
|
1662 | |
1663 |
|
1664 |
|
1665 | IgnoredSameUrlNavigation = 0,
|
1666 | |
1667 |
|
1668 |
|
1669 |
|
1670 |
|
1671 |
|
1672 | IgnoredByUrlHandlingStrategy = 1
|
1673 | }
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 | export declare class NavigationStart extends RouterEvent {
|
1681 | readonly type = EventType.NavigationStart;
|
1682 | |
1683 |
|
1684 |
|
1685 |
|
1686 |
|
1687 |
|
1688 |
|
1689 |
|
1690 | navigationTrigger?: NavigationTrigger;
|
1691 | |
1692 |
|
1693 |
|
1694 |
|
1695 |
|
1696 |
|
1697 |
|
1698 |
|
1699 |
|
1700 |
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 |
|
1707 |
|
1708 | restoredState?: {
|
1709 | [k: string]: any;
|
1710 | navigationId: number;
|
1711 | } | null;
|
1712 | constructor(
|
1713 |
|
1714 | id: number,
|
1715 |
|
1716 | url: string,
|
1717 |
|
1718 | navigationTrigger?: NavigationTrigger,
|
1719 |
|
1720 | restoredState?: {
|
1721 | [k: string]: any;
|
1722 | navigationId: number;
|
1723 | } | null);
|
1724 | /** @docsNotRequired */
|
1725 | toString(): string;
|
1726 | }
|
1727 |
|
1728 | /**
|
1729 | * Identifies the call or event that triggered a navigation.
|
1730 | *
|
1731 | * * 'imperative': Triggered by `router.navigateByUrl()` or `router.navigate()`.
|
1732 | * * 'popstate' : Triggered by a `popstate` event.
|
1733 | * * 'hashchange'-: Triggered by a `hashchange` event.
|
1734 | *
|
1735 | * @publicApi
|
1736 | */
|
1737 | declare type NavigationTrigger = 'imperative' | 'popstate' | 'hashchange';
|
1738 |
|
1739 | /**
|
1740 | * @description
|
1741 | *
|
1742 | * Provides a preloading strategy that does not preload any modules.
|
1743 | *
|
1744 | * This strategy is enabled by default.
|
1745 | *
|
1746 | * @publicApi
|
1747 | */
|
1748 | export declare class NoPreloading implements PreloadingStrategy {
|
1749 | preload(route: Route, fn: () => Observable<any>): Observable<any>;
|
1750 | static ɵfac: i0.ɵɵFactoryDeclaration<NoPreloading, never>;
|
1751 | static ɵprov: i0.ɵɵInjectableDeclaration<NoPreloading>;
|
1752 | }
|
1753 |
|
1754 |
|
1755 |
|
1756 |
|
1757 |
|
1758 |
|
1759 |
|
1760 |
|
1761 |
|
1762 |
|
1763 |
|
1764 |
|
1765 |
|
1766 |
|
1767 |
|
1768 |
|
1769 |
|
1770 |
|
1771 |
|
1772 |
|
1773 |
|
1774 |
|
1775 |
|
1776 |
|
1777 |
|
1778 | export declare type OnSameUrlNavigation = 'reload' | 'ignore';
|
1779 |
|
1780 |
|
1781 |
|
1782 |
|
1783 |
|
1784 |
|
1785 | export declare class OutletContext {
|
1786 | outlet: RouterOutletContract | null;
|
1787 | route: ActivatedRoute | null;
|
1788 | |
1789 |
|
1790 |
|
1791 |
|
1792 | resolver: ComponentFactoryResolver | null;
|
1793 | injector: EnvironmentInjector | null;
|
1794 | children: ChildrenOutletContexts;
|
1795 | attachRef: ComponentRef<any> | null;
|
1796 | }
|
1797 |
|
1798 |
|
1799 |
|
1800 |
|
1801 |
|
1802 |
|
1803 |
|
1804 |
|
1805 |
|
1806 |
|
1807 |
|
1808 | export declare interface ParamMap {
|
1809 | |
1810 |
|
1811 |
|
1812 |
|
1813 |
|
1814 | has(name: string): boolean;
|
1815 | |
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 |
|
1821 |
|
1822 | get(name: string): string | null;
|
1823 | |
1824 |
|
1825 |
|
1826 |
|
1827 |
|
1828 |
|
1829 |
|
1830 | getAll(name: string): string[];
|
1831 |
|
1832 | readonly keys: string[];
|
1833 | }
|
1834 |
|
1835 |
|
1836 |
|
1837 |
|
1838 |
|
1839 |
|
1840 |
|
1841 |
|
1842 | export declare type Params = {
|
1843 | [key: string]: any;
|
1844 | };
|
1845 |
|
1846 |
|
1847 |
|
1848 |
|
1849 |
|
1850 |
|
1851 |
|
1852 |
|
1853 |
|
1854 |
|
1855 |
|
1856 |
|
1857 | export declare class PreloadAllModules implements PreloadingStrategy {
|
1858 | preload(route: Route, fn: () => Observable<any>): Observable<any>;
|
1859 | static ɵfac: i0.ɵɵFactoryDeclaration<PreloadAllModules, never>;
|
1860 | static ɵprov: i0.ɵɵInjectableDeclaration<PreloadAllModules>;
|
1861 | }
|
1862 |
|
1863 |
|
1864 |
|
1865 |
|
1866 |
|
1867 |
|
1868 |
|
1869 |
|
1870 |
|
1871 |
|
1872 | export declare type PreloadingFeature = RouterFeature<RouterFeatureKind.PreloadingFeature>;
|
1873 |
|
1874 |
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 | export declare abstract class PreloadingStrategy {
|
1882 | abstract preload(route: Route, fn: () => Observable<any>): Observable<any>;
|
1883 | }
|
1884 |
|
1885 |
|
1886 |
|
1887 |
|
1888 |
|
1889 |
|
1890 | export declare const PRIMARY_OUTLET = "primary";
|
1891 |
|
1892 |
|
1893 |
|
1894 |
|
1895 |
|
1896 |
|
1897 |
|
1898 |
|
1899 |
|
1900 |
|
1901 |
|
1902 |
|
1903 |
|
1904 |
|
1905 |
|
1906 |
|
1907 |
|
1908 |
|
1909 |
|
1910 |
|
1911 |
|
1912 |
|
1913 |
|
1914 |
|
1915 |
|
1916 |
|
1917 |
|
1918 |
|
1919 |
|
1920 |
|
1921 |
|
1922 |
|
1923 |
|
1924 |
|
1925 |
|
1926 |
|
1927 |
|
1928 | export declare function provideRouter(routes: Routes, ...features: RouterFeatures[]): EnvironmentProviders;
|
1929 |
|
1930 |
|
1931 |
|
1932 |
|
1933 |
|
1934 |
|
1935 |
|
1936 |
|
1937 |
|
1938 |
|
1939 |
|
1940 |
|
1941 |
|
1942 |
|
1943 |
|
1944 |
|
1945 |
|
1946 |
|
1947 | export declare function provideRoutes(routes: Routes): Provider[];
|
1948 |
|
1949 |
|
1950 |
|
1951 |
|
1952 |
|
1953 |
|
1954 |
|
1955 |
|
1956 |
|
1957 |
|
1958 |
|
1959 |
|
1960 |
|
1961 | export declare type QueryParamsHandling = 'merge' | 'preserve' | '';
|
1962 |
|
1963 |
|
1964 |
|
1965 |
|
1966 |
|
1967 |
|
1968 |
|
1969 |
|
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 |
|
2008 |
|
2009 |
|
2010 |
|
2011 |
|
2012 |
|
2013 |
|
2014 |
|
2015 |
|
2016 |
|
2017 |
|
2018 |
|
2019 |
|
2020 |
|
2021 |
|
2022 |
|
2023 |
|
2024 |
|
2025 |
|
2026 |
|
2027 |
|
2028 |
|
2029 |
|
2030 |
|
2031 |
|
2032 |
|
2033 |
|
2034 |
|
2035 |
|
2036 |
|
2037 |
|
2038 |
|
2039 |
|
2040 |
|
2041 |
|
2042 |
|
2043 |
|
2044 |
|
2045 |
|
2046 |
|
2047 |
|
2048 |
|
2049 |
|
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 |
|
2058 |
|
2059 | export declare interface Resolve<T> {
|
2060 | resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<T> | Promise<T> | T;
|
2061 | }
|
2062 |
|
2063 |
|
2064 |
|
2065 |
|
2066 |
|
2067 |
|
2068 |
|
2069 |
|
2070 |
|
2071 | export declare type ResolveData = {
|
2072 | [key: string | symbol]: ResolveFn<unknown> | DeprecatedGuard;
|
2073 | };
|
2074 |
|
2075 |
|
2076 |
|
2077 |
|
2078 |
|
2079 |
|
2080 |
|
2081 | export declare class ResolveEnd extends RouterEvent {
|
2082 |
|
2083 | urlAfterRedirects: string;
|
2084 |
|
2085 | state: RouterStateSnapshot;
|
2086 | readonly type = EventType.ResolveEnd;
|
2087 | constructor(
|
2088 |
|
2089 | id: number,
|
2090 |
|
2091 | url: string,
|
2092 |
|
2093 | urlAfterRedirects: string,
|
2094 |
|
2095 | state: RouterStateSnapshot);
|
2096 | toString(): string;
|
2097 | }
|
2098 |
|
2099 | /**
|
2100 | * Function type definition for a data provider.
|
2101 |
|
2102 | * A data provider can be used with the router to resolve data during navigation.
|
2103 | * The router waits for the data to be resolved before the route is finally activated.
|
2104 | *
|
2105 | * The following example implements a function that retrieves the data
|
2106 | * needed to activate the requested route.
|
2107 | *
|
2108 | * {@example router/route_functional_guards.ts region="ResolveFn"}
|
2109 | *
|
2110 | * And you can access to your resolved data from `HeroComponent`:
|
2111 | *
|
2112 | * {@example router/route_functional_guards.ts region="ResolveDataUse"}
|
2113 | *
|
2114 | * @usageNotes
|
2115 | *
|
2116 | * When both guard and resolvers are specified, the resolvers are not executed until
|
2117 | * all guards have run and succeeded.
|
2118 | * For example, consider the following route configuration:
|
2119 | *
|
2120 | * ```
|
2121 | * {
|
2122 | * path: 'base'
|
2123 | * canActivate: [baseGuard],
|
2124 | * resolve: {data: baseDataResolver}
|
2125 | * children: [
|
2126 | * {
|
2127 | * path: 'child',
|
2128 | * canActivate: [childGuard],
|
2129 | * component: ChildComponent,
|
2130 | * resolve: {childData: childDataResolver}
|
2131 | * }
|
2132 | * ]
|
2133 | * }
|
2134 | * ```
|
2135 | * The order of execution is: baseGuard, childGuard, baseDataResolver, childDataResolver.
|
2136 | *
|
2137 | * @publicApi
|
2138 | * @see `Route`
|
2139 | */
|
2140 | export declare type ResolveFn<T> = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => Observable<T> | Promise<T> | T;
|
2141 |
|
2142 | /**
|
2143 | * An event triggered at the start of the Resolve phase of routing.
|
2144 | *
|
2145 | * Runs in the "resolve" phase whether or not there is anything to resolve.
|
2146 | * In future, may change to only run when there are things to be resolved.
|
2147 | *
|
2148 | * @see `ResolveEnd`
|
2149 | *
|
2150 | * @publicApi
|
2151 | */
|
2152 | export declare class ResolveStart extends RouterEvent {
|
2153 | /** @docsNotRequired */
|
2154 | urlAfterRedirects: string;
|
2155 | /** @docsNotRequired */
|
2156 | state: RouterStateSnapshot;
|
2157 | readonly type = EventType.ResolveStart;
|
2158 | constructor(
|
2159 | /** @docsNotRequired */
|
2160 | id: number,
|
2161 | /** @docsNotRequired */
|
2162 | url: string,
|
2163 | /** @docsNotRequired */
|
2164 | urlAfterRedirects: string,
|
2165 | /** @docsNotRequired */
|
2166 | state: RouterStateSnapshot);
|
2167 | toString(): string;
|
2168 | }
|
2169 |
|
2170 | /**
|
2171 | * A configuration object that defines a single route.
|
2172 | * A set of routes are collected in a `Routes` array to define a `Router` configuration.
|
2173 | * The router attempts to match segments of a given URL against each route,
|
2174 | * using the configuration options defined in this object.
|
2175 | *
|
2176 | * Supports static, parameterized, redirect, and wildcard routes, as well as
|
2177 | * custom route data and resolve methods.
|
2178 | *
|
2179 | * For detailed usage information, see the [Routing Guide](guide/router).
|
2180 | *
|
2181 | * @usageNotes
|
2182 | *
|
2183 | * ### Simple Configuration
|
2184 | *
|
2185 | * The following route specifies that when navigating to, for example,
|
2186 | * `/team/11/user/bob`, the router creates the 'Team' component
|
2187 | * with the 'User' child component in it.
|
2188 | *
|
2189 | * ```
|
2190 | * [{
|
2191 | * path: 'team/:id',
|
2192 | * component: Team,
|
2193 | * children: [{
|
2194 | * path: 'user/:name',
|
2195 | * component: User
|
2196 | * }]
|
2197 | * }]
|
2198 | * ```
|
2199 | *
|
2200 | * ### Multiple Outlets
|
2201 | *
|
2202 | * The following route creates sibling components with multiple outlets.
|
2203 | * When navigating to `/team/11(aux:chat/jim)`, the router creates the 'Team' component next to
|
2204 | * the 'Chat' component. The 'Chat' component is placed into the 'aux' outlet.
|
2205 | *
|
2206 | * ```
|
2207 | * [{
|
2208 | * path: 'team/:id',
|
2209 | * component: Team
|
2210 | * }, {
|
2211 | * path: 'chat/:user',
|
2212 | * component: Chat
|
2213 | * outlet: 'aux'
|
2214 | * }]
|
2215 | * ```
|
2216 | *
|
2217 | * ### Wild Cards
|
2218 | *
|
2219 | * The following route uses wild-card notation to specify a component
|
2220 | * that is always instantiated regardless of where you navigate to.
|
2221 | *
|
2222 | * ```
|
2223 | * [{
|
2224 | * path: '**',
|
2225 | * component: WildcardComponent
|
2226 | * }]
|
2227 | * ```
|
2228 | *
|
2229 | * ### Redirects
|
2230 | *
|
2231 | * The following route uses the `redirectTo` property to ignore a segment of
|
2232 | * a given URL when looking for a child path.
|
2233 | *
|
2234 | * When navigating to '/team/11/legacy/user/jim', the router changes the URL segment
|
2235 | * '/team/11/legacy/user/jim' to '/team/11/user/jim', and then instantiates
|
2236 | * the Team component with the User child component in it.
|
2237 | *
|
2238 | * ```
|
2239 | * [{
|
2240 | * path: 'team/:id',
|
2241 | * component: Team,
|
2242 | * children: [{
|
2243 | * path: 'legacy/user/:name',
|
2244 | * redirectTo: 'user/:name'
|
2245 | * }, {
|
2246 | * path: 'user/:name',
|
2247 | * component: User
|
2248 | * }]
|
2249 | * }]
|
2250 | * ```
|
2251 | *
|
2252 | * The redirect path can be relative, as shown in this example, or absolute.
|
2253 | * If we change the `redirectTo` value in the example to the absolute URL segment '/user/:name',
|
2254 | * the result URL is also absolute, '/user/jim'.
|
2255 |
|
2256 | * ### Empty Path
|
2257 | *
|
2258 | * Empty-path route configurations can be used to instantiate components that do not 'consume'
|
2259 | * any URL segments.
|
2260 | *
|
2261 | * In the following configuration, when navigating to
|
2262 | * `/team/11`, the router instantiates the 'AllUsers' component.
|
2263 | *
|
2264 | * ```
|
2265 | * [{
|
2266 | * path: 'team/:id',
|
2267 | * component: Team,
|
2268 | * children: [{
|
2269 | * path: '',
|
2270 | * component: AllUsers
|
2271 | * }, {
|
2272 | * path: 'user/:name',
|
2273 | * component: User
|
2274 | * }]
|
2275 | * }]
|
2276 | * ```
|
2277 | *
|
2278 | * Empty-path routes can have children. In the following example, when navigating
|
2279 | * to `/team/11/user/jim`, the router instantiates the wrapper component with
|
2280 | * the user component in it.
|
2281 | *
|
2282 | * Note that an empty path route inherits its parent's parameters and data.
|
2283 | *
|
2284 | * ```
|
2285 | * [{
|
2286 | * path: 'team/:id',
|
2287 | * component: Team,
|
2288 | * children: [{
|
2289 | * path: '',
|
2290 | * component: WrapperCmp,
|
2291 | * children: [{
|
2292 | * path: 'user/:name',
|
2293 | * component: User
|
2294 | * }]
|
2295 | * }]
|
2296 | * }]
|
2297 | * ```
|
2298 | *
|
2299 | * ### Matching Strategy
|
2300 | *
|
2301 | * The default path-match strategy is 'prefix', which means that the router
|
2302 | * checks URL elements from the left to see if the URL matches a specified path.
|
2303 | * For example, '/team/11/user' matches 'team/:id'.
|
2304 | *
|
2305 | * ```
|
2306 | * [{
|
2307 | * path: '',
|
2308 | * pathMatch: 'prefix',
|
2309 | * redirectTo: 'main'
|
2310 | * }, {
|
2311 | * path: 'main',
|
2312 | * component: Main
|
2313 | * }]
|
2314 | * ```
|
2315 | *
|
2316 | * You can specify the path-match strategy 'full' to make sure that the path
|
2317 | * covers the whole unconsumed URL. It is important to do this when redirecting
|
2318 | * empty-path routes. Otherwise, because an empty path is a prefix of any URL,
|
2319 | * the router would apply the redirect even when navigating to the redirect destination,
|
2320 | * creating an endless loop.
|
2321 | *
|
2322 | * In the following example, supplying the 'full' `pathMatch` strategy ensures
|
2323 | * that the router applies the redirect if and only if navigating to '/'.
|
2324 | *
|
2325 | * ```
|
2326 | * [{
|
2327 | * path: '',
|
2328 | * pathMatch: 'full',
|
2329 | * redirectTo: 'main'
|
2330 | * }, {
|
2331 | * path: 'main',
|
2332 | * component: Main
|
2333 | * }]
|
2334 | * ```
|
2335 | *
|
2336 | * ### Componentless Routes
|
2337 | *
|
2338 | * You can share parameters between sibling components.
|
2339 | * For example, suppose that two sibling components should go next to each other,
|
2340 | * and both of them require an ID parameter. You can accomplish this using a route
|
2341 | * that does not specify a component at the top level.
|
2342 | *
|
2343 | * In the following example, 'MainChild' and 'AuxChild' are siblings.
|
2344 | * When navigating to 'parent/10/(a//aux:b)', the route instantiates
|
2345 | * the main child and aux child components next to each other.
|
2346 | * For this to work, the application component must have the primary and aux outlets defined.
|
2347 | *
|
2348 | * ```
|
2349 | * [{
|
2350 | * path: 'parent/:id',
|
2351 | * children: [
|
2352 | * { path: 'a', component: MainChild },
|
2353 | * { path: 'b', component: AuxChild, outlet: 'aux' }
|
2354 | * ]
|
2355 | * }]
|
2356 | * ```
|
2357 | *
|
2358 | * The router merges the parameters, data, and resolve of the componentless
|
2359 | * parent into the parameters, data, and resolve of the children.
|
2360 | *
|
2361 | * This is especially useful when child components are defined
|
2362 | * with an empty path string, as in the following example.
|
2363 | * With this configuration, navigating to '/parent/10' creates
|
2364 | * the main child and aux components.
|
2365 | *
|
2366 | * ```
|
2367 | * [{
|
2368 | * path: 'parent/:id',
|
2369 | * children: [
|
2370 | * { path: '', component: MainChild },
|
2371 | * { path: '', component: AuxChild, outlet: 'aux' }
|
2372 | * ]
|
2373 | * }]
|
2374 | * ```
|
2375 | *
|
2376 | * ### Lazy Loading
|
2377 | *
|
2378 | * Lazy loading speeds up application load time by splitting the application
|
2379 | * into multiple bundles and loading them on demand.
|
2380 | * To use lazy loading, provide the `loadChildren` property in the `Route` object,
|
2381 | * instead of the `children` property.
|
2382 | *
|
2383 | * Given the following example route, the router will lazy load
|
2384 | * the associated module on demand using the browser native import system.
|
2385 | *
|
2386 | * ```
|
2387 | * [{
|
2388 | * path: 'lazy',
|
2389 | * loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule),
|
2390 | * }];
|
2391 | * ```
|
2392 | *
|
2393 | * @publicApi
|
2394 | */
|
2395 | export declare interface Route {
|
2396 | /**
|
2397 | * Used to define a page title for the route. This can be a static string or an `Injectable` that
|
2398 | * implements `Resolve`.
|
2399 | *
|
2400 | * @see `PageTitleStrategy`
|
2401 | */
|
2402 | title?: string | Type<Resolve<string>> | ResolveFn<string>;
|
2403 | /**
|
2404 | * The path to match against. Cannot be used together with a custom `matcher` function.
|
2405 | * A URL string that uses router matching notation.
|
2406 | * Can be a wild card (`**`) that matches any URL (see Usage Notes below).
|
2407 | * Default is "/" (the root path).
|
2408 | *
|
2409 | */
|
2410 | path?: string;
|
2411 | /**
|
2412 | * The path-matching strategy, one of 'prefix' or 'full'.
|
2413 | * Default is 'prefix'.
|
2414 | *
|
2415 | * By default, the router checks URL elements from the left to see if the URL
|
2416 | * matches a given path and stops when there is a config match. Importantly there must still be a
|
2417 | * config match for each segment of the URL. For example, '/team/11/user' matches the prefix
|
2418 | * 'team/:id' if one of the route's children matches the segment 'user'. That is, the URL
|
2419 | * '/team/11/user' matches the config
|
2420 | * `{path: 'team/:id', children: [{path: ':user', component: User}]}`
|
2421 | * but does not match when there are no children as in `{path: 'team/:id', component: Team}`.
|
2422 | *
|
2423 | * The path-match strategy 'full' matches against the entire URL.
|
2424 | * It is important to do this when redirecting empty-path routes.
|
2425 | * Otherwise, because an empty path is a prefix of any URL,
|
2426 | * the router would apply the redirect even when navigating
|
2427 | * to the redirect destination, creating an endless loop.
|
2428 | *
|
2429 | */
|
2430 | pathMatch?: 'prefix' | 'full';
|
2431 | /**
|
2432 | * A custom URL-matching function. Cannot be used together with `path`.
|
2433 | */
|
2434 | matcher?: UrlMatcher;
|
2435 | /**
|
2436 | * The component to instantiate when the path matches.
|
2437 | * Can be empty if child routes specify components.
|
2438 | */
|
2439 | component?: Type<any>;
|
2440 | /**
|
2441 | * An object specifying a lazy-loaded component.
|
2442 | */
|
2443 | loadComponent?: () => Type<unknown> | Observable<Type<unknown> | DefaultExport<Type<unknown>>> | Promise<Type<unknown> | DefaultExport<Type<unknown>>>;
|
2444 | /**
|
2445 | * A URL to redirect to when the path matches.
|
2446 | *
|
2447 | * Absolute if the URL begins with a slash (/), otherwise relative to the path URL.
|
2448 | * Note that no further redirects are evaluated after an absolute redirect.
|
2449 | *
|
2450 | * When not present, router does not redirect.
|
2451 | */
|
2452 | redirectTo?: string;
|
2453 | /**
|
2454 | * Name of a `RouterOutlet` object where the component can be placed
|
2455 | * when the path matches.
|
2456 | */
|
2457 | outlet?: string;
|
2458 | /**
|
2459 | * An array of `CanActivateFn` or DI tokens used to look up `CanActivate()`
|
2460 | * handlers, in order to determine if the current user is allowed to
|
2461 | * activate the component. By default, any user can activate.
|
2462 | *
|
2463 | * When using a function rather than DI tokens, the function can call `inject` to get any required
|
2464 | * dependencies. This `inject` call must be done in a synchronous context.
|
2465 | */
|
2466 | canActivate?: Array<CanActivateFn | DeprecatedGuard>;
|
2467 | /**
|
2468 | * An array of `CanMatchFn` or DI tokens used to look up `CanMatch()`
|
2469 | * handlers, in order to determine if the current user is allowed to
|
2470 | * match the `Route`. By default, any route can match.
|
2471 | *
|
2472 | * When using a function rather than DI tokens, the function can call `inject` to get any required
|
2473 | * dependencies. This `inject` call must be done in a synchronous context.
|
2474 | */
|
2475 | canMatch?: Array<CanMatchFn | DeprecatedGuard>;
|
2476 | /**
|
2477 | * An array of `CanActivateChildFn` or DI tokens used to look up `CanActivateChild()` handlers,
|
2478 | * in order to determine if the current user is allowed to activate
|
2479 | * a child of the component. By default, any user can activate a child.
|
2480 | *
|
2481 | * When using a function rather than DI tokens, the function can call `inject` to get any required
|
2482 | * dependencies. This `inject` call must be done in a synchronous context.
|
2483 | */
|
2484 | canActivateChild?: Array<CanActivateChildFn | DeprecatedGuard>;
|
2485 | /**
|
2486 | * An array of `CanDeactivateFn` or DI tokens used to look up `CanDeactivate()`
|
2487 | * handlers, in order to determine if the current user is allowed to
|
2488 | * deactivate the component. By default, any user can deactivate.
|
2489 | *
|
2490 | * When using a function rather than DI tokens, the function can call `inject` to get any required
|
2491 | * dependencies. This `inject` call must be done in a synchronous context.
|
2492 | */
|
2493 | canDeactivate?: Array<CanDeactivateFn<any> | DeprecatedGuard>;
|
2494 | /**
|
2495 | * An array of `CanLoadFn` or DI tokens used to look up `CanLoad()`
|
2496 | * handlers, in order to determine if the current user is allowed to
|
2497 | * load the component. By default, any user can load.
|
2498 | *
|
2499 | * When using a function rather than DI tokens, the function can call `inject` to get any required
|
2500 | * dependencies. This `inject` call must be done in a synchronous context.
|
2501 | * @deprecated Use `canMatch` instead
|
2502 | */
|
2503 | canLoad?: Array<CanLoadFn | DeprecatedGuard>;
|
2504 | /**
|
2505 | * Additional developer-defined data provided to the component via
|
2506 | * `ActivatedRoute`. By default, no additional data is passed.
|
2507 | */
|
2508 | data?: Data;
|
2509 | /**
|
2510 | * A map of DI tokens used to look up data resolvers. See `Resolve`.
|
2511 | */
|
2512 | resolve?: ResolveData;
|
2513 | /**
|
2514 | * An array of child `Route` objects that specifies a nested route
|
2515 | * configuration.
|
2516 | */
|
2517 | children?: Routes;
|
2518 | /**
|
2519 | * An object specifying lazy-loaded child routes.
|
2520 | */
|
2521 | loadChildren?: LoadChildren;
|
2522 | /**
|
2523 | * A policy for when to run guards and resolvers on a route.
|
2524 | *
|
2525 | * Guards and/or resolvers will always run when a route is activated or deactivated. When a route
|
2526 | * is unchanged, the default behavior is the same as `paramsChange`.
|
2527 | *
|
2528 | * `paramsChange` : Rerun the guards and resolvers when path or
|
2529 | * path param changes. This does not include query parameters. This option is the default.
|
2530 | * - `always` : Run on every execution.
|
2531 | * - `pathParamsChange` : Rerun guards and resolvers when the path params
|
2532 | * change. This does not compare matrix or query parameters.
|
2533 | * - `paramsOrQueryParamsChange` : Run when path, matrix, or query parameters change.
|
2534 | * - `pathParamsOrQueryParamsChange` : Rerun guards and resolvers when the path params
|
2535 | * change or query params have changed. This does not include matrix parameters.
|
2536 | *
|
2537 | * @see `RunGuardsAndResolvers`
|
2538 | */
|
2539 | runGuardsAndResolvers?: RunGuardsAndResolvers;
|
2540 | /**
|
2541 | * A `Provider` array to use for this `Route` and its `children`.
|
2542 | *
|
2543 | * The `Router` will create a new `EnvironmentInjector` for this
|
2544 | * `Route` and use it for this `Route` and its `children`. If this
|
2545 | * route also has a `loadChildren` function which returns an `NgModuleRef`, this injector will be
|
2546 | * used as the parent of the lazy loaded module.
|
2547 | */
|
2548 | providers?: Array<Provider | EnvironmentProviders>;
|
2549 | }
|
2550 |
|
2551 | /**
|
2552 | * An event triggered when a route has been lazy loaded.
|
2553 | *
|
2554 | * @see `RouteConfigLoadStart`
|
2555 | *
|
2556 | * @publicApi
|
2557 | */
|
2558 | export declare class RouteConfigLoadEnd {
|
2559 | /** @docsNotRequired */
|
2560 | route: Route;
|
2561 | readonly type = EventType.RouteConfigLoadEnd;
|
2562 | constructor(
|
2563 | /** @docsNotRequired */
|
2564 | route: Route);
|
2565 | toString(): string;
|
2566 | }
|
2567 |
|
2568 | /**
|
2569 | * An event triggered before lazy loading a route configuration.
|
2570 | *
|
2571 | * @see `RouteConfigLoadEnd`
|
2572 | *
|
2573 | * @publicApi
|
2574 | */
|
2575 | export declare class RouteConfigLoadStart {
|
2576 | /** @docsNotRequired */
|
2577 | route: Route;
|
2578 | readonly type = EventType.RouteConfigLoadStart;
|
2579 | constructor(
|
2580 | /** @docsNotRequired */
|
2581 | route: Route);
|
2582 | toString(): string;
|
2583 | }
|
2584 |
|
2585 | /**
|
2586 | * @description
|
2587 | *
|
2588 | * A service that provides navigation among views and URL manipulation capabilities.
|
2589 | *
|
2590 | * @see `Route`.
|
2591 | * @see [Routing and Navigation Guide](guide/router).
|
2592 | *
|
2593 | * @ngModule RouterModule
|
2594 | *
|
2595 | * @publicApi
|
2596 | */
|
2597 | export declare class Router {
|
2598 | private disposed;
|
2599 | private locationSubscription?;
|
2600 | private get navigationId();
|
2601 | /**
|
2602 | * The id of the currently active page in the router.
|
2603 | * Updated to the transition's target id on a successful navigation.
|
2604 | *
|
2605 | * This is used to track what page the router last activated. When an attempted navigation fails,
|
2606 | * the router can then use this to compute how to restore the state back to the previously active
|
2607 | * page.
|
2608 | */
|
2609 | private currentPageId;
|
2610 | /**
|
2611 | * The ɵrouterPageId of whatever page is currently active in the browser history. This is
|
2612 | * important for computing the target page id for new navigations because we need to ensure each
|
2613 | * page id in the browser history is 1 more than the previous entry.
|
2614 | */
|
2615 | private get browserPageId();
|
2616 | private console;
|
2617 | private isNgZoneEnabled;
|
2618 | /**
|
2619 | * An event stream for routing events.
|
2620 | */
|
2621 | get events(): Observable<Event_2>;
|
2622 | /**
|
2623 | * The current state of routing in this NgModule.
|
2624 | */
|
2625 | readonly routerState: RouterState;
|
2626 | private options;
|
2627 | /**
|
2628 | * A handler for navigation errors in this NgModule.
|
2629 | *
|
2630 | * @deprecated Subscribe to the `Router` events and watch for `NavigationError` instead.
|
2631 | * `provideRouter` has the `withNavigationErrorHandler` feature to make this easier.
|
2632 | * @see `withNavigationErrorHandler`
|
2633 | */
|
2634 | errorHandler: (error: any) => any;
|
2635 | /**
|
2636 | * A handler for errors thrown by `Router.parseUrl(url)`
|
2637 | * when `url` contains an invalid character.
|
2638 | * The most common case is a `%` sign
|
2639 | * that's not encoded and is not part of a percent encoded sequence.
|
2640 | *
|
2641 | * @deprecated URI parsing errors should be handled in the `UrlSerializer`.
|
2642 | *
|
2643 | * @see `RouterModule`
|
2644 | */
|
2645 | malformedUriErrorHandler: (error: URIError, urlSerializer: UrlSerializer, url: string) => UrlTree;
|
2646 | /**
|
2647 | * True if at least one navigation event has occurred,
|
2648 | * false otherwise.
|
2649 | */
|
2650 | navigated: boolean;
|
2651 | private lastSuccessfulId;
|
2652 | /**
|
2653 | * A strategy for extracting and merging URLs.
|
2654 | * Used for AngularJS to Angular migrations.
|
2655 | *
|
2656 | * @deprecated Configure using `providers` instead:
|
2657 | * `{provide: UrlHandlingStrategy, useClass: MyStrategy}`.
|
2658 | */
|
2659 | urlHandlingStrategy: UrlHandlingStrategy;
|
2660 | /**
|
2661 | * A strategy for re-using routes.
|
2662 | *
|
2663 | * @deprecated Configure using `providers` instead:
|
2664 | * `{provide: RouteReuseStrategy, useClass: MyStrategy}`.
|
2665 | */
|
2666 | routeReuseStrategy: RouteReuseStrategy;
|
2667 | /** Strategy used to create a UrlTree. */
|
2668 | private readonly urlCreationStrategy;
|
2669 | /**
|
2670 | * A strategy for setting the title based on the `routerState`.
|
2671 | *
|
2672 | * @deprecated Configure using `providers` instead:
|
2673 | * `{provide: TitleStrategy, useClass: MyStrategy}`.
|
2674 | */
|
2675 | titleStrategy?: TitleStrategy;
|
2676 | /**
|
2677 | * How to handle a navigation request to the current URL.
|
2678 | *
|
2679 | *
|
2680 | * @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
2681 | * @see `withRouterConfig`
|
2682 | * @see `provideRouter`
|
2683 | * @see `RouterModule`
|
2684 | */
|
2685 | onSameUrlNavigation: OnSameUrlNavigation;
|
2686 | /**
|
2687 | * How to merge parameters, data, resolved data, and title from parent to child
|
2688 | * routes. One of:
|
2689 | *
|
2690 | * - `'emptyOnly'` : Inherit parent parameters, data, and resolved data
|
2691 | * for path-less or component-less routes.
|
2692 | * - `'always'` : Inherit parent parameters, data, and resolved data
|
2693 | * for all child routes.
|
2694 | *
|
2695 | * @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
2696 | * @see `withRouterConfig`
|
2697 | * @see `provideRouter`
|
2698 | * @see `RouterModule`
|
2699 | */
|
2700 | paramsInheritanceStrategy: 'emptyOnly' | 'always';
|
2701 | /**
|
2702 | * Determines when the router updates the browser URL.
|
2703 | * By default (`"deferred"`), updates the browser URL after navigation has finished.
|
2704 | * Set to `'eager'` to update the browser URL at the beginning of navigation.
|
2705 | * You can choose to update early so that, if navigation fails,
|
2706 | * you can show an error message with the URL that failed.
|
2707 | *
|
2708 | * @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
2709 | * @see `withRouterConfig`
|
2710 | * @see `provideRouter`
|
2711 | * @see `RouterModule`
|
2712 | */
|
2713 | urlUpdateStrategy: 'deferred' | 'eager';
|
2714 | /**
|
2715 | * Configures how the Router attempts to restore state when a navigation is cancelled.
|
2716 | *
|
2717 | * 'replace' - Always uses `location.replaceState` to set the browser state to the state of the
|
2718 | * router before the navigation started. This means that if the URL of the browser is updated
|
2719 | * _before_ the navigation is canceled, the Router will simply replace the item in history rather
|
2720 | * than trying to restore to the previous location in the session history. This happens most
|
2721 | * frequently with `urlUpdateStrategy: 'eager'` and navigations with the browser back/forward
|
2722 | * buttons.
|
2723 | *
|
2724 | * 'computed' - Will attempt to return to the same index in the session history that corresponds
|
2725 | * to the Angular route when the navigation gets cancelled. For example, if the browser back
|
2726 | * button is clicked and the navigation is cancelled, the Router will trigger a forward navigation
|
2727 | * and vice versa.
|
2728 | *
|
2729 | * Note: the 'computed' option is incompatible with any `UrlHandlingStrategy` which only
|
2730 | * handles a portion of the URL because the history restoration navigates to the previous place in
|
2731 | * the browser history rather than simply resetting a portion of the URL.
|
2732 | *
|
2733 | * The default value is `replace`.
|
2734 | *
|
2735 | * @deprecated Configure this through `provideRouter` or `RouterModule.forRoot` instead.
|
2736 | * @see `withRouterConfig`
|
2737 | * @see `provideRouter`
|
2738 | * @see `RouterModule`
|
2739 | */
|
2740 | canceledNavigationResolution: 'replace' | 'computed';
|
2741 | config: Routes;
|
2742 | private readonly navigationTransitions;
|
2743 | private readonly urlSerializer;
|
2744 | private readonly location;
|
2745 | constructor();
|
2746 | /**
|
2747 | * Sets up the location change listener and performs the initial navigation.
|
2748 | */
|
2749 | initialNavigation(): void;
|
2750 | /**
|
2751 | * Sets up the location change listener. This listener detects navigations triggered from outside
|
2752 | * the Router (the browser back/forward buttons, for example) and schedules a corresponding Router
|
2753 | * navigation so that the correct events, guards, etc. are triggered.
|
2754 | */
|
2755 | setUpLocationChangeListener(): void;
|
2756 | /**
|
2757 | * Schedules a router navigation to synchronize Router state with the browser state.
|
2758 | *
|
2759 | * This is done as a response to a popstate event and the initial navigation. These
|
2760 | * two scenarios represent times when the browser URL/state has been updated and
|
2761 | * the Router needs to respond to ensure its internal state matches.
|
2762 | */
|
2763 | private navigateToSyncWithBrowser;
|
2764 | /** The current URL. */
|
2765 | get url(): string;
|
2766 | /**
|
2767 | * Returns the current `Navigation` object when the router is navigating,
|
2768 | * and `null` when idle.
|
2769 | */
|
2770 | getCurrentNavigation(): Navigation | null;
|
2771 | /**
|
2772 | * Resets the route configuration used for navigation and generating links.
|
2773 | *
|
2774 | * @param config The route array for the new configuration.
|
2775 | *
|
2776 | * @usageNotes
|
2777 | *
|
2778 | * ```
|
2779 | * router.resetConfig([
|
2780 | * { path: 'team/:id', component: TeamCmp, children: [
|
2781 | * { path: 'simple', component: SimpleCmp },
|
2782 | * { path: 'user/:name', component: UserCmp }
|
2783 | * ]}
|
2784 | * ]);
|
2785 | * ```
|
2786 | */
|
2787 | resetConfig(config: Routes): void;
|
2788 | /** @nodoc */
|
2789 | ngOnDestroy(): void;
|
2790 | /** Disposes of the router. */
|
2791 | dispose(): void;
|
2792 | /**
|
2793 | * Appends URL segments to the current URL tree to create a new URL tree.
|
2794 | *
|
2795 | * @param commands An array of URL fragments with which to construct the new URL tree.
|
2796 | * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path
|
2797 | * segments, followed by the parameters for each segment.
|
2798 | * The fragments are applied to the current URL tree or the one provided in the `relativeTo`
|
2799 | * property of the options object, if supplied.
|
2800 | * @param navigationExtras Options that control the navigation strategy.
|
2801 | * @returns The new URL tree.
|
2802 | *
|
2803 | * @usageNotes
|
2804 | *
|
2805 | * ```
|
2806 | *
|
2807 | * router.createUrlTree(['/team', 33, 'user', 11]);
|
2808 | *
|
2809 | *
|
2810 | * router.createUrlTree(['/team', 33, {expand: true}, 'user', 11]);
|
2811 | *
|
2812 | *
|
2813 | * router.createUrlTree(['/team/33/user', userId]);
|
2814 | *
|
2815 | *
|
2816 | *
|
2817 | * router.createUrlTree([{segmentPath: '/one/two'}]);
|
2818 | *
|
2819 | *
|
2820 | * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: 'chat'}}]);
|
2821 | *
|
2822 | *
|
2823 | * router.createUrlTree(['/team', 33, {outlets: {primary: 'user/11', right: null}}]);
|
2824 | *
|
2825 | *
|
2826 | *
|
2827 | *
|
2828 | * router.createUrlTree(['details'], {relativeTo: route});
|
2829 | *
|
2830 | *
|
2831 | * router.createUrlTree(['../22'], {relativeTo: route});
|
2832 | *
|
2833 | *
|
2834 | * router.createUrlTree(['../../team/44/user/22'], {relativeTo: route});
|
2835 | *
|
2836 | * Note that a value of `null` or `undefined` for `relativeTo` indicates that the
|
2837 | * tree should be created relative to the root.
|
2838 | * ```
|
2839 | */
|
2840 | createUrlTree(commands: any[], navigationExtras?: UrlCreationOptions): UrlTree;
|
2841 | /**
|
2842 | * Navigates to a view using an absolute route path.
|
2843 | *
|
2844 | * @param url An absolute path for a defined route. The function does not apply any delta to the
|
2845 | * current URL.
|
2846 | * @param extras An object containing properties that modify the navigation strategy.
|
2847 | *
|
2848 | * @returns A Promise that resolves to 'true' when navigation succeeds,
|
2849 | * to 'false' when navigation fails, or is rejected on error.
|
2850 | *
|
2851 | * @usageNotes
|
2852 | *
|
2853 | * The following calls request navigation to an absolute path.
|
2854 | *
|
2855 | * ```
|
2856 | * router.navigateByUrl("/team/33/user/11");
|
2857 | *
|
2858 | *
|
2859 | * router.navigateByUrl("/team/33/user/11", { skipLocationChange: true });
|
2860 | * ```
|
2861 | *
|
2862 | * @see [Routing and Navigation guide](guide/router)
|
2863 | *
|
2864 | */
|
2865 | navigateByUrl(url: string | UrlTree, extras?: NavigationBehaviorOptions): Promise<boolean>;
|
2866 | /**
|
2867 | * Navigate based on the provided array of commands and a starting point.
|
2868 | * If no starting route is provided, the navigation is absolute.
|
2869 | *
|
2870 | * @param commands An array of URL fragments with which to construct the target URL.
|
2871 | * If the path is static, can be the literal URL string. For a dynamic path, pass an array of path
|
2872 | * segments, followed by the parameters for each segment.
|
2873 | * The fragments are applied to the current URL or the one provided in the `relativeTo` property
|
2874 | * of the options object, if supplied.
|
2875 | * @param extras An options object that determines how the URL should be constructed or
|
2876 | * interpreted.
|
2877 | *
|
2878 | * @returns A Promise that resolves to `true` when navigation succeeds, to `false` when navigation
|
2879 | * fails,
|
2880 | * or is rejected on error.
|
2881 | *
|
2882 | * @usageNotes
|
2883 | *
|
2884 | * The following calls request navigation to a dynamic route path relative to the current URL.
|
2885 | *
|
2886 | * ```
|
2887 | * router.navigate(['team', 33, 'user', 11], {relativeTo: route});
|
2888 | *
|
2889 | *
|
2890 | * router.navigate(['team', 33, 'user', 11], {relativeTo: route, skipLocationChange: true});
|
2891 | * ```
|
2892 | *
|
2893 | * @see [Routing and Navigation guide](guide/router)
|
2894 | *
|
2895 | */
|
2896 | navigate(commands: any[], extras?: NavigationExtras): Promise<boolean>;
|
2897 | /** Serializes a `UrlTree` into a string */
|
2898 | serializeUrl(url: UrlTree): string;
|
2899 | /** Parses a string into a `UrlTree` */
|
2900 | parseUrl(url: string): UrlTree;
|
2901 | /**
|
2902 | * Returns whether the url is activated.
|
2903 | *
|
2904 | * @deprecated
|
2905 | * Use `IsActiveMatchOptions` instead.
|
2906 | *
|
2907 | * - The equivalent `IsActiveMatchOptions` for `true` is
|
2908 | * `{paths: 'exact', queryParams: 'exact', fragment: 'ignored', matrixParams: 'ignored'}`.
|
2909 | * - The equivalent for `false` is
|
2910 | * `{paths: 'subset', queryParams: 'subset', fragment: 'ignored', matrixParams: 'ignored'}`.
|
2911 | */
|
2912 | isActive(url: string | UrlTree, exact: boolean): boolean;
|
2913 | /**
|
2914 | * Returns whether the url is activated.
|
2915 | */
|
2916 | isActive(url: string | UrlTree, matchOptions: IsActiveMatchOptions): boolean;
|
2917 | private removeEmptyProps;
|
2918 | private resetState;
|
2919 | private resetUrlToCurrentUrlTree;
|
2920 | private generateNgRouterState;
|
2921 | static ɵfac: i0.ɵɵFactoryDeclaration<Router, never>;
|
2922 | static ɵprov: i0.ɵɵInjectableDeclaration<Router>;
|
2923 | }
|
2924 |
|
2925 | /**
|
2926 | * A [DI token](guide/glossary/#di-token) for the router service.
|
2927 | *
|
2928 | * @publicApi
|
2929 | */
|
2930 | export declare const ROUTER_CONFIGURATION: InjectionToken<ExtraOptions>;
|
2931 |
|
2932 | /**
|
2933 | * A [DI token](guide/glossary/#di-token) for the router initializer that
|
2934 | * is called after the app is bootstrapped.
|
2935 | *
|
2936 | * @publicApi
|
2937 | */
|
2938 | export declare const ROUTER_INITIALIZER: InjectionToken<(compRef: ComponentRef<any>) => void>;
|
2939 |
|
2940 | declare class RouterConfigLoader {
|
2941 | private injector;
|
2942 | private compiler;
|
2943 | private componentLoaders;
|
2944 | private childrenLoaders;
|
2945 | onLoadStartListener?: (r: Route) => void;
|
2946 | onLoadEndListener?: (r: Route) => void;
|
2947 | constructor(injector: Injector, compiler: Compiler);
|
2948 | loadComponent(route: Route): Observable<Type<unknown>>;
|
2949 | loadChildren(parentInjector: Injector, route: Route): Observable<LoadedRouterConfig>;
|
2950 | private loadModuleFactoryOrRoutes;
|
2951 | static ɵfac: i0.ɵɵFactoryDeclaration<RouterConfigLoader, never>;
|
2952 | static ɵprov: i0.ɵɵInjectableDeclaration<RouterConfigLoader>;
|
2953 | }
|
2954 |
|
2955 | /**
|
2956 | * Extra configuration options that can be used with the `withRouterConfig` function.
|
2957 | *
|
2958 | * @publicApi
|
2959 | */
|
2960 | export declare interface RouterConfigOptions {
|
2961 | /**
|
2962 | * Configures how the Router attempts to restore state when a navigation is cancelled.
|
2963 | *
|
2964 | * 'replace' - Always uses `location.replaceState` to set the browser state to the state of the
|
2965 | * router before the navigation started. This means that if the URL of the browser is updated
|
2966 | * _before_ the navigation is canceled, the Router will simply replace the item in history rather
|
2967 | * than trying to restore to the previous location in the session history. This happens most
|
2968 | * frequently with `urlUpdateStrategy: 'eager'` and navigations with the browser back/forward
|
2969 | * buttons.
|
2970 | *
|
2971 | * 'computed' - Will attempt to return to the same index in the session history that corresponds
|
2972 | * to the Angular route when the navigation gets cancelled. For example, if the browser back
|
2973 | * button is clicked and the navigation is cancelled, the Router will trigger a forward navigation
|
2974 | * and vice versa.
|
2975 | *
|
2976 | * Note: the 'computed' option is incompatible with any `UrlHandlingStrategy` which only
|
2977 | * handles a portion of the URL because the history restoration navigates to the previous place in
|
2978 | * the browser history rather than simply resetting a portion of the URL.
|
2979 | *
|
2980 | * The default value is `replace` when not set.
|
2981 | */
|
2982 | canceledNavigationResolution?: 'replace' | 'computed';
|
2983 | /**
|
2984 | * Configures the default for handling a navigation request to the current URL.
|
2985 | *
|
2986 | * If unset, the `Router` will use `'ignore'`.
|
2987 | *
|
2988 | * @see `OnSameUrlNavigation`
|
2989 | */
|
2990 | onSameUrlNavigation?: OnSameUrlNavigation;
|
2991 | /**
|
2992 | * Defines how the router merges parameters, data, and resolved data from parent to child
|
2993 | * routes. By default ('emptyOnly'), inherits parent parameters only for
|
2994 | * path-less or component-less routes.
|
2995 | *
|
2996 | * Set to 'always' to enable unconditional inheritance of parent parameters.
|
2997 | *
|
2998 | * Note that when dealing with matrix parameters, "parent" refers to the parent `Route`
|
2999 | * config which does not necessarily mean the "URL segment to the left". When the `Route` `path`
|
3000 | * contains multiple segments, the matrix parameters must appear on the last segment. For example,
|
3001 | * matrix parameters for `{path: 'a/b', component: MyComp}` should appear as `a/b;foo=bar` and not
|
3002 | * `a;foo=bar/b`.
|
3003 | *
|
3004 | */
|
3005 | paramsInheritanceStrategy?: 'emptyOnly' | 'always';
|
3006 | /**
|
3007 | * Defines when the router updates the browser URL. By default ('deferred'),
|
3008 | * update after successful navigation.
|
3009 | * Set to 'eager' if prefer to update the URL at the beginning of navigation.
|
3010 | * Updating the URL early allows you to handle a failure of navigation by
|
3011 | * showing an error message with the URL that failed.
|
3012 | */
|
3013 | urlUpdateStrategy?: 'deferred' | 'eager';
|
3014 | }
|
3015 |
|
3016 | /**
|
3017 | * A type alias for providers returned by `withRouterConfig` for use with `provideRouter`.
|
3018 | *
|
3019 | * @see `withRouterConfig`
|
3020 | * @see `provideRouter`
|
3021 | *
|
3022 | * @publicApi
|
3023 | */
|
3024 | export declare type RouterConfigurationFeature = RouterFeature<RouterFeatureKind.RouterConfigurationFeature>;
|
3025 |
|
3026 | /**
|
3027 | * @description
|
3028 | *
|
3029 | * Provides a way to customize when activated routes get reused.
|
3030 | *
|
3031 | * @publicApi
|
3032 | */
|
3033 | export declare abstract class RouteReuseStrategy {
|
3034 | /** Determines if this route (and its subtree) should be detached to be reused later */
|
3035 | abstract shouldDetach(route: ActivatedRouteSnapshot): boolean;
|
3036 | /**
|
3037 | * Stores the detached route.
|
3038 | *
|
3039 | * Storing a `null` value should erase the previously stored value.
|
3040 | */
|
3041 | abstract store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle | null): void;
|
3042 | /** Determines if this route (and its subtree) should be reattached */
|
3043 | abstract shouldAttach(route: ActivatedRouteSnapshot): boolean;
|
3044 | /** Retrieves the previously stored route */
|
3045 | abstract retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null;
|
3046 | /** Determines if a route should be reused */
|
3047 | abstract shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;
|
3048 | static ɵfac: i0.ɵɵFactoryDeclaration<RouteReuseStrategy, never>;
|
3049 | static ɵprov: i0.ɵɵInjectableDeclaration<RouteReuseStrategy>;
|
3050 | }
|
3051 |
|
3052 | /**
|
3053 | * Base for events the router goes through, as opposed to events tied to a specific
|
3054 | * route. Fired one time for any given navigation.
|
3055 | *
|
3056 | * The following code shows how a class subscribes to router events.
|
3057 | *
|
3058 | * ```ts
|
3059 | * import {Event, RouterEvent, Router} from '@angular/router';
|
3060 | *
|
3061 | * class MyService {
|
3062 | * constructor(public router: Router) {
|
3063 | * router.events.pipe(
|
3064 | * filter((e: Event): e is RouterEvent => e instanceof RouterEvent)
|
3065 | * ).subscribe((e: RouterEvent) => {
|
3066 | *
|
3067 | * });
|
3068 | * }
|
3069 | * }
|
3070 | * ```
|
3071 | *
|
3072 | * @see `Event`
|
3073 | * @see [Router events summary](guide/router-reference#router-events)
|
3074 | * @publicApi
|
3075 | */
|
3076 | export declare class RouterEvent {
|
3077 | /** A unique ID that the router assigns to every router navigation. */
|
3078 | id: number;
|
3079 | /** The URL that is the destination for this navigation. */
|
3080 | url: string;
|
3081 | constructor(
|
3082 | /** A unique ID that the router assigns to every router navigation. */
|
3083 | id: number,
|
3084 | /** The URL that is the destination for this navigation. */
|
3085 | url: string);
|
3086 | }
|
3087 |
|
3088 | /**
|
3089 | * Helper type to represent a Router feature.
|
3090 | *
|
3091 | * @publicApi
|
3092 | */
|
3093 | export declare interface RouterFeature<FeatureKind extends RouterFeatureKind> {
|
3094 | ɵkind: FeatureKind;
|
3095 | ɵproviders: Provider[];
|
3096 | }
|
3097 |
|
3098 | /**
|
3099 | * The list of features as an enum to uniquely type each feature.
|
3100 | */
|
3101 | declare const enum RouterFeatureKind {
|
3102 | PreloadingFeature = 0,
|
3103 | DebugTracingFeature = 1,
|
3104 | EnabledBlockingInitialNavigationFeature = 2,
|
3105 | DisabledInitialNavigationFeature = 3,
|
3106 | InMemoryScrollingFeature = 4,
|
3107 | RouterConfigurationFeature = 5,
|
3108 | RouterHashLocationFeature = 6,
|
3109 | NavigationErrorHandlerFeature = 7
|
3110 | }
|
3111 |
|
3112 | /**
|
3113 | * A type alias that represents all Router features available for use with `provideRouter`.
|
3114 | * Features can be enabled by adding special functions to the `provideRouter` call.
|
3115 | * See documentation for each symbol to find corresponding function name. See also `provideRouter`
|
3116 | * documentation on how to use those functions.
|
3117 | *
|
3118 | * @see `provideRouter`
|
3119 | *
|
3120 | * @publicApi
|
3121 | */
|
3122 | export declare type RouterFeatures = PreloadingFeature | DebugTracingFeature | InitialNavigationFeature | InMemoryScrollingFeature | RouterConfigurationFeature | NavigationErrorHandlerFeature;
|
3123 |
|
3124 | /**
|
3125 | * A type alias for providers returned by `withHashLocation` for use with `provideRouter`.
|
3126 | *
|
3127 | * @see `withHashLocation`
|
3128 | * @see `provideRouter`
|
3129 | *
|
3130 | * @publicApi
|
3131 | */
|
3132 | export declare type RouterHashLocationFeature = RouterFeature<RouterFeatureKind.RouterHashLocationFeature>;
|
3133 |
|
3134 | /**
|
3135 | * @description
|
3136 | *
|
3137 | * When applied to an element in a template, makes that element a link
|
3138 | * that initiates navigation to a route. Navigation opens one or more routed components
|
3139 | * in one or more `<router-outlet>` locations on the page.
|
3140 | *
|
3141 | * Given a route configuration `[{ path: 'user/:name', component: UserCmp }]`,
|
3142 | * the following creates a static link to the route:
|
3143 | * `<a routerLink="/user/bob">link to user component</a>`
|
3144 | *
|
3145 | * You can use dynamic values to generate the link.
|
3146 | * For a dynamic link, pass an array of path segments,
|
3147 | * followed by the params for each segment.
|
3148 | * For example, `['/team', teamId, 'user', userName, {details: true}]`
|
3149 | * generates a link to `/team/11/user/bob;details=true`.
|
3150 | *
|
3151 | * Multiple static segments can be merged into one term and combined with dynamic segments.
|
3152 | * For example, `['/team/11/user', userName, {details: true}]`
|
3153 | *
|
3154 | * The input that you provide to the link is treated as a delta to the current URL.
|
3155 | * For instance, suppose the current URL is `/user/(box//aux:team)`.
|
3156 | * The link `<a [routerLink]="['/user/jim']">Jim</a>` creates the URL
|
3157 | * `/user/(jim//aux:team)`.
|
3158 | * See {@link Router#createUrlTree createUrlTree} for more information.
|
3159 | *
|
3160 | * @usageNotes
|
3161 | *
|
3162 | * You can use absolute or relative paths in a link, set query parameters,
|
3163 | * control how parameters are handled, and keep a history of navigation states.
|
3164 | *
|
3165 | * ### Relative link paths
|
3166 | *
|
3167 | * The first segment name can be prepended with `/`, `./`, or `../`.
|
3168 | * * If the first segment begins with `/`, the router looks up the route from the root of the
|
3169 | * app.
|
3170 | * * If the first segment begins with `./`, or doesn't begin with a slash, the router
|
3171 | * looks in the children of the current activated route.
|
3172 | * * If the first segment begins with `../`, the router goes up one level in the route tree.
|
3173 | *
|
3174 | * ### Setting and handling query params and fragments
|
3175 | *
|
3176 | * The following link adds a query parameter and a fragment to the generated URL:
|
3177 | *
|
3178 | * ```
|
3179 | * <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" fragment="education">
|
3180 | * link to user component
|
3181 | * </a>
|
3182 | * ```
|
3183 | * By default, the directive constructs the new URL using the given query parameters.
|
3184 | * The example generates the link: `/user/bob?debug=true#education`.
|
3185 | *
|
3186 | * You can instruct the directive to handle query parameters differently
|
3187 | * by specifying the `queryParamsHandling` option in the link.
|
3188 | * Allowed values are:
|
3189 | *
|
3190 | * - `'merge'`: Merge the given `queryParams` into the current query params.
|
3191 | * - `'preserve'`: Preserve the current query params.
|
3192 | *
|
3193 | * For example:
|
3194 | *
|
3195 | * ```
|
3196 | * <a [routerLink]="['/user/bob']" [queryParams]="{debug: true}" queryParamsHandling="merge">
|
3197 | * link to user component
|
3198 | * </a>
|
3199 | * ```
|
3200 | *
|
3201 | * See {@link UrlCreationOptions.queryParamsHandling UrlCreationOptions#queryParamsHandling}.
|
3202 | *
|
3203 | * ### Preserving navigation history
|
3204 | *
|
3205 | * You can provide a `state` value to be persisted to the browser's
|
3206 | * [`History.state` property](https:
|
3207 | * For example:
|
3208 | *
|
3209 | * ```
|
3210 | * <a [routerLink]="['/user/bob']" [state]="{tracingId: 123}">
|
3211 | * link to user component
|
3212 | * </a>
|
3213 | * ```
|
3214 | *
|
3215 | * Use {@link Router.getCurrentNavigation() Router#getCurrentNavigation} to retrieve a saved
|
3216 | * navigation-state value. For example, to capture the `tracingId` during the `NavigationStart`
|
3217 | * event:
|
3218 | *
|
3219 | * ```
|
3220 | * // Get NavigationStart events
|
3221 | * router.events.pipe(filter(e => e instanceof NavigationStart)).subscribe(e => {
|
3222 | * const navigation = router.getCurrentNavigation();
|
3223 | * tracingService.trace({id: navigation.extras.state.tracingId});
|
3224 | * });
|
3225 | * ```
|
3226 | *
|
3227 | * @ngModule RouterModule
|
3228 | *
|
3229 | * @publicApi
|
3230 | */
|
3231 | declare class RouterLink implements OnChanges, OnDestroy {
|
3232 | private router;
|
3233 | private route;
|
3234 | private readonly tabIndexAttribute;
|
3235 | private readonly renderer;
|
3236 | private readonly el;
|
3237 | private locationStrategy?;
|
3238 | private _preserveFragment;
|
3239 | private _skipLocationChange;
|
3240 | private _replaceUrl;
|
3241 | |
3242 |
|
3243 |
|
3244 |
|
3245 | href: string | null;
|
3246 | |
3247 |
|
3248 |
|
3249 |
|
3250 | target?: string;
|
3251 | |
3252 |
|
3253 |
|
3254 |
|
3255 |
|
3256 |
|
3257 | queryParams?: Params | null;
|
3258 | |
3259 |
|
3260 |
|
3261 |
|
3262 |
|
3263 |
|
3264 | fragment?: string;
|
3265 | |
3266 |
|
3267 |
|
3268 |
|
3269 |
|
3270 |
|
3271 | queryParamsHandling?: QueryParamsHandling | null;
|
3272 | |
3273 |
|
3274 |
|
3275 |
|
3276 |
|
3277 |
|
3278 | state?: {
|
3279 | [k: string]: any;
|
3280 | };
|
3281 | |
3282 |
|
3283 |
|
3284 |
|
3285 |
|
3286 |
|
3287 |
|
3288 |
|
3289 |
|
3290 | relativeTo?: ActivatedRoute | null;
|
3291 | private commands;
|
3292 |
|
3293 | private isAnchorElement;
|
3294 | private subscription?;
|
3295 | constructor(router: Router, route: ActivatedRoute, tabIndexAttribute: string | null | undefined, renderer: Renderer2, el: ElementRef, locationStrategy?: LocationStrategy | undefined);
|
3296 | /**
|
3297 | * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
|
3298 | * `UrlCreationOptions`.
|
3299 | * @see {@link UrlCreationOptions#preserveFragment UrlCreationOptions#preserveFragment}
|
3300 | * @see {@link Router#createUrlTree Router#createUrlTree}
|
3301 | */
|
3302 | set preserveFragment(preserveFragment: boolean | string | null | undefined);
|
3303 | get preserveFragment(): boolean;
|
3304 | |
3305 |
|
3306 |
|
3307 |
|
3308 |
|
3309 |
|
3310 | set skipLocationChange(skipLocationChange: boolean | string | null | undefined);
|
3311 | get skipLocationChange(): boolean;
|
3312 | |
3313 |
|
3314 |
|
3315 |
|
3316 |
|
3317 |
|
3318 | set replaceUrl(replaceUrl: boolean | string | null | undefined);
|
3319 | get replaceUrl(): boolean;
|
3320 | |
3321 |
|
3322 |
|
3323 |
|
3324 | private setTabIndexIfNotOnNativeEl;
|
3325 |
|
3326 | ngOnChanges(changes: SimpleChanges): void;
|
3327 | |
3328 |
|
3329 |
|
3330 |
|
3331 |
|
3332 |
|
3333 |
|
3334 | set routerLink(commands: any[] | string | null | undefined);
|
3335 |
|
3336 | onClick(button: number, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
|
3337 |
|
3338 | ngOnDestroy(): any;
|
3339 | private updateHref;
|
3340 | private applyAttributeValue;
|
3341 | get urlTree(): UrlTree | null;
|
3342 | static ɵfac: i0.ɵɵFactoryDeclaration<RouterLink, [null, null, { attribute: "tabindex"; }, null, null, null]>;
|
3343 | static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLink, "[routerLink]", never, { "target": "target"; "queryParams": "queryParams"; "fragment": "fragment"; "queryParamsHandling": "queryParamsHandling"; "state": "state"; "relativeTo": "relativeTo"; "preserveFragment": "preserveFragment"; "skipLocationChange": "skipLocationChange"; "replaceUrl": "replaceUrl"; "routerLink": "routerLink"; }, {}, never, never, true, never>;
|
3344 | }
|
3345 | export { RouterLink }
|
3346 | export { RouterLink as RouterLinkWithHref }
|
3347 |
|
3348 |
|
3349 |
|
3350 |
|
3351 |
|
3352 |
|
3353 |
|
3354 |
|
3355 |
|
3356 |
|
3357 |
|
3358 |
|
3359 |
|
3360 |
|
3361 |
|
3362 |
|
3363 |
|
3364 |
|
3365 |
|
3366 |
|
3367 |
|
3368 |
|
3369 |
|
3370 |
|
3371 |
|
3372 |
|
3373 |
|
3374 |
|
3375 |
|
3376 |
|
3377 |
|
3378 |
|
3379 |
|
3380 |
|
3381 |
|
3382 |
|
3383 |
|
3384 |
|
3385 |
|
3386 |
|
3387 |
|
3388 |
|
3389 |
|
3390 |
|
3391 |
|
3392 |
|
3393 |
|
3394 |
|
3395 |
|
3396 |
|
3397 |
|
3398 |
|
3399 |
|
3400 |
|
3401 |
|
3402 |
|
3403 |
|
3404 |
|
3405 |
|
3406 |
|
3407 |
|
3408 |
|
3409 |
|
3410 |
|
3411 |
|
3412 |
|
3413 |
|
3414 |
|
3415 |
|
3416 |
|
3417 | export declare class RouterLinkActive implements OnChanges, OnDestroy, AfterContentInit {
|
3418 | private router;
|
3419 | private element;
|
3420 | private renderer;
|
3421 | private readonly cdr;
|
3422 | private link?;
|
3423 | links: QueryList<RouterLink>;
|
3424 | private classes;
|
3425 | private routerEventsSubscription;
|
3426 | private linkInputChangesSubscription?;
|
3427 | private _isActive;
|
3428 | get isActive(): boolean;
|
3429 | |
3430 |
|
3431 |
|
3432 |
|
3433 |
|
3434 |
|
3435 |
|
3436 | routerLinkActiveOptions: {
|
3437 | exact: boolean;
|
3438 | } | IsActiveMatchOptions;
|
3439 | |
3440 |
|
3441 |
|
3442 |
|
3443 |
|
3444 |
|
3445 |
|
3446 | ariaCurrentWhenActive?: 'page' | 'step' | 'location' | 'date' | 'time' | true | false;
|
3447 | |
3448 |
|
3449 |
|
3450 |
|
3451 |
|
3452 |
|
3453 |
|
3454 |
|
3455 |
|
3456 |
|
3457 |
|
3458 |
|
3459 |
|
3460 |
|
3461 |
|
3462 |
|
3463 | readonly isActiveChange: EventEmitter<boolean>;
|
3464 | constructor(router: Router, element: ElementRef, renderer: Renderer2, cdr: ChangeDetectorRef, link?: RouterLink | undefined);
|
3465 | /** @nodoc */
|
3466 | ngAfterContentInit(): void;
|
3467 | private subscribeToEachLinkOnChanges;
|
3468 | set routerLinkActive(data: string[] | string);
|
3469 | /** @nodoc */
|
3470 | ngOnChanges(changes: SimpleChanges): void;
|
3471 | /** @nodoc */
|
3472 | ngOnDestroy(): void;
|
3473 | private update;
|
3474 | private isLinkActive;
|
3475 | private hasActiveLinks;
|
3476 | static ɵfac: i0.ɵɵFactoryDeclaration<RouterLinkActive, [null, null, null, null, { optional: true; }]>;
|
3477 | static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLinkActive, "[routerLinkActive]", ["routerLinkActive"], { "routerLinkActiveOptions": "routerLinkActiveOptions"; "ariaCurrentWhenActive": "ariaCurrentWhenActive"; "routerLinkActive": "routerLinkActive"; }, { "isActiveChange": "isActiveChange"; }, ["links"], never, true, never>;
|
3478 | }
|
3479 |
|
3480 |
|
3481 |
|
3482 |
|
3483 |
|
3484 |
|
3485 |
|
3486 |
|
3487 |
|
3488 |
|
3489 |
|
3490 |
|
3491 |
|
3492 |
|
3493 |
|
3494 |
|
3495 |
|
3496 |
|
3497 |
|
3498 |
|
3499 |
|
3500 |
|
3501 | export declare class RouterModule {
|
3502 | constructor(guard: any);
|
3503 | /**
|
3504 | * Creates and configures a module with all the router providers and directives.
|
3505 | * Optionally sets up an application listener to perform an initial navigation.
|
3506 | *
|
3507 | * When registering the NgModule at the root, import as follows:
|
3508 | *
|
3509 | * ```
|
3510 | * @NgModule({
|
3511 | * imports: [RouterModule.forRoot(ROUTES)]
|
3512 | * })
|
3513 | * class MyNgModule {}
|
3514 | * ```
|
3515 | *
|
3516 | * @param routes An array of `Route` objects that define the navigation paths for the application.
|
3517 | * @param config An `ExtraOptions` configuration object that controls how navigation is performed.
|
3518 | * @return The new `NgModule`.
|
3519 | *
|
3520 | */
|
3521 | static forRoot(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterModule>;
|
3522 | /**
|
3523 | * Creates a module with all the router directives and a provider registering routes,
|
3524 | * without creating a new Router service.
|
3525 | * When registering for submodules and lazy-loaded submodules, create the NgModule as follows:
|
3526 | *
|
3527 | * ```
|
3528 | * @NgModule({
|
3529 | * imports: [RouterModule.forChild(ROUTES)]
|
3530 | * })
|
3531 | * class MyNgModule {}
|
3532 | * ```
|
3533 | *
|
3534 | * @param routes An array of `Route` objects that define the navigation paths for the submodule.
|
3535 | * @return The new NgModule.
|
3536 | *
|
3537 | */
|
3538 | static forChild(routes: Routes): ModuleWithProviders<RouterModule>;
|
3539 | static ɵfac: i0.ɵɵFactoryDeclaration<RouterModule, [{ optional: true; }]>;
|
3540 | static ɵmod: i0.ɵɵNgModuleDeclaration<RouterModule, never, [typeof i1.RouterOutlet, typeof i2.RouterLink, typeof i3.RouterLinkActive, typeof i4.ɵEmptyOutletComponent], [typeof i1.RouterOutlet, typeof i2.RouterLink, typeof i3.RouterLinkActive, typeof i4.ɵEmptyOutletComponent]>;
|
3541 | static ɵinj: i0.ɵɵInjectorDeclaration<RouterModule>;
|
3542 | }
|
3543 |
|
3544 | /**
|
3545 | * @description
|
3546 | *
|
3547 | * Acts as a placeholder that Angular dynamically fills based on the current router state.
|
3548 | *
|
3549 | * Each outlet can have a unique name, determined by the optional `name` attribute.
|
3550 | * The name cannot be set or changed dynamically. If not set, default value is "primary".
|
3551 | *
|
3552 | * ```
|
3553 | * <router-outlet></router-outlet>
|
3554 | * <router-outlet name='left'></router-outlet>
|
3555 | * <router-outlet name='right'></router-outlet>
|
3556 | * ```
|
3557 | *
|
3558 | * Named outlets can be the targets of secondary routes.
|
3559 | * The `Route` object for a secondary route has an `outlet` property to identify the target outlet:
|
3560 | *
|
3561 | * `{path: <base-path>, component: <component>, outlet: <target_outlet_name>}`
|
3562 | *
|
3563 | * Using named outlets and secondary routes, you can target multiple outlets in
|
3564 | * the same `RouterLink` directive.
|
3565 | *
|
3566 | * The router keeps track of separate branches in a navigation tree for each named outlet and
|
3567 | * generates a representation of that tree in the URL.
|
3568 | * The URL for a secondary route uses the following syntax to specify both the primary and secondary
|
3569 | * routes at the same time:
|
3570 | *
|
3571 | * `http:
|
3572 | *
|
3573 | * A router outlet emits an activate event when a new component is instantiated,
|
3574 | * deactivate event when a component is destroyed.
|
3575 | * An attached event emits when the `RouteReuseStrategy` instructs the outlet to reattach the
|
3576 | * subtree, and the detached event emits when the `RouteReuseStrategy` instructs the outlet to
|
3577 | * detach the subtree.
|
3578 | *
|
3579 | * ```
|
3580 | * <router-outlet
|
3581 | * (activate)='onActivate($event)'
|
3582 | * (deactivate)='onDeactivate($event)'
|
3583 | * (attach)='onAttach($event)'
|
3584 | * (detach)='onDetach($event)'></router-outlet>
|
3585 | * ```
|
3586 | *
|
3587 | * @see [Routing tutorial](guide/router-tutorial-toh#named-outlets "Example of a named
|
3588 | * outlet and secondary route configuration").
|
3589 | * @see `RouterLink`
|
3590 | * @see `Route`
|
3591 | * @ngModule RouterModule
|
3592 | *
|
3593 | * @publicApi
|
3594 | */
|
3595 | export declare class RouterOutlet implements OnDestroy, OnInit, RouterOutletContract {
|
3596 | private activated;
|
3597 | private _activatedRoute;
|
3598 | |
3599 |
|
3600 |
|
3601 |
|
3602 |
|
3603 | name: string;
|
3604 | activateEvents: EventEmitter<any>;
|
3605 | deactivateEvents: EventEmitter<any>;
|
3606 | |
3607 |
|
3608 |
|
3609 |
|
3610 | attachEvents: EventEmitter<unknown>;
|
3611 | |
3612 |
|
3613 |
|
3614 |
|
3615 | detachEvents: EventEmitter<unknown>;
|
3616 | private parentContexts;
|
3617 | private location;
|
3618 | private changeDetector;
|
3619 | private environmentInjector;
|
3620 |
|
3621 | ngOnChanges(changes: SimpleChanges): void;
|
3622 |
|
3623 | ngOnDestroy(): void;
|
3624 | private isTrackedInParentContexts;
|
3625 |
|
3626 | ngOnInit(): void;
|
3627 | private initializeOutletWithName;
|
3628 | get isActivated(): boolean;
|
3629 | |
3630 |
|
3631 |
|
3632 |
|
3633 | get component(): Object;
|
3634 | get activatedRoute(): ActivatedRoute;
|
3635 | get activatedRouteData(): Data;
|
3636 | |
3637 |
|
3638 |
|
3639 | detach(): ComponentRef<any>;
|
3640 | |
3641 |
|
3642 |
|
3643 | attach(ref: ComponentRef<any>, activatedRoute: ActivatedRoute): void;
|
3644 | deactivate(): void;
|
3645 | activateWith(activatedRoute: ActivatedRoute, resolverOrInjector?: ComponentFactoryResolver | EnvironmentInjector | null): void;
|
3646 | static ɵfac: i0.ɵɵFactoryDeclaration<RouterOutlet, never>;
|
3647 | static ɵdir: i0.ɵɵDirectiveDeclaration<RouterOutlet, "router-outlet", ["outlet"], { "name": "name"; }, { "activateEvents": "activate"; "deactivateEvents": "deactivate"; "attachEvents": "attach"; "detachEvents": "detach"; }, never, never, true, never>;
|
3648 | }
|
3649 |
|
3650 |
|
3651 |
|
3652 |
|
3653 |
|
3654 |
|
3655 |
|
3656 |
|
3657 |
|
3658 |
|
3659 |
|
3660 |
|
3661 |
|
3662 |
|
3663 | export declare interface RouterOutletContract {
|
3664 | |
3665 |
|
3666 |
|
3667 |
|
3668 |
|
3669 | isActivated: boolean;
|
3670 |
|
3671 | component: Object | null;
|
3672 | |
3673 |
|
3674 |
|
3675 | activatedRouteData: Data;
|
3676 | |
3677 |
|
3678 |
|
3679 | activatedRoute: ActivatedRoute | null;
|
3680 | |
3681 |
|
3682 |
|
3683 | activateWith(activatedRoute: ActivatedRoute, environmentInjector: EnvironmentInjector | null): void;
|
3684 | |
3685 |
|
3686 |
|
3687 |
|
3688 |
|
3689 |
|
3690 | activateWith(activatedRoute: ActivatedRoute, resolver: ComponentFactoryResolver | null): void;
|
3691 | |
3692 |
|
3693 |
|
3694 |
|
3695 |
|
3696 |
|
3697 | deactivate(): void;
|
3698 | |
3699 |
|
3700 |
|
3701 |
|
3702 |
|
3703 |
|
3704 | detach(): ComponentRef<unknown>;
|
3705 | |
3706 |
|
3707 |
|
3708 | attach(ref: ComponentRef<unknown>, activatedRoute: ActivatedRoute): void;
|
3709 | |
3710 |
|
3711 |
|
3712 | activateEvents?: EventEmitter<unknown>;
|
3713 | |
3714 |
|
3715 |
|
3716 | deactivateEvents?: EventEmitter<unknown>;
|
3717 | |
3718 |
|
3719 |
|
3720 |
|
3721 | attachEvents?: EventEmitter<unknown>;
|
3722 | |
3723 |
|
3724 |
|
3725 |
|
3726 | detachEvents?: EventEmitter<unknown>;
|
3727 | }
|
3728 |
|
3729 |
|
3730 |
|
3731 |
|
3732 |
|
3733 |
|
3734 |
|
3735 |
|
3736 |
|
3737 |
|
3738 |
|
3739 |
|
3740 |
|
3741 | export declare class RouterPreloader implements OnDestroy {
|
3742 | private router;
|
3743 | private injector;
|
3744 | private preloadingStrategy;
|
3745 | private loader;
|
3746 | private subscription?;
|
3747 | constructor(router: Router, compiler: Compiler, injector: EnvironmentInjector, preloadingStrategy: PreloadingStrategy, loader: RouterConfigLoader);
|
3748 | setUpPreloading(): void;
|
3749 | preload(): Observable<any>;
|
3750 | /** @nodoc */
|
3751 | ngOnDestroy(): void;
|
3752 | private processRoutes;
|
3753 | private preloadConfig;
|
3754 | static ɵfac: i0.ɵɵFactoryDeclaration<RouterPreloader, never>;
|
3755 | static ɵprov: i0.ɵɵInjectableDeclaration<RouterPreloader>;
|
3756 | }
|
3757 |
|
3758 | /**
|
3759 | * Represents the state of the router as a tree of activated routes.
|
3760 | *
|
3761 | * @usageNotes
|
3762 | *
|
3763 | * Every node in the route tree is an `ActivatedRoute` instance
|
3764 | * that knows about the "consumed" URL segments, the extracted parameters,
|
3765 | * and the resolved data.
|
3766 | * Use the `ActivatedRoute` properties to traverse the tree from any node.
|
3767 | *
|
3768 | * The following fragment shows how a component gets the root node
|
3769 | * of the current state to establish its own route tree:
|
3770 | *
|
3771 | * ```
|
3772 | * @Component({templateUrl:'template.html'})
|
3773 | * class MyComponent {
|
3774 | * constructor(router: Router) {
|
3775 | * const state: RouterState = router.routerState;
|
3776 | * const root: ActivatedRoute = state.root;
|
3777 | * const child = root.firstChild;
|
3778 | * const id: Observable<string> = child.params.map(p => p.id);
|
3779 | *
|
3780 | * }
|
3781 | * }
|
3782 | * ```
|
3783 | *
|
3784 | * @see `ActivatedRoute`
|
3785 | * @see [Getting route information](guide/router#getting-route-information)
|
3786 | *
|
3787 | * @publicApi
|
3788 | */
|
3789 | export declare class RouterState extends Tree<ActivatedRoute> {
|
3790 | /** The current snapshot of the router state */
|
3791 | snapshot: RouterStateSnapshot;
|
3792 | toString(): string;
|
3793 | }
|
3794 |
|
3795 | /**
|
3796 | * @description
|
3797 | *
|
3798 | * Represents the state of the router at a moment in time.
|
3799 | *
|
3800 | * This is a tree of activated route snapshots. Every node in this tree knows about
|
3801 | * the "consumed" URL segments, the extracted parameters, and the resolved data.
|
3802 | *
|
3803 | * The following example shows how a component is initialized with information
|
3804 | * from the snapshot of the root node's state at the time of creation.
|
3805 | *
|
3806 | * ```
|
3807 | * @Component({templateUrl:'template.html'})
|
3808 | * class MyComponent {
|
3809 | * constructor(router: Router) {
|
3810 | * const state: RouterState = router.routerState;
|
3811 | * const snapshot: RouterStateSnapshot = state.snapshot;
|
3812 | * const root: ActivatedRouteSnapshot = snapshot.root;
|
3813 | * const child = root.firstChild;
|
3814 | * const id: Observable<string> = child.params.map(p => p.id);
|
3815 | *
|
3816 | * }
|
3817 | * }
|
3818 | * ```
|
3819 | *
|
3820 | * @publicApi
|
3821 | */
|
3822 | export declare class RouterStateSnapshot extends Tree<ActivatedRouteSnapshot> {
|
3823 | /** The url from which this snapshot was created */
|
3824 | url: string;
|
3825 | toString(): string;
|
3826 | }
|
3827 |
|
3828 | /**
|
3829 | * The [DI token](guide/glossary/#di-token) for a router configuration.
|
3830 | *
|
3831 | * `ROUTES` is a low level API for router configuration via dependency injection.
|
3832 | *
|
3833 | * We recommend that in almost all cases to use higher level APIs such as `RouterModule.forRoot()`,
|
3834 | * `provideRouter`, or `Router.resetConfig()`.
|
3835 | *
|
3836 | * @publicApi
|
3837 | */
|
3838 | export declare const ROUTES: InjectionToken<Route[][]>;
|
3839 |
|
3840 | /**
|
3841 | * Represents a route configuration for the Router service.
|
3842 | * An array of `Route` objects, used in `Router.config` and for nested route configurations
|
3843 | * in `Route.children`.
|
3844 | *
|
3845 | * @see `Route`
|
3846 | * @see `Router`
|
3847 | * @see [Router configuration guide](guide/router-reference#configuration)
|
3848 | * @publicApi
|
3849 | */
|
3850 | export declare type Routes = Route[];
|
3851 |
|
3852 | /**
|
3853 | * An event triggered when routes are recognized.
|
3854 | *
|
3855 | * @publicApi
|
3856 | */
|
3857 | export declare class RoutesRecognized extends RouterEvent {
|
3858 | /** @docsNotRequired */
|
3859 | urlAfterRedirects: string;
|
3860 | /** @docsNotRequired */
|
3861 | state: RouterStateSnapshot;
|
3862 | readonly type = EventType.RoutesRecognized;
|
3863 | constructor(
|
3864 | /** @docsNotRequired */
|
3865 | id: number,
|
3866 | /** @docsNotRequired */
|
3867 | url: string,
|
3868 | /** @docsNotRequired */
|
3869 | urlAfterRedirects: string,
|
3870 | /** @docsNotRequired */
|
3871 | state: RouterStateSnapshot);
|
3872 | /** @docsNotRequired */
|
3873 | toString(): string;
|
3874 | }
|
3875 |
|
3876 | /**
|
3877 | * A policy for when to run guards and resolvers on a route.
|
3878 | *
|
3879 | * Guards and/or resolvers will always run when a route is activated or deactivated. When a route is
|
3880 | * unchanged, the default behavior is the same as `paramsChange`.
|
3881 | *
|
3882 | * `paramsChange` : Rerun the guards and resolvers when path or
|
3883 | * path param changes. This does not include query parameters. This option is the default.
|
3884 | * - `always` : Run on every execution.
|
3885 | * - `pathParamsChange` : Rerun guards and resolvers when the path params
|
3886 | * change. This does not compare matrix or query parameters.
|
3887 | * - `paramsOrQueryParamsChange` : Run when path, matrix, or query parameters change.
|
3888 | * - `pathParamsOrQueryParamsChange` : Rerun guards and resolvers when the path params
|
3889 | * change or query params have changed. This does not include matrix parameters.
|
3890 | *
|
3891 | * @see [Route.runGuardsAndResolvers](api/router/Route#runGuardsAndResolvers)
|
3892 | * @publicApi
|
3893 | */
|
3894 | export declare type RunGuardsAndResolvers = 'pathParamsChange' | 'pathParamsOrQueryParamsChange' | 'paramsChange' | 'paramsOrQueryParamsChange' | 'always' | ((from: ActivatedRouteSnapshot, to: ActivatedRouteSnapshot) => boolean);
|
3895 |
|
3896 | /**
|
3897 | * An event triggered by scrolling.
|
3898 | *
|
3899 | * @publicApi
|
3900 | */
|
3901 | export declare class Scroll {
|
3902 | /** @docsNotRequired */
|
3903 | readonly routerEvent: NavigationEnd;
|
3904 | /** @docsNotRequired */
|
3905 | readonly position: [number, number] | null;
|
3906 | /** @docsNotRequired */
|
3907 | readonly anchor: string | null;
|
3908 | readonly type = EventType.Scroll;
|
3909 | constructor(
|
3910 | /** @docsNotRequired */
|
3911 | routerEvent: NavigationEnd,
|
3912 | /** @docsNotRequired */
|
3913 | position: [number, number] | null,
|
3914 | /** @docsNotRequired */
|
3915 | anchor: string | null);
|
3916 | toString(): string;
|
3917 | }
|
3918 |
|
3919 | /**
|
3920 | * Provides a strategy for setting the page title after a router navigation.
|
3921 | *
|
3922 | * The built-in implementation traverses the router state snapshot and finds the deepest primary
|
3923 | * outlet with `title` property. Given the `Routes` below, navigating to
|
3924 | * `/base/child(popup:aux)` would result in the document title being set to "child".
|
3925 | * ```
|
3926 | * [
|
3927 | * {path: 'base', title: 'base', children: [
|
3928 | * {path: 'child', title: 'child'},
|
3929 | * ],
|
3930 | * {path: 'aux', outlet: 'popup', title: 'popupTitle'}
|
3931 | * ]
|
3932 | * ```
|
3933 | *
|
3934 | * This class can be used as a base class for custom title strategies. That is, you can create your
|
3935 | * own class that extends the `TitleStrategy`. Note that in the above example, the `title`
|
3936 | * from the named outlet is never used. However, a custom strategy might be implemented to
|
3937 | * incorporate titles in named outlets.
|
3938 | *
|
3939 | * @publicApi
|
3940 | * @see [Page title guide](guide/router#setting-the-page-title)
|
3941 | */
|
3942 | export declare abstract class TitleStrategy {
|
3943 | /** Performs the application title update. */
|
3944 | abstract updateTitle(snapshot: RouterStateSnapshot): void;
|
3945 | /**
|
3946 | * @returns The `title` of the deepest primary route.
|
3947 | */
|
3948 | buildTitle(snapshot: RouterStateSnapshot): string | undefined;
|
3949 | /**
|
3950 | * Given an `ActivatedRouteSnapshot`, returns the final value of the
|
3951 | * `Route.title` property, which can either be a static string or a resolved value.
|
3952 | */
|
3953 | getResolvedTitleForRoute(snapshot: ActivatedRouteSnapshot): any;
|
3954 | static ɵfac: i0.ɵɵFactoryDeclaration<TitleStrategy, never>;
|
3955 | static ɵprov: i0.ɵɵInjectableDeclaration<TitleStrategy>;
|
3956 | }
|
3957 |
|
3958 |
|
3959 | declare class Tree<T> {
|
3960 | constructor(root: TreeNode<T>);
|
3961 | get root(): T;
|
3962 | }
|
3963 |
|
3964 | declare class TreeNode<T> {
|
3965 | value: T;
|
3966 | children: TreeNode<T>[];
|
3967 | constructor(value: T, children: TreeNode<T>[]);
|
3968 | toString(): string;
|
3969 | }
|
3970 |
|
3971 | /**
|
3972 | * @description
|
3973 | *
|
3974 | * Options that modify the `Router` URL.
|
3975 | * Supply an object containing any of these properties to a `Router` navigation function to
|
3976 | * control how the target URL should be constructed.
|
3977 | *
|
3978 | * @see [Router.navigate() method](api/router/Router#navigate)
|
3979 | * @see [Router.createUrlTree() method](api/router/Router#createurltree)
|
3980 | * @see [Routing and Navigation guide](guide/router)
|
3981 | *
|
3982 | * @publicApi
|
3983 | */
|
3984 | export declare interface UrlCreationOptions {
|
3985 | /**
|
3986 | * Specifies a root URI to use for relative navigation.
|
3987 | *
|
3988 | * For example, consider the following route configuration where the parent route
|
3989 | * has two children.
|
3990 | *
|
3991 | * ```
|
3992 | * [{
|
3993 | * path: 'parent',
|
3994 | * component: ParentComponent,
|
3995 | * children: [{
|
3996 | * path: 'list',
|
3997 | * component: ListComponent
|
3998 | * },{
|
3999 | * path: 'child',
|
4000 | * component: ChildComponent
|
4001 | * }]
|
4002 | * }]
|
4003 | * ```
|
4004 | *
|
4005 | * The following `go()` function navigates to the `list` route by
|
4006 | * interpreting the destination URI as relative to the activated `child` route
|
4007 | *
|
4008 | * ```
|
4009 | * @Component({...})
|
4010 | * class ChildComponent {
|
4011 | * constructor(private router: Router, private route: ActivatedRoute) {}
|
4012 | *
|
4013 | * go() {
|
4014 | * router.navigate(['../list'], { relativeTo: this.route });
|
4015 | * }
|
4016 | * }
|
4017 | * ```
|
4018 | *
|
4019 | * A value of `null` or `undefined` indicates that the navigation commands should be applied
|
4020 | * relative to the root.
|
4021 | */
|
4022 | relativeTo?: ActivatedRoute | null;
|
4023 | /**
|
4024 | * Sets query parameters to the URL.
|
4025 | *
|
4026 | * ```
|
4027 | *
|
4028 | * router.navigate(['/results'], { queryParams: { page: 1 } });
|
4029 | * ```
|
4030 | */
|
4031 | queryParams?: Params | null;
|
4032 | /**
|
4033 | * Sets the hash fragment for the URL.
|
4034 | *
|
4035 | * ```
|
4036 | *
|
4037 | * router.navigate(['/results'], { fragment: 'top' });
|
4038 | * ```
|
4039 | */
|
4040 | fragment?: string;
|
4041 | /**
|
4042 | * How to handle query parameters in the router link for the next navigation.
|
4043 | * One of:
|
4044 | * * `preserve` : Preserve current parameters.
|
4045 | * * `merge` : Merge new with current parameters.
|
4046 | *
|
4047 | * The "preserve" option discards any new query params:
|
4048 | * ```
|
4049 | *
|
4050 | * router.navigate(['/view2'], { queryParams: { page: 2 }, queryParamsHandling: "preserve"
|
4051 | * });
|
4052 | * ```
|
4053 | * The "merge" option appends new query params to the params from the current URL:
|
4054 | * ```
|
4055 | *
|
4056 | * router.navigate(['/view2'], { queryParams: { otherKey: 2 }, queryParamsHandling: "merge"
|
4057 | * });
|
4058 | * ```
|
4059 | * In case of a key collision between current parameters and those in the `queryParams` object,
|
4060 | * the new value is used.
|
4061 | *
|
4062 | */
|
4063 | queryParamsHandling?: QueryParamsHandling | null;
|
4064 | /**
|
4065 | * When true, preserves the URL fragment for the next navigation
|
4066 | *
|
4067 | * ```
|
4068 | *
|
4069 | * router.navigate(['/view'], { preserveFragment: true });
|
4070 | * ```
|
4071 | */
|
4072 | preserveFragment?: boolean;
|
4073 | }
|
4074 |
|
4075 | /**
|
4076 | * @description
|
4077 | *
|
4078 | * Provides a way to migrate AngularJS applications to Angular.
|
4079 | *
|
4080 | * @publicApi
|
4081 | */
|
4082 | export declare abstract class UrlHandlingStrategy {
|
4083 | /**
|
4084 | * Tells the router if this URL should be processed.
|
4085 | *
|
4086 | * When it returns true, the router will execute the regular navigation.
|
4087 | * When it returns false, the router will set the router state to an empty state.
|
4088 | * As a result, all the active components will be destroyed.
|
4089 | *
|
4090 | */
|
4091 | abstract shouldProcessUrl(url: UrlTree): boolean;
|
4092 | /**
|
4093 | * Extracts the part of the URL that should be handled by the router.
|
4094 | * The rest of the URL will remain untouched.
|
4095 | */
|
4096 | abstract extract(url: UrlTree): UrlTree;
|
4097 | /**
|
4098 | * Merges the URL fragment with the rest of the URL.
|
4099 | */
|
4100 | abstract merge(newUrlPart: UrlTree, rawUrl: UrlTree): UrlTree;
|
4101 | static ɵfac: i0.ɵɵFactoryDeclaration<UrlHandlingStrategy, never>;
|
4102 | static ɵprov: i0.ɵɵInjectableDeclaration<UrlHandlingStrategy>;
|
4103 | }
|
4104 |
|
4105 | /**
|
4106 | * A function for matching a route against URLs. Implement a custom URL matcher
|
4107 | * for `Route.matcher` when a combination of `path` and `pathMatch`
|
4108 | * is not expressive enough. Cannot be used together with `path` and `pathMatch`.
|
4109 | *
|
4110 | * The function takes the following arguments and returns a `UrlMatchResult` object.
|
4111 | * * *segments* : An array of URL segments.
|
4112 | * * *group* : A segment group.
|
4113 | * * *route* : The route to match against.
|
4114 | *
|
4115 | * The following example implementation matches HTML files.
|
4116 | *
|
4117 | * ```
|
4118 | * export function htmlFiles(url: UrlSegment[]) {
|
4119 | * return url.length === 1 && url[0].path.endsWith('.html') ? ({consumed: url}) : null;
|
4120 | * }
|
4121 | *
|
4122 | * export const routes = [{ matcher: htmlFiles, component: AnyComponent }];
|
4123 | * ```
|
4124 | *
|
4125 | * @publicApi
|
4126 | */
|
4127 | export declare type UrlMatcher = (segments: UrlSegment[], group: UrlSegmentGroup, route: Route) => UrlMatchResult | null;
|
4128 |
|
4129 | /**
|
4130 | * Represents the result of matching URLs with a custom matching function.
|
4131 | *
|
4132 | * * `consumed` is an array of the consumed URL segments.
|
4133 | * * `posParams` is a map of positional parameters.
|
4134 | *
|
4135 | * @see `UrlMatcher()`
|
4136 | * @publicApi
|
4137 | */
|
4138 | export declare type UrlMatchResult = {
|
4139 | consumed: UrlSegment[];
|
4140 | posParams?: {
|
4141 | [name: string]: UrlSegment;
|
4142 | };
|
4143 | };
|
4144 |
|
4145 | /**
|
4146 | * @description
|
4147 | *
|
4148 | * Represents a single URL segment.
|
4149 | *
|
4150 | * A UrlSegment is a part of a URL between the two slashes. It contains a path and the matrix
|
4151 | * parameters associated with the segment.
|
4152 | *
|
4153 | * @usageNotes
|
4154 | * ### Example
|
4155 | *
|
4156 | * ```
|
4157 | * @Component({templateUrl:'template.html'})
|
4158 | * class MyComponent {
|
4159 | * constructor(router: Router) {
|
4160 | * const tree: UrlTree = router.parseUrl('/team;id=33');
|
4161 | * const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];
|
4162 | * const s: UrlSegment[] = g.segments;
|
4163 | * s[0].path;
|
4164 | * s[0].parameters;
|
4165 | * }
|
4166 | * }
|
4167 | * ```
|
4168 | *
|
4169 | * @publicApi
|
4170 | */
|
4171 | export declare class UrlSegment {
|
4172 | /** The path part of a URL segment */
|
4173 | path: string;
|
4174 | /** The matrix parameters associated with a segment */
|
4175 | parameters: {
|
4176 | [name: string]: string;
|
4177 | };
|
4178 | constructor(
|
4179 | /** The path part of a URL segment */
|
4180 | path: string,
|
4181 | /** The matrix parameters associated with a segment */
|
4182 | parameters: {
|
4183 | [name: string]: string;
|
4184 | });
|
4185 | get parameterMap(): ParamMap;
|
4186 | /** @docsNotRequired */
|
4187 | toString(): string;
|
4188 | }
|
4189 |
|
4190 | /**
|
4191 | * @description
|
4192 | *
|
4193 | * Represents the parsed URL segment group.
|
4194 | *
|
4195 | * See `UrlTree` for more information.
|
4196 | *
|
4197 | * @publicApi
|
4198 | */
|
4199 | export declare class UrlSegmentGroup {
|
4200 | /** The URL segments of this group. See `UrlSegment` for more information */
|
4201 | segments: UrlSegment[];
|
4202 | /** The list of children of this group */
|
4203 | children: {
|
4204 | [key: string]: UrlSegmentGroup;
|
4205 | };
|
4206 | /** The parent node in the url tree */
|
4207 | parent: UrlSegmentGroup | null;
|
4208 | constructor(
|
4209 | /** The URL segments of this group. See `UrlSegment` for more information */
|
4210 | segments: UrlSegment[],
|
4211 | /** The list of children of this group */
|
4212 | children: {
|
4213 | [key: string]: UrlSegmentGroup;
|
4214 | });
|
4215 | /** Whether the segment has child segments */
|
4216 | hasChildren(): boolean;
|
4217 | /** Number of child segments */
|
4218 | get numberOfChildren(): number;
|
4219 | /** @docsNotRequired */
|
4220 | toString(): string;
|
4221 | }
|
4222 |
|
4223 | /**
|
4224 | * @description
|
4225 | *
|
4226 | * Serializes and deserializes a URL string into a URL tree.
|
4227 | *
|
4228 | * The url serialization strategy is customizable. You can
|
4229 | * make all URLs case insensitive by providing a custom UrlSerializer.
|
4230 | *
|
4231 | * See `DefaultUrlSerializer` for an example of a URL serializer.
|
4232 | *
|
4233 | * @publicApi
|
4234 | */
|
4235 | export declare abstract class UrlSerializer {
|
4236 | /** Parse a url into a `UrlTree` */
|
4237 | abstract parse(url: string): UrlTree;
|
4238 | /** Converts a `UrlTree` into a url */
|
4239 | abstract serialize(tree: UrlTree): string;
|
4240 | static ɵfac: i0.ɵɵFactoryDeclaration<UrlSerializer, never>;
|
4241 | static ɵprov: i0.ɵɵInjectableDeclaration<UrlSerializer>;
|
4242 | }
|
4243 |
|
4244 | /**
|
4245 | * @description
|
4246 | *
|
4247 | * Represents the parsed URL.
|
4248 | *
|
4249 | * Since a router state is a tree, and the URL is nothing but a serialized state, the URL is a
|
4250 | * serialized tree.
|
4251 | * UrlTree is a data structure that provides a lot of affordances in dealing with URLs
|
4252 | *
|
4253 | * @usageNotes
|
4254 | * ### Example
|
4255 | *
|
4256 | * ```
|
4257 | * @Component({templateUrl:'template.html'})
|
4258 | * class MyComponent {
|
4259 | * constructor(router: Router) {
|
4260 | * const tree: UrlTree =
|
4261 | * router.parseUrl('/team/33/(user/victor//support:help)?debug=true#fragment');
|
4262 | * const f = tree.fragment;
|
4263 | * const q = tree.queryParams;
|
4264 | * const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET];
|
4265 | * const s: UrlSegment[] = g.segments;
|
4266 | * g.children[PRIMARY_OUTLET].segments;
|
4267 | * g.children['support'].segments;
|
4268 | * }
|
4269 | * }
|
4270 | * ```
|
4271 | *
|
4272 | * @publicApi
|
4273 | */
|
4274 | export declare class UrlTree {
|
4275 | /** The root segment group of the URL tree */
|
4276 | root: UrlSegmentGroup;
|
4277 | /** The query params of the URL */
|
4278 | queryParams: Params;
|
4279 | /** The fragment of the URL */
|
4280 | fragment: string | null;
|
4281 | constructor(
|
4282 | /** The root segment group of the URL tree */
|
4283 | root?: UrlSegmentGroup,
|
4284 | /** The query params of the URL */
|
4285 | queryParams?: Params,
|
4286 | /** The fragment of the URL */
|
4287 | fragment?: string | null);
|
4288 | get queryParamMap(): ParamMap;
|
4289 | /** @docsNotRequired */
|
4290 | toString(): string;
|
4291 | }
|
4292 |
|
4293 | /**
|
4294 | * @publicApi
|
4295 | */
|
4296 | export declare const VERSION: Version;
|
4297 |
|
4298 | /**
|
4299 | * Enables logging of all internal navigation events to the console.
|
4300 | * Extra logging might be useful for debugging purposes to inspect Router event sequence.
|
4301 | *
|
4302 | * @usageNotes
|
4303 | *
|
4304 | * Basic example of how you can enable debug tracing:
|
4305 | * ```
|
4306 | * const appRoutes: Routes = [];
|
4307 | * bootstrapApplication(AppComponent,
|
4308 | * {
|
4309 | * providers: [
|
4310 | * provideRouter(appRoutes, withDebugTracing())
|
4311 | * ]
|
4312 | * }
|
4313 | * );
|
4314 | * ```
|
4315 | *
|
4316 | * @see `provideRouter`
|
4317 | *
|
4318 | * @returns A set of providers for use with `provideRouter`.
|
4319 | *
|
4320 | * @publicApi
|
4321 | */
|
4322 | export declare function withDebugTracing(): DebugTracingFeature;
|
4323 |
|
4324 | /**
|
4325 | * Disables initial navigation.
|
4326 | *
|
4327 | * Use if there is a reason to have more control over when the router starts its initial navigation
|
4328 | * due to some complex initialization logic.
|
4329 | *
|
4330 | * @usageNotes
|
4331 | *
|
4332 | * Basic example of how you can disable initial navigation:
|
4333 | * ```
|
4334 | * const appRoutes: Routes = [];
|
4335 | * bootstrapApplication(AppComponent,
|
4336 | * {
|
4337 | * providers: [
|
4338 | * provideRouter(appRoutes, withDisabledInitialNavigation())
|
4339 | * ]
|
4340 | * }
|
4341 | * );
|
4342 | * ```
|
4343 | *
|
4344 | * @see `provideRouter`
|
4345 | *
|
4346 | * @returns A set of providers for use with `provideRouter`.
|
4347 | *
|
4348 | * @publicApi
|
4349 | */
|
4350 | export declare function withDisabledInitialNavigation(): DisabledInitialNavigationFeature;
|
4351 |
|
4352 | /**
|
4353 | * Configures initial navigation to start before the root component is created.
|
4354 | *
|
4355 | * The bootstrap is blocked until the initial navigation is complete. This value is required for
|
4356 | * [server-side rendering](guide/universal) to work.
|
4357 | *
|
4358 | * @usageNotes
|
4359 | *
|
4360 | * Basic example of how you can enable this navigation behavior:
|
4361 | * ```
|
4362 | * const appRoutes: Routes = [];
|
4363 | * bootstrapApplication(AppComponent,
|
4364 | * {
|
4365 | * providers: [
|
4366 | * provideRouter(appRoutes, withEnabledBlockingInitialNavigation())
|
4367 | * ]
|
4368 | * }
|
4369 | * );
|
4370 | * ```
|
4371 | *
|
4372 | * @see `provideRouter`
|
4373 | *
|
4374 | * @publicApi
|
4375 | * @returns A set of providers for use with `provideRouter`.
|
4376 | */
|
4377 | export declare function withEnabledBlockingInitialNavigation(): EnabledBlockingInitialNavigationFeature;
|
4378 |
|
4379 | /**
|
4380 | * Provides the location strategy that uses the URL fragment instead of the history API.
|
4381 | *
|
4382 | * @usageNotes
|
4383 | *
|
4384 | * Basic example of how you can use the hash location option:
|
4385 | * ```
|
4386 | * const appRoutes: Routes = [];
|
4387 | * bootstrapApplication(AppComponent,
|
4388 | * {
|
4389 | * providers: [
|
4390 | * provideRouter(appRoutes, withHashLocation())
|
4391 | * ]
|
4392 | * }
|
4393 | * );
|
4394 | * ```
|
4395 | *
|
4396 | * @see `provideRouter`
|
4397 | * @see `HashLocationStrategy`
|
4398 | *
|
4399 | * @returns A set of providers for use with `provideRouter`.
|
4400 | *
|
4401 | * @publicApi
|
4402 | */
|
4403 | export declare function withHashLocation(): RouterConfigurationFeature;
|
4404 |
|
4405 | /**
|
4406 | * Enables customizable scrolling behavior for router navigations.
|
4407 | *
|
4408 | * @usageNotes
|
4409 | *
|
4410 | * Basic example of how you can enable scrolling feature:
|
4411 | * ```
|
4412 | * const appRoutes: Routes = [];
|
4413 | * bootstrapApplication(AppComponent,
|
4414 | * {
|
4415 | * providers: [
|
4416 | * provideRouter(appRoutes, withInMemoryScrolling())
|
4417 | * ]
|
4418 | * }
|
4419 | * );
|
4420 | * ```
|
4421 | *
|
4422 | * @see `provideRouter`
|
4423 | * @see `ViewportScroller`
|
4424 | *
|
4425 | * @publicApi
|
4426 | * @param options Set of configuration parameters to customize scrolling behavior, see
|
4427 | * `InMemoryScrollingOptions` for additional information.
|
4428 | * @returns A set of providers for use with `provideRouter`.
|
4429 | */
|
4430 | export declare function withInMemoryScrolling(options?: InMemoryScrollingOptions): InMemoryScrollingFeature;
|
4431 |
|
4432 | /**
|
4433 | * Subscribes to the Router's navigation events and calls the given function when a
|
4434 | * `NavigationError` happens.
|
4435 | *
|
4436 | * This function is run inside application's injection context so you can use the `inject` function.
|
4437 | *
|
4438 | * @usageNotes
|
4439 | *
|
4440 | * Basic example of how you can use the error handler option:
|
4441 | * ```
|
4442 | * const appRoutes: Routes = [];
|
4443 | * bootstrapApplication(AppComponent,
|
4444 | * {
|
4445 | * providers: [
|
4446 | * provideRouter(appRoutes, withNavigationErrorHandler((e: NavigationError) =>
|
4447 | * inject(MyErrorTracker).trackError(e)))
|
4448 | * ]
|
4449 | * }
|
4450 | * );
|
4451 | * ```
|
4452 | *
|
4453 | * @see `NavigationError`
|
4454 | * @see `inject`
|
4455 | * @see `EnvironmentInjector#runInContext`
|
4456 | *
|
4457 | * @returns A set of providers for use with `provideRouter`.
|
4458 | *
|
4459 | * @publicApi
|
4460 | */
|
4461 | export declare function withNavigationErrorHandler(fn: (error: NavigationError) => void): NavigationErrorHandlerFeature;
|
4462 |
|
4463 | /**
|
4464 | * Allows to configure a preloading strategy to use. The strategy is configured by providing a
|
4465 | * reference to a class that implements a `PreloadingStrategy`.
|
4466 | *
|
4467 | * @usageNotes
|
4468 | *
|
4469 | * Basic example of how you can configure preloading:
|
4470 | * ```
|
4471 | * const appRoutes: Routes = [];
|
4472 | * bootstrapApplication(AppComponent,
|
4473 | * {
|
4474 | * providers: [
|
4475 | * provideRouter(appRoutes, withPreloading(PreloadAllModules))
|
4476 | * ]
|
4477 | * }
|
4478 | * );
|
4479 | * ```
|
4480 | *
|
4481 | * @see `provideRouter`
|
4482 | *
|
4483 | * @param preloadingStrategy A reference to a class that implements a `PreloadingStrategy` that
|
4484 | * should be used.
|
4485 | * @returns A set of providers for use with `provideRouter`.
|
4486 | *
|
4487 | * @publicApi
|
4488 | */
|
4489 | declare function withPreloading(preloadingStrategy: Type<PreloadingStrategy>): PreloadingFeature;
|
4490 | export { withPreloading }
|
4491 | export { withPreloading as ɵwithPreloading }
|
4492 |
|
4493 | /**
|
4494 | * Allows to provide extra parameters to configure Router.
|
4495 | *
|
4496 | * @usageNotes
|
4497 | *
|
4498 | * Basic example of how you can provide extra configuration options:
|
4499 | * ```
|
4500 | * const appRoutes: Routes = [];
|
4501 | * bootstrapApplication(AppComponent,
|
4502 | * {
|
4503 | * providers: [
|
4504 | * provideRouter(appRoutes, withRouterConfig({
|
4505 | * onSameUrlNavigation: 'reload'
|
4506 | * }))
|
4507 | * ]
|
4508 | * }
|
4509 | * );
|
4510 | * ```
|
4511 | *
|
4512 | * @see `provideRouter`
|
4513 | *
|
4514 | * @param options A set of parameters to configure Router, see `RouterConfigOptions` for
|
4515 | * additional information.
|
4516 | * @returns A set of providers for use with `provideRouter`.
|
4517 | *
|
4518 | * @publicApi
|
4519 | */
|
4520 | export declare function withRouterConfig(options: RouterConfigOptions): RouterConfigurationFeature;
|
4521 |
|
4522 | /**
|
4523 | * Performs the given action once the router finishes its next/current navigation.
|
4524 | *
|
4525 | * The navigation is considered complete under the following conditions:
|
4526 | * - `NavigationCancel` event emits and the code is not `NavigationCancellationCode.Redirect` or
|
4527 | * `NavigationCancellationCode.SupersededByNewNavigation`. In these cases, the
|
4528 | * redirecting/superseding navigation must finish.
|
4529 | * - `NavigationError`, `NavigationEnd`, or `NavigationSkipped` event emits
|
4530 | */
|
4531 | export declare function ɵafterNextNavigation(router: Router, action: () => void): void;
|
4532 |
|
4533 | /**
|
4534 | * This component is used internally within the router to be a placeholder when an empty
|
4535 | * router-outlet is needed. For example, with a config such as:
|
4536 | *
|
4537 | * `{path: 'parent', outlet: 'nav', children: [...]}`
|
4538 | *
|
4539 | * In order to render, there needs to be a component on this config, which will default
|
4540 | * to this `EmptyOutletComponent`.
|
4541 | */
|
4542 | export declare class ɵEmptyOutletComponent {
|
4543 | static ɵfac: i0.ɵɵFactoryDeclaration<ɵEmptyOutletComponent, never>;
|
4544 | static ɵcmp: i0.ɵɵComponentDeclaration<ɵEmptyOutletComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
4545 | }
|
4546 |
|
4547 | /**
|
4548 | * Flattens single-level nested arrays.
|
4549 | */
|
4550 | export declare function ɵflatten<T>(arr: T[][]): T[];
|
4551 |
|
4552 | export declare type ɵRestoredState = {
|
4553 | [k: string]: any;
|
4554 | navigationId: number;
|
4555 | ɵrouterPageId?: number;
|
4556 | };
|
4557 |
|
4558 | export declare const ɵROUTER_PROVIDERS: Provider[];
|
4559 |
|
4560 | export { }
|
4561 |
|
\ | No newline at end of file |