@@ -17,7 +17,7 @@ export class StateRegistry {
1717 private builder : StateBuilder ;
1818 stateQueue : StateQueueManager ;
1919
20- constructor ( urlMatcherFactory : UrlMatcherFactory , urlRouterProvider , private currentState : ( ) => State ) {
20+ constructor ( urlMatcherFactory : UrlMatcherFactory , urlRouterProvider ) {
2121 this . matcher = new StateMatcher ( this . states ) ;
2222 this . builder = new StateBuilder ( this . matcher , urlMatcherFactory ) ;
2323 this . stateQueue = new StateQueueManager ( this . states , this . builder , urlRouterProvider ) ;
@@ -44,9 +44,12 @@ export class StateRegistry {
4444 return this . stateQueue . register ( stateDefinition ) ;
4545 }
4646
47- get ( stateOrName : StateOrName , base : StateOrName ) : ( StateDeclaration | StateDeclaration [ ] ) {
48- if ( arguments . length === 0 ) return Object . keys ( this . states ) . map ( name => this . states [ name ] . self ) ;
49- let found = this . matcher . find ( stateOrName , base || this . currentState ( ) ) ;
47+ get ( ) : StateDeclaration [ ] ;
48+ get ( stateOrName : StateOrName , base : StateOrName ) : StateDeclaration ;
49+ get ( stateOrName ?: StateOrName , base ?: StateOrName ) : ( StateDeclaration | StateDeclaration [ ] ) {
50+ if ( arguments . length === 0 )
51+ return < StateDeclaration [ ] > Object . keys ( this . states ) . map ( name => this . states [ name ] . self ) ;
52+ let found = this . matcher . find ( stateOrName , base ) ;
5053 return found && found . self || null ;
5154 }
5255
0 commit comments