UNPKG

@opensig/opendesign

Version:

<p align="center"><img src="../docs/public/opendesign-logo-light.png"/></p> <h1 align="center">opendesign</h1> <p align="center">一个 Vue 3 组件库</p> <p align="center"><b>皮肤可定制,使用 TypeScript</b></p>

58 lines (57 loc) 1.98 kB
import { PositionT } from './types'; export type ScrollTarget = HTMLElement | Window | Document; export declare function isDocument(val: unknown): val is Document; export declare function isHtmlElement(el: unknown): el is HTMLElement; export declare function getOffsetElement(el: HTMLElement): Element | null; export declare function getScroll(el: ScrollTarget): { scrollLeft: number; scrollTop: number; }; export declare function getScrollParents(el: HTMLElement): HTMLElement[]; export declare function getRelativeBounding(e: DOMRect, c: DOMRect): { top: number; bottom: number; left: number; right: number; width: number; height: number; offsetLeft: number; offsetTop: number; offsetRight: number; offsetBottom: number; }; export type RelativeRect = ReturnType<typeof getRelativeBounding>; export declare function getElementSize(el: HTMLElement | Window): { width: number; height: number; offsetWidth: number; offsetHeight: number; }; export declare function getElementBorder(el: HTMLElement, dir?: PositionT | PositionT[]): { left?: number; right?: number; top?: number; bottom?: number; }; export declare function getCssVariable(key: string, el?: HTMLElement): string; export declare function supportTouch(): boolean; export declare function mergeClass(...classList: Array<string | any[] | undefined>): any[]; interface ScrollTopOptions { container?: ScrollTarget; duration?: number; } export declare function scrollTo(y: number, opts: ScrollTopOptions): Promise<unknown>; export declare function isOverflown(element?: HTMLElement): boolean; /** * 判断元素是否在视口内 */ export declare function isInViewport(element?: Element): boolean; /** * 判断是否为不可见标签 */ export declare function isNonVisibleTag(element: Element): boolean; /** * 判断元素是否在视觉上隐藏 */ export declare function isElementHidden(element: HTMLElement): boolean; export {};