export interface ScrollPromise { wait ( ) : Promise < void > | null ; pending : ( ) => void ; resolve : ( ) => void ; } let promise = null ; let promiseResolve = null ; const scrollPromise = { wait : ( ) => promise , pending : ( ) => { promise = new Promise ( ( resolve ) => ( promiseResolve = resolve ) ) ; } , resolve : ( ) => { promiseResolve ?. ( ) ; promise = null ; promiseResolve = null ; } } ; export const useScrollPromise = ( ) : ScrollPromise => scrollPromise ;