@@ -248,6 +248,11 @@ interface OutletState {
248
248
outlets : NestedOutletState ;
249
249
}
250
250
251
+ interface EngineInstance extends Owner {
252
+ boot ( ) : void ;
253
+ destroy ( ) : void ;
254
+ }
255
+
251
256
export interface QueryParam {
252
257
prop : string ;
253
258
urlKey : string ;
@@ -280,6 +285,27 @@ class EmberRouter extends EmberObject {
280
285
rootURL ! : string ;
281
286
_routerMicrolib ! : Router < Route > ;
282
287
288
+ currentURL : string | null = null ;
289
+ currentRouteName : string | null = null ;
290
+ currentPath : string | null = null ;
291
+
292
+ _qpCache = Object . create ( null ) ;
293
+ _qpUpdates = new Set ( ) ;
294
+
295
+ _handledErrors = new Set ( ) ;
296
+ _engineInstances : { [ name : string ] : { [ id : string ] : EngineInstance } } = Object . create ( null ) ;
297
+ _engineInfoByRoute = Object . create ( null ) ;
298
+
299
+ constructor ( ) {
300
+ super ( ...arguments ) ;
301
+
302
+ if ( EMBER_ROUTING_ROUTER_SERVICE ) {
303
+ this . currentRoute = null ;
304
+ }
305
+
306
+ this . _resetQueuedQueryParameterChanges ( ) ;
307
+ }
308
+
283
309
_initRouterJs ( ) {
284
310
let location = get ( this , 'location' ) ;
285
311
let router = this ;
@@ -501,25 +527,6 @@ class EmberRouter extends EmberObject {
501
527
return new EmberRouterDSL ( null , options ) ;
502
528
}
503
529
504
- init ( ) {
505
- this . _super ( ...arguments ) ;
506
-
507
- this . currentURL = null ;
508
- this . currentRouteName = null ;
509
- this . currentPath = null ;
510
-
511
- if ( EMBER_ROUTING_ROUTER_SERVICE ) {
512
- this . currentRoute = null ;
513
- }
514
-
515
- this . _qpCache = Object . create ( null ) ;
516
- this . _qpUpdates = new Set ( ) ;
517
- this . _resetQueuedQueryParameterChanges ( ) ;
518
- this . _handledErrors = new Set ( ) ;
519
- this . _engineInstances = Object . create ( null ) ;
520
- this . _engineInfoByRoute = Object . create ( null ) ;
521
- }
522
-
523
530
/*
524
531
Resets all pending query parameter changes.
525
532
Called after transitioning to a new route
@@ -592,7 +599,7 @@ class EmberRouter extends EmberObject {
592
599
}
593
600
594
601
let routeInfos = this . _routerMicrolib . currentRouteInfos ;
595
- let route ;
602
+ let route : Route | undefined ;
596
603
let defaultParentState : OutletState ;
597
604
let liveRoutes = null ;
598
605
@@ -825,8 +832,8 @@ class EmberRouter extends EmberObject {
825
832
}
826
833
827
834
_setupLocation ( ) {
828
- let location = get ( this , ' location' ) ;
829
- let rootURL = get ( this , ' rootURL' ) ;
835
+ let location = this . location ;
836
+ let rootURL = this . rootURL ;
830
837
let owner = getOwner ( this ) ;
831
838
832
839
if ( 'string' === typeof location && owner ) {
@@ -1732,7 +1739,7 @@ EmberRouter.reopenClass({
1732
1739
} ,
1733
1740
1734
1741
_routePath ( routeInfos : PrivateRouteInfo [ ] ) {
1735
- let path = [ ] ;
1742
+ let path : string [ ] = [ ] ;
1736
1743
1737
1744
// We have to handle coalescing resource names that
1738
1745
// are prefixed with their parent's names, e.g.
0 commit comments