import { Observable , animationFrameScheduler , auditTime , fromEvent , map , merge , startWith } from "rxjs" ; /**
 * Element offset
 */ export interface ElementOffset { x : number ; y : number ; } param el returns export function getElementOffset ( el ) { return { x : el . offsetLeft , y : el . offsetTop } ; } param el returns export function watchElementOffset ( el ) { return merge ( fromEvent ( window , "load" ) , fromEvent ( window , "resize" ) ) . pipe ( auditTime ( 0 , animationFrameScheduler ) , map ( ( ) => getElementOffset ( el ) ) , startWith ( getElementOffset ( el ) ) ) ; }