@@ -8,7 +8,7 @@ import { NavControllerBase } from './nav-controller-base';
8
8
import { Transition } from '../transitions/transition' ;
9
9
10
10
11
- export function getComponent ( linker : DeepLinker , nameOrPageOrView : any , params ?: any ) {
11
+ export function getComponent ( linker : DeepLinker , nameOrPageOrView : any , params ?: any ) : Promise < ViewController > {
12
12
if ( typeof nameOrPageOrView === 'function' ) {
13
13
return Promise . resolve (
14
14
new ViewController ( nameOrPageOrView , params )
@@ -24,7 +24,7 @@ export function getComponent(linker: DeepLinker, nameOrPageOrView: any, params?:
24
24
return Promise . resolve ( null ) ;
25
25
}
26
26
27
- export function convertToView ( linker : DeepLinker , nameOrPageOrView : any , params : any ) {
27
+ export function convertToView ( linker : DeepLinker , nameOrPageOrView : any , params : any ) : Promise < ViewController > {
28
28
if ( nameOrPageOrView ) {
29
29
if ( isViewController ( nameOrPageOrView ) ) {
30
30
// is already a ViewController
@@ -34,11 +34,10 @@ export function convertToView(linker: DeepLinker, nameOrPageOrView: any, params:
34
34
return getComponent ( linker , nameOrPageOrView , params ) ;
35
35
}
36
36
37
- console . error ( `invalid page component: ${ nameOrPageOrView } ` ) ;
38
37
return Promise . resolve ( null ) ;
39
38
}
40
39
41
- export function convertToViews ( linker : DeepLinker , pages : any [ ] ) {
40
+ export function convertToViews ( linker : DeepLinker , pages : any [ ] ) : Promise < ViewController [ ] > {
42
41
const views : Promise < ViewController > [ ] = [ ] ;
43
42
if ( isArray ( pages ) ) {
44
43
for ( var i = 0 ; i < pages . length ; i ++ ) {
@@ -147,6 +146,14 @@ export interface NavLink {
147
146
defaultHistory ?: any [ ] ;
148
147
}
149
148
149
+ export interface NavResult {
150
+ hasCompleted : boolean ;
151
+ requiresTransition : boolean ;
152
+ enteringName ?: string ;
153
+ leavingName ?: string ;
154
+ direction ?: string ;
155
+ }
156
+
150
157
export interface NavSegment {
151
158
id : string ;
152
159
name : string ;
@@ -188,12 +195,13 @@ export interface TransitionRejectFn {
188
195
export interface TransitionInstruction {
189
196
opts : NavOptions ;
190
197
insertStart ?: number ;
191
- insertViews ?: ViewController [ ] ;
198
+ insertViews ?: any [ ] ;
192
199
removeView ?: ViewController ;
193
200
removeStart ?: number ;
194
201
removeCount ?: number ;
195
- resolve ?: TransitionResolveFn ;
196
- reject ?: TransitionRejectFn ;
202
+ resolve ?: ( hasCompleted : boolean ) => void ;
203
+ reject ?: ( rejectReason : string ) => void ;
204
+ done ?: Function ;
197
205
leavingRequiresTransition ?: boolean ;
198
206
enteringRequiresTransition ?: boolean ;
199
207
requiresTransition ?: boolean ;
0 commit comments