UNPKG

tdesign-react

Version:
33 lines (32 loc) 895 B
export declare const canUseDocument: boolean; /** * 返回是否 window 对象 * * @export * @param {any} obj * @returns */ export declare const isWindow: (val: unknown) => val is Window; export declare const getAttach: (node: any) => HTMLElement; /** * 检查元素是否在父元素视图 * http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport * @param elm 元素 * @param parent * @returns boolean */ export declare function elementInViewport(elm: HTMLElement, parent?: HTMLElement): boolean; /** * 判断元素是否处在 position fixed 中 * @param element 元素 * @returns boolean */ export declare function isFixed(element: HTMLElement): boolean; /** * 获取当前视图的大小 * @returns { width: number, height: number } */ export declare function getWindowSize(): { width: number; height: number; };