import { Rect } from './rect' ; param node export function getWindow ( node ) { if ( node === null ) return window ; if ( node instanceof Window ) return node ; const ownerDocument = node . ownerDocument ; return ownerDocument ? ownerDocument . defaultView || window : window ; } returns export function getWindowRect ( wnd = window ) { return Rect . from ( { x : wnd . scrollX , y : wnd . scrollY , width : wnd . innerWidth || wnd . document . documentElement . clientWidth , height : wnd . innerHeight || wnd . document . documentElement . clientHeight } ) ; }