Permalink
Browse files

feat(type declarations): Refine the type

signature of the activationStrategy enumeration with additional
information

Added the ActivationStrategy interface to describe the shape of the
activationStrategy object that enumerates router activation strategies.
  • Loading branch information...
aluanhaddad committed Aug 5, 2017
1 parent c45b91c commit 638aef4df4b99af20461e08e2a35e95abca848e2
Showing with 19 additions and 1 deletion.
  1. +18 −0 src/interfaces.js
  2. +1 −1 src/navigation-plan.js
View
@@ -170,3 +170,21 @@ interface ConfiguresRouter {
*/
configureRouter(config: RouterConfiguration, router: Router): Promise<void>|PromiseLike<void>|void;
}
/**
* An optional interface describing the available activation strategies.
*/
interface ActivationStrategy {
/**
* Reuse the existing the view model without invoking lifecycle hooks.
*/
noChange: 'no-change';
/**
* Reuse the existing the view model, invoke Router lifecycle hooks.
*/
invokeLifecycle: 'invoke-lifecycle';
/**
* Replace the existing view model, invoking Router lifecycle hooks.
*/
replace: 'replace';
}
View
@@ -4,7 +4,7 @@ import {_resolveUrl} from './util';
/**
* The strategy to use when activating modules during navigation.
*/
export const activationStrategy = {
export const activationStrategy: ActivationStrategy = {
noChange: 'no-change',
invokeLifecycle: 'invoke-lifecycle',
replace: 'replace'

0 comments on commit 638aef4

Please sign in to comment.