import { ElementHandle } from 'playwright' ; declare const window ; export async function hasHandleFocus ( selector ) { if ( selector === undefined || selector === null ) { return false ; } const result = await selector . evaluate ( ( el ) : boolean => { const focusedElement = window . document . activeElement ; if ( ! focusedElement ) { return false ; } if ( focusedElement . tagName !== el . tagName ) { return false ; } return focusedElement . isSameNode ( el ) ; } ) ; return result ; }