2015-08-20 14:28:25 -07:00
|
|
|
import {CONST, Type} from 'angular2/src/core/facade/lang';
|
2015-07-13 16:12:48 -07:00
|
|
|
|
2015-09-21 14:43:24 -07:00
|
|
|
/**
|
|
|
|
* `RouteDefinition` defines a route within a {@link RouteConfig} decorator.
|
|
|
|
*
|
|
|
|
* Supported keys:
|
|
|
|
* - `path` (required)
|
|
|
|
* - `component`, `loader`, `redirectTo` (requires exactly one of these)
|
2015-10-25 15:00:27 +05:30
|
|
|
* - `name` or `as` (optional) (requires exactly one of these)
|
2015-09-21 14:43:24 -07:00
|
|
|
* - `data` (optional)
|
|
|
|
*
|
|
|
|
* See also {@link Route}, {@link AsyncRoute}, {@link AuxRoute}, and {@link Redirect}.
|
|
|
|
*/
|
2015-07-13 16:12:48 -07:00
|
|
|
export interface RouteDefinition {
|
|
|
|
path: string;
|
|
|
|
component?: Type | ComponentDefinition;
|
|
|
|
loader?: Function;
|
|
|
|
redirectTo?: string;
|
|
|
|
as?: string;
|
2015-10-25 15:00:27 +05:30
|
|
|
name?: string;
|
2015-08-10 20:29:40 -04:00
|
|
|
data?: any;
|
2015-07-13 16:12:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ComponentDefinition {
|
|
|
|
type: string;
|
|
|
|
loader?: Function;
|
|
|
|
component?: Type;
|
|
|
|
}
|