1 | import { Container } from 'aurelia-dependency-injection';
|
2 | import { EventAggregator } from 'aurelia-event-aggregator';
|
3 | import { History, NavigationOptions } from 'aurelia-history';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export declare class NavModel {
|
9 | |
10 |
|
11 |
|
12 | isActive: boolean;
|
13 | |
14 |
|
15 |
|
16 | title: string;
|
17 | |
18 |
|
19 |
|
20 | href: string;
|
21 | |
22 |
|
23 |
|
24 | relativeHref: string;
|
25 | |
26 |
|
27 |
|
28 | settings: any;
|
29 | |
30 |
|
31 |
|
32 | config: RouteConfig;
|
33 | |
34 |
|
35 |
|
36 | router: Router;
|
37 | order: number | boolean;
|
38 | constructor(router: Router, relativeHref: string);
|
39 | /**
|
40 | * Sets the route's title and updates document.title.
|
41 | * If the a navigation is in progress, the change will be applied
|
42 | * to document.title when the navigation completes.
|
43 | *
|
44 | * @param title The new title.
|
45 | */
|
46 | setTitle(title: string): void;
|
47 | }
|
48 | /**
|
49 | * Class used to configure a [[Router]] instance.
|
50 | *
|
51 | * @constructor
|
52 | */
|
53 | export declare class RouterConfiguration {
|
54 | instructions: Array<(router: Router) => void>;
|
55 | options: {
|
56 | [key: string]: any;
|
57 | compareQueryParams?: boolean;
|
58 | root?: string;
|
59 | pushState?: boolean;
|
60 | hashChange?: boolean;
|
61 | silent?: boolean;
|
62 | };
|
63 | pipelineSteps: Array<{
|
64 | name: string;
|
65 | step: Function | PipelineStep;
|
66 | }>;
|
67 | title: string;
|
68 | titleSeparator: string;
|
69 | unknownRouteConfig: RouteConfigSpecifier;
|
70 | viewPortDefaults: Record<string, any>;
|
71 | |
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | addPipelineStep(name: string, step: Function | PipelineStep): RouterConfiguration;
|
79 | |
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 | addAuthorizeStep(step: Function | PipelineStep): RouterConfiguration;
|
86 | |
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 | addPreActivateStep(step: Function | PipelineStep): RouterConfiguration;
|
93 | |
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 | addPreRenderStep(step: Function | PipelineStep): RouterConfiguration;
|
100 | |
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 | addPostRenderStep(step: Function | PipelineStep): RouterConfiguration;
|
107 | |
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 | fallbackRoute(fragment: string): RouterConfiguration;
|
114 | |
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 | map(route: RouteConfig | RouteConfig[]): RouterConfiguration;
|
121 | |
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 | useViewPortDefaults(viewPortConfig: Record<string, {
|
129 | [key: string]: any;
|
130 | moduleId: string;
|
131 | }>): RouterConfiguration;
|
132 | |
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 | mapRoute(config: RouteConfig): RouterConfiguration;
|
139 | |
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 | mapUnknownRoutes(config: RouteConfigSpecifier): RouterConfiguration;
|
147 | |
148 |
|
149 |
|
150 |
|
151 |
|
152 | exportToRouter(router: Router): void;
|
153 | }
|
154 |
|
155 |
|
156 |
|
157 | export declare class Router {
|
158 | |
159 |
|
160 |
|
161 | container: Container;
|
162 | |
163 |
|
164 |
|
165 | history: History;
|
166 | |
167 |
|
168 |
|
169 |
|
170 | viewPorts: Record<string, any>;
|
171 | |
172 |
|
173 |
|
174 | routes: RouteConfig[];
|
175 | |
176 |
|
177 |
|
178 | baseUrl: string;
|
179 | |
180 |
|
181 |
|
182 | title: string | undefined;
|
183 | |
184 |
|
185 |
|
186 | titleSeparator: string | undefined;
|
187 | |
188 |
|
189 |
|
190 | isConfigured: boolean;
|
191 | |
192 |
|
193 |
|
194 | isNavigating: boolean;
|
195 | |
196 |
|
197 |
|
198 | isExplicitNavigation: boolean;
|
199 | |
200 |
|
201 |
|
202 | isExplicitNavigationBack: boolean;
|
203 | |
204 |
|
205 |
|
206 | isNavigatingFirst: boolean;
|
207 | |
208 |
|
209 |
|
210 | isNavigatingNew: boolean;
|
211 | |
212 |
|
213 |
|
214 | isNavigatingForward: boolean;
|
215 | |
216 |
|
217 |
|
218 | isNavigatingBack: boolean;
|
219 | |
220 |
|
221 |
|
222 | isNavigatingRefresh: boolean;
|
223 | |
224 |
|
225 |
|
226 | couldDeactivate: boolean;
|
227 | |
228 |
|
229 |
|
230 | currentNavigationTracker: number;
|
231 | |
232 |
|
233 |
|
234 | navigation: NavModel[];
|
235 | |
236 |
|
237 |
|
238 | currentInstruction: NavigationInstruction;
|
239 | |
240 |
|
241 |
|
242 | parent: Router;
|
243 | options: any;
|
244 | |
245 |
|
246 |
|
247 | viewPortDefaults: Record<string, any>;
|
248 | |
249 |
|
250 |
|
251 |
|
252 |
|
253 | transformTitle: (title: string) => string;
|
254 | |
255 |
|
256 |
|
257 |
|
258 | constructor(container: Container, history: History);
|
259 | /**
|
260 | * Fully resets the router's internal state. Primarily used internally by the framework when multiple calls to setRoot are made.
|
261 | * Use with caution (actually, avoid using this). Do not use this to simply change your navigation model.
|
262 | */
|
263 | reset(): void;
|
264 | /**
|
265 | * Gets a value indicating whether or not this [[Router]] is the root in the router tree. I.e., it has no parent.
|
266 | */
|
267 | readonly isRoot: boolean;
|
268 | /**
|
269 | * Registers a viewPort to be used as a rendering target for activated routes.
|
270 | *
|
271 | * @param viewPort The viewPort.
|
272 | * @param name The name of the viewPort. 'default' if unspecified.
|
273 | */
|
274 | registerViewPort(viewPort: any, name?: string): void;
|
275 | /**
|
276 | * Returns a Promise that resolves when the router is configured.
|
277 | */
|
278 | ensureConfigured(): Promise<void>;
|
279 | /**
|
280 | * Configures the router.
|
281 | *
|
282 | * @param callbackOrConfig The [[RouterConfiguration]] or a callback that takes a [[RouterConfiguration]].
|
283 | */
|
284 | configure(callbackOrConfig: RouterConfiguration | ((config: RouterConfiguration) => RouterConfiguration)): Promise<void>;
|
285 | /**
|
286 | * Navigates to a new location.
|
287 | *
|
288 | * @param fragment The URL fragment to use as the navigation destination.
|
289 | * @param options The navigation options.
|
290 | */
|
291 | navigate(fragment: string, options?: NavigationOptions): boolean;
|
292 | /**
|
293 | * Navigates to a new location corresponding to the route and params specified. Equivallent to [[Router.generate]] followed
|
294 | * by [[Router.navigate]].
|
295 | *
|
296 | * @param route The name of the route to use when generating the navigation location.
|
297 | * @param params The route parameters to be used when populating the route pattern.
|
298 | * @param options The navigation options.
|
299 | */
|
300 | navigateToRoute(route: string, params?: any, options?: NavigationOptions): boolean;
|
301 | /**
|
302 | * Navigates back to the most recent location in history.
|
303 | */
|
304 | navigateBack(): void;
|
305 | /**
|
306 | * Creates a child router of the current router.
|
307 | *
|
308 | * @param container The [[Container]] to provide to the child router. Uses the current [[Router]]'s [[Container]] if unspecified.
|
309 | * @returns {Router} The new child Router.
|
310 | */
|
311 | createChild(container?: Container): Router;
|
312 | |
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 | generate(nameOrRoute: string | RouteConfig, params?: any, options?: any): string;
|
321 | |
322 |
|
323 |
|
324 |
|
325 |
|
326 | createNavModel(config: RouteConfig): NavModel;
|
327 | |
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 | addRoute(config: RouteConfig, navModel?: NavModel): void;
|
334 | |
335 |
|
336 |
|
337 |
|
338 |
|
339 | hasRoute(name: string): boolean;
|
340 | |
341 |
|
342 |
|
343 |
|
344 |
|
345 | hasOwnRoute(name: string): boolean;
|
346 | |
347 |
|
348 |
|
349 |
|
350 |
|
351 | handleUnknownRoutes(config?: RouteConfigSpecifier): void;
|
352 | |
353 |
|
354 |
|
355 | updateTitle(): void;
|
356 | |
357 |
|
358 |
|
359 |
|
360 | refreshNavigation(): void;
|
361 | |
362 |
|
363 |
|
364 |
|
365 |
|
366 | useViewPortDefaults($viewPortDefaults: Record<string, any>): void;
|
367 | }
|
368 |
|
369 |
|
370 |
|
371 | export declare const activationStrategy: ActivationStrategy;
|
372 |
|
373 |
|
374 |
|
375 | export interface ActivationStrategy {
|
376 | |
377 |
|
378 |
|
379 | noChange: 'no-change';
|
380 | |
381 |
|
382 |
|
383 | invokeLifecycle: 'invoke-lifecycle';
|
384 | |
385 |
|
386 |
|
387 | replace: 'replace';
|
388 | }
|
389 |
|
390 |
|
391 |
|
392 | export declare type ActivationStrategyType = ActivationStrategy[keyof ActivationStrategy];
|
393 |
|
394 |
|
395 |
|
396 | export interface NavigationInstructionInit {
|
397 | fragment: string;
|
398 | queryString?: string;
|
399 | params?: Record<string, any>;
|
400 | queryParams?: Record<string, any>;
|
401 | config: RouteConfig;
|
402 | parentInstruction?: NavigationInstruction;
|
403 | previousInstruction?: NavigationInstruction;
|
404 | router: Router;
|
405 | options?: Object;
|
406 | plan?: Record<string, any>;
|
407 | }
|
408 | export interface ViewPortInstructionInit {
|
409 | name: string;
|
410 | strategy: ActivationStrategyType;
|
411 | moduleId: string;
|
412 | component: ViewPortComponent;
|
413 | }
|
414 |
|
415 |
|
416 |
|
417 | export declare class NavigationInstruction {
|
418 | |
419 |
|
420 |
|
421 | fragment: string;
|
422 | |
423 |
|
424 |
|
425 | queryString: string;
|
426 | |
427 |
|
428 |
|
429 | params: any;
|
430 | |
431 |
|
432 |
|
433 | queryParams: any;
|
434 | |
435 |
|
436 |
|
437 | config: RouteConfig;
|
438 | |
439 |
|
440 |
|
441 | parentInstruction: NavigationInstruction;
|
442 | parentCatchHandler: any;
|
443 | |
444 |
|
445 |
|
446 | previousInstruction: NavigationInstruction;
|
447 | |
448 |
|
449 |
|
450 | viewPortInstructions: Record<string, any>;
|
451 | |
452 |
|
453 |
|
454 | router: Router;
|
455 | |
456 |
|
457 |
|
458 | plan: Record<string, any>;
|
459 | options: Record<string, any>;
|
460 | constructor(init: NavigationInstructionInit);
|
461 | /**
|
462 | * Gets an array containing this instruction and all child instructions for the current navigation.
|
463 | */
|
464 | getAllInstructions(): Array<NavigationInstruction>;
|
465 | /**
|
466 | * Gets an array containing the instruction and all child instructions for the previous navigation.
|
467 | * Previous instructions are no longer available after navigation completes.
|
468 | */
|
469 | getAllPreviousInstructions(): Array<NavigationInstruction>;
|
470 | /**
|
471 | * Adds a viewPort instruction. Returns the newly created instruction based on parameters
|
472 | */
|
473 | addViewPortInstruction(initOptions: ViewPortInstructionInit): any;
|
474 | addViewPortInstruction(viewPortName: string, strategy: ActivationStrategyType, moduleId: string, component: any): any;
|
475 | /**
|
476 | * Gets the name of the route pattern's wildcard parameter, if applicable.
|
477 | */
|
478 | getWildCardName(): string;
|
479 | /**
|
480 | * Gets the path and query string created by filling the route
|
481 | * pattern's wildcard parameter with the matching param.
|
482 | */
|
483 | getWildcardPath(): string;
|
484 | /**
|
485 | * Gets the instruction's base URL, accounting for wildcard route parameters.
|
486 | */
|
487 | getBaseUrl(): string;
|
488 | }
|
489 | /**
|
490 | * When a navigation command is encountered, the current navigation
|
491 | * will be cancelled and control will be passed to the navigation
|
492 | * command so it can determine the correct action.
|
493 | */
|
494 | export interface NavigationCommand {
|
495 | navigate: (router: Router) => void;
|
496 | }
|
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
503 | export declare function isNavigationCommand(obj: any): obj is NavigationCommand;
|
504 |
|
505 |
|
506 |
|
507 | export declare class Redirect implements NavigationCommand {
|
508 | url: string;
|
509 | private router;
|
510 | |
511 |
|
512 |
|
513 |
|
514 | constructor(url: string, options?: NavigationOptions);
|
515 | /**
|
516 | * Called by the activation system to set the child router.
|
517 | *
|
518 | * @param router The router.
|
519 | */
|
520 | setRouter(router: Router): void;
|
521 | /**
|
522 | * Called by the navigation pipeline to navigate.
|
523 | *
|
524 | * @param appRouter The router to be redirected.
|
525 | */
|
526 | navigate(appRouter: Router): void;
|
527 | }
|
528 | /**
|
529 | * Used during the activation lifecycle to cause a redirect to a named route.
|
530 | */
|
531 | export declare class RedirectToRoute implements NavigationCommand {
|
532 | route: string;
|
533 | params: any;
|
534 | |
535 |
|
536 |
|
537 |
|
538 |
|
539 | constructor(route: string, params?: any, options?: NavigationOptions);
|
540 | /**
|
541 | * Called by the activation system to set the child router.
|
542 | *
|
543 | * @param router The router.
|
544 | */
|
545 | setRouter(router: Router): void;
|
546 | /**
|
547 | * Called by the navigation pipeline to navigate.
|
548 | *
|
549 | * @param appRouter The router to be redirected.
|
550 | */
|
551 | navigate(appRouter: Router): void;
|
552 | }
|
553 | /**
|
554 | * A basic interface for an Observable type
|
555 | */
|
556 | export interface IObservable {
|
557 | subscribe(sub?: IObservableConfig): ISubscription;
|
558 | }
|
559 | export interface IObservableConfig {
|
560 | next(): void;
|
561 | error(err?: any): void;
|
562 | complete(): void;
|
563 | }
|
564 |
|
565 |
|
566 |
|
567 | export interface ISubscription {
|
568 | unsubscribe(): void;
|
569 | }
|
570 |
|
571 |
|
572 |
|
573 | export declare const enum PipelineStatus {
|
574 | Completed = "completed",
|
575 | Canceled = "canceled",
|
576 | Rejected = "rejected",
|
577 | Running = "running"
|
578 | }
|
579 |
|
580 |
|
581 |
|
582 | export interface RedirectConfig {
|
583 | |
584 |
|
585 |
|
586 | redirect: string;
|
587 | |
588 |
|
589 |
|
590 | [key: string]: any;
|
591 | }
|
592 |
|
593 |
|
594 |
|
595 |
|
596 | export declare type RouteOrRedirectConfig = RouteConfig | RedirectConfig;
|
597 |
|
598 |
|
599 |
|
600 |
|
601 | export declare type RouteConfigSpecifier = string | RouteOrRedirectConfig | ((instruction: NavigationInstruction) => string | RouteOrRedirectConfig | Promise<string | RouteOrRedirectConfig>);
|
602 | /**
|
603 | * A configuration object that describes a route.
|
604 | */
|
605 | export interface RouteConfig {
|
606 | /**
|
607 | * The route pattern to match against incoming URL fragments, or an array of patterns.
|
608 | */
|
609 | route: string | string[];
|
610 | /**
|
611 | * A unique name for the route that may be used to identify the route when generating URL fragments.
|
612 | * Required when this route should support URL generation, such as with [[Router.generate]] or
|
613 | * the route-href custom attribute.
|
614 | */
|
615 | name?: string;
|
616 | /**
|
617 | * The moduleId of the view model that should be activated for this route.
|
618 | */
|
619 | moduleId?: string;
|
620 | /**
|
621 | * A URL fragment to redirect to when this route is matched.
|
622 | */
|
623 | redirect?: string;
|
624 | /**
|
625 | * A function that can be used to dynamically select the module or modules to activate.
|
626 | * The function is passed the current [[NavigationInstruction]], and should configure
|
627 | * instruction.config with the desired moduleId, viewPorts, or redirect.
|
628 | */
|
629 | navigationStrategy?: (instruction: NavigationInstruction) => Promise<void> | void;
|
630 | |
631 |
|
632 |
|
633 |
|
634 |
|
635 |
|
636 |
|
637 | viewPorts?: any;
|
638 | |
639 |
|
640 |
|
641 |
|
642 |
|
643 | nav?: boolean | number;
|
644 | |
645 |
|
646 |
|
647 |
|
648 | href?: string;
|
649 | |
650 |
|
651 |
|
652 | generationUsesHref?: boolean;
|
653 | |
654 |
|
655 |
|
656 | title?: string;
|
657 | |
658 |
|
659 |
|
660 |
|
661 | settings?: any;
|
662 | |
663 |
|
664 |
|
665 | navModel?: NavModel;
|
666 | |
667 |
|
668 |
|
669 | caseSensitive?: boolean;
|
670 | |
671 |
|
672 |
|
673 |
|
674 | activationStrategy?: ActivationStrategyType;
|
675 | |
676 |
|
677 |
|
678 | layoutView?: string;
|
679 | |
680 |
|
681 |
|
682 | layoutViewModel?: string;
|
683 | |
684 |
|
685 |
|
686 | layoutModel?: any;
|
687 | [x: string]: any;
|
688 | }
|
689 |
|
690 |
|
691 |
|
692 | export interface RoutableComponentCanActivate {
|
693 | |
694 |
|
695 |
|
696 |
|
697 | canActivate(params: any, routeConfig: RouteConfig, navigationInstruction: NavigationInstruction): boolean | Promise<boolean> | PromiseLike<boolean> | NavigationCommand | Promise<NavigationCommand> | PromiseLike<NavigationCommand>;
|
698 | }
|
699 |
|
700 |
|
701 |
|
702 | export interface RoutableComponentActivate {
|
703 | |
704 |
|
705 |
|
706 |
|
707 |
|
708 | activate(params: any, routeConfig: RouteConfig, navigationInstruction: NavigationInstruction): Promise<void> | PromiseLike<void> | IObservable | void;
|
709 | }
|
710 |
|
711 |
|
712 |
|
713 | export interface RoutableComponentCanDeactivate {
|
714 | |
715 |
|
716 |
|
717 |
|
718 |
|
719 | canDeactivate: () => boolean | Promise<boolean> | PromiseLike<boolean> | NavigationCommand;
|
720 | }
|
721 |
|
722 |
|
723 |
|
724 | export interface RoutableComponentDeactivate {
|
725 | |
726 |
|
727 |
|
728 |
|
729 |
|
730 | deactivate: () => Promise<void> | PromiseLike<void> | IObservable | void;
|
731 | }
|
732 |
|
733 |
|
734 |
|
735 | export interface RoutableComponentDetermineActivationStrategy {
|
736 | |
737 |
|
738 |
|
739 |
|
740 | determineActivationStrategy(params: any, routeConfig: RouteConfig, navigationInstruction: NavigationInstruction): ActivationStrategyType;
|
741 | }
|
742 |
|
743 |
|
744 |
|
745 | export interface ConfiguresRouter {
|
746 | |
747 |
|
748 |
|
749 | configureRouter(config: RouterConfiguration, router: Router): Promise<void> | PromiseLike<void> | void;
|
750 | }
|
751 |
|
752 |
|
753 |
|
754 | export interface PipelineStep {
|
755 | |
756 |
|
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 | run(instruction: NavigationInstruction, next: Next): Promise<any>;
|
763 | }
|
764 |
|
765 |
|
766 |
|
767 | export interface IPipelineSlot {
|
768 | }
|
769 |
|
770 |
|
771 |
|
772 | export interface PipelineResult {
|
773 | status: string;
|
774 | instruction: NavigationInstruction;
|
775 | output: any;
|
776 | completed: boolean;
|
777 | }
|
778 |
|
779 |
|
780 |
|
781 | export interface ViewPortComponent {
|
782 | viewModel: any;
|
783 | childContainer?: Container;
|
784 | router: Router;
|
785 | config?: RouteConfig;
|
786 | childRouter?: Router;
|
787 | |
788 |
|
789 |
|
790 | [key: string]: any;
|
791 | }
|
792 | export declare type NavigationResult = boolean | Promise<PipelineResult | boolean>;
|
793 |
|
794 |
|
795 |
|
796 |
|
797 | export interface Next<T = any> {
|
798 | |
799 |
|
800 |
|
801 | (): Promise<any>;
|
802 | |
803 |
|
804 |
|
805 | complete: NextCompletionHandler<T>;
|
806 | |
807 |
|
808 |
|
809 | cancel: NextCompletionHandler<T>;
|
810 | |
811 |
|
812 |
|
813 | reject: NextCompletionHandler<T>;
|
814 | }
|
815 |
|
816 |
|
817 |
|
818 | export interface NextCompletionResult<T = any> {
|
819 | status: PipelineStatus;
|
820 | output: T;
|
821 | completed: boolean;
|
822 | }
|
823 |
|
824 |
|
825 |
|
826 | export declare type NextCompletionHandler<T = any> = (output?: T) => Promise<NextCompletionResult<T>>;
|
827 | export declare type StepRunnerFunction = <TThis = any>(this: TThis, instruction: NavigationInstruction, next: Next) => any;
|
828 |
|
829 |
|
830 |
|
831 | export declare class Pipeline {
|
832 | |
833 |
|
834 |
|
835 |
|
836 | steps: StepRunnerFunction[];
|
837 | |
838 |
|
839 |
|
840 |
|
841 |
|
842 | addStep(step: StepRunnerFunction | PipelineStep | IPipelineSlot): Pipeline;
|
843 | |
844 |
|
845 |
|
846 |
|
847 |
|
848 | run(instruction: NavigationInstruction): Promise<PipelineResult>;
|
849 | }
|
850 |
|
851 |
|
852 |
|
853 | export declare class PipelineProvider {
|
854 | constructor(container: Container);
|
855 | /**
|
856 | * Create the navigation pipeline.
|
857 | */
|
858 | createPipeline(useCanDeactivateStep?: boolean): Pipeline;
|
859 | /**
|
860 | * Adds a step into the pipeline at a known slot location.
|
861 | */
|
862 | addStep(name: string, step: PipelineStep | Function): void;
|
863 | /**
|
864 | * Removes a step from a slot in the pipeline
|
865 | */
|
866 | removeStep(name: string, step: PipelineStep): void;
|
867 | /**
|
868 | * Resets all pipeline slots
|
869 | */
|
870 | reset(): void;
|
871 | }
|
872 | /**
|
873 | * The main application router.
|
874 | */
|
875 | export declare class AppRouter extends Router {
|
876 | events: EventAggregator;
|
877 | constructor(container: Container, history: History, pipelineProvider: PipelineProvider, events: EventAggregator);
|
878 | /**
|
879 | * Fully resets the router's internal state. Primarily used internally by the framework when multiple calls to setRoot are made.
|
880 | * Use with caution (actually, avoid using this). Do not use this to simply change your navigation model.
|
881 | */
|
882 | reset(): void;
|
883 | /**
|
884 | * Loads the specified URL.
|
885 | *
|
886 | * @param url The URL fragment to load.
|
887 | */
|
888 | loadUrl(url: string): Promise<NavigationInstruction>;
|
889 | /**
|
890 | * Registers a viewPort to be used as a rendering target for activated routes.
|
891 | *
|
892 | * @param viewPort The viewPort. This is typically a <router-view/> element in Aurelia default impl
|
893 | * @param name The name of the viewPort. 'default' if unspecified.
|
894 | */
|
895 | registerViewPort(viewPort: any, name?: string): Promise<any>;
|
896 | /**
|
897 | * Activates the router. This instructs the router to begin listening for history changes and processing instructions.
|
898 | *
|
899 | * @params options The set of options to activate the router with.
|
900 | */
|
901 | activate(options?: NavigationOptions): void;
|
902 | /**
|
903 | * Deactivates the router.
|
904 | */
|
905 | deactivate(): void;
|
906 | }
|
907 | /**
|
908 | * A pipeline step responsible for finding and activating method `canDeactivate` on a view model of a route
|
909 | */
|
910 | export declare class CanDeactivatePreviousStep {
|
911 | run(navigationInstruction: NavigationInstruction, next: Next): Promise<any>;
|
912 | }
|
913 |
|
914 |
|
915 |
|
916 | export declare class CanActivateNextStep {
|
917 | run(navigationInstruction: NavigationInstruction, next: Next): Promise<any>;
|
918 | }
|
919 |
|
920 |
|
921 |
|
922 | export declare class DeactivatePreviousStep {
|
923 | run(navigationInstruction: NavigationInstruction, next: Next): Promise<any>;
|
924 | }
|
925 |
|
926 |
|
927 |
|
928 | export declare class ActivateNextStep {
|
929 | run(navigationInstruction: NavigationInstruction, next: Next): Promise<any>;
|
930 | }
|
931 |
|
932 |
|
933 |
|
934 | export declare class CommitChangesStep {
|
935 | run(navigationInstruction: NavigationInstruction, next: Function): Promise<any>;
|
936 | }
|
937 |
|
938 |
|
939 |
|
940 |
|
941 | export declare class BuildNavigationPlanStep {
|
942 | run(navigationInstruction: NavigationInstruction, next: Next): Promise<any>;
|
943 | }
|
944 |
|
945 |
|
946 |
|
947 |
|
948 | export declare class RouteLoader {
|
949 | |
950 |
|
951 |
|
952 | loadRoute(router: Router, config: RouteConfig, navigationInstruction: NavigationInstruction): Promise< any>;
|
953 | }
|
954 |
|
955 |
|
956 |
|
957 | export declare class LoadRouteStep {
|
958 | constructor(routeLoader: RouteLoader);
|
959 | /**
|
960 | * Run the internal to load route config of a navigation instruction to prepare for next steps in the pipeline
|
961 | */
|
962 | run(navigationInstruction: NavigationInstruction, next: Next): Promise<any>;
|
963 | }
|
964 | /**
|
965 | * A list of known router events used by the Aurelia router
|
966 | * to signal the pipeline has come to a certain state
|
967 | */
|
968 | export declare const enum RouterEvent {
|
969 | Processing = "router:navigation:processing",
|
970 | Error = "router:navigation:error",
|
971 | Canceled = "router:navigation:canceled",
|
972 | Complete = "router:navigation:complete",
|
973 | Success = "router:navigation:success",
|
974 | ChildComplete = "router:navigation:child:complete"
|
975 | }
|
976 |
|
977 |
|
978 |
|
979 | export declare const enum PipelineSlotName {
|
980 | |
981 |
|
982 |
|
983 |
|
984 | Authorize = "authorize",
|
985 | |
986 |
|
987 |
|
988 |
|
989 |
|
990 |
|
991 |
|
992 |
|
993 | PreActivate = "preActivate",
|
994 | |
995 |
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 | PreRender = "preRender",
|
1001 | |
1002 |
|
1003 |
|
1004 | PostRender = "postRender"
|
1005 | } |
\ | No newline at end of file |