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