1+ /* eslint-disable ember/no-runloop */
2+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
3+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
14import { warn } from '@ember/debug' ;
25import { isDestroyed , isDestroying , registerDestructor } from '@ember/destroyable' ;
36import { getOwner } from '@ember/owner' ;
@@ -17,10 +20,10 @@ type TransitionWithPrivateAPIs = Transition & {
1720
1821export function withHashSupport ( AppRouter : typeof EmberRouter ) : typeof AppRouter {
1922 return class RouterWithHashSupport extends AppRouter {
20- constructor ( ...args : RouterArgs ) {
23+ constructor ( ...args : any [ ] ) {
2124 super ( ...args ) ;
2225
23- setupHashSupport ( this ) ;
26+ void setupHashSupport ( this ) ;
2427 }
2528 } ;
2629}
@@ -93,7 +96,7 @@ async function setupHashSupport(router: EmberRouter) {
9396 *
9497 */
9598 requestAnimationFrame ( ( ) => {
96- eventuallyTryScrollingTo ( owner , initialURL ) ;
99+ void eventuallyTryScrollingTo ( owner , initialURL ) ;
97100 } ) ;
98101
99102 const routerService = owner . lookup ( 'service:router' ) ;
@@ -105,21 +108,21 @@ async function setupHashSupport(router: EmberRouter) {
105108 return ;
106109 }
107110
108- eventuallyTryScrollingTo ( owner , url ) ;
111+ void eventuallyTryScrollingTo ( owner , url ) ;
109112 }
110113
114+ // @ts -expect-error -- I don't want to fix this
111115 routerService . on ( 'routeDidChange' , handleHashIntent ) ;
112116
113117 registerDestructor ( router , ( ) => {
114- ( routerService as any ) /* type def missing "off" */
115- . off ( 'routeDidChange' , handleHashIntent ) ;
118+ routerService . off ( 'routeDidChange' , handleHashIntent ) ;
116119 } ) ;
117120}
118121
119122const CACHE = new WeakMap < ApplicationInstance , MutationObserver > ( ) ;
120123
121124async function eventuallyTryScrollingTo ( owner : ApplicationInstance , url ?: string ) {
122- // Prevent quick / rapid transitions from continuing to observer beyond their URL-scope
125+ // Prevent quick / rapid transitions from continuing to observe beyond their URL-scope
123126 CACHE . get ( owner ) ?. disconnect ( ) ;
124127
125128 if ( ! url ) return ;
@@ -140,7 +143,11 @@ async function eventuallyTryScrollingTo(owner: ApplicationInstance, url?: string
140143const TIME_SINCE_LAST_MUTATION = 500 ; // ms
141144const MAX_TIMEOUT = 2000 ; // ms
142145
143- // exported for testing
146+ /**
147+ * exported for testing
148+ *
149+ * @internal
150+ */
144151export async function uiSettled ( owner : ApplicationInstance ) {
145152 const timeStarted = new Date ( ) . getTime ( ) ;
146153 let lastMutationAt = Infinity ;
0 commit comments