import { ElementHandle } from 'playwright' ; declare const IntersectionObserver ; declare function requestAnimationFrame ( callback ) ; export async function getIntersectionRatioOfHandle ( selector ) { if ( ! selector ) { return - 1 ; } const result = await selector . evaluate ( async ( el ) : Promise < number > => { const visibleRatio = await new Promise < number > ( ( resolve ) => { const observer = new IntersectionObserver ( ( entries ) => { resolve ( entries [ 0 ] . intersectionRatio ) ; observer . disconnect ( ) ; } ) ; observer . observe ( el ) ; requestAnimationFrame ( ( ) => { } ) ; } ) ; return visibleRatio ; } ) ; return result ; }