UNPKG

tdesign-react

Version:
40 lines (39 loc) 1.13 kB
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; }; /** * 获取当前主题下的token色值 * --td-bg-color-specialcomponent 背景色token * --td-text-color-primary 字体颜色token * @returns string */ export declare function getCurrentPrimaryColor(token: string): string;