/** * 从当前节点往上遍历dom结构,直到根 * @param el * @param fn * @param root 指定根节点 */ export declare const elementForEach: (el: HTMLElement, fn: (el: HTMLElement) => void, root?: HTMLElement) => void; /** * 从当前节点往上遍历dom结构,返回满足条件的第一个dom * @param el * @param fn * @param option.root 指定根节点 * @returns */ export declare const elementFind: (el: Node, fn: (el: HTMLElement, index?: number) => boolean | undefined, option?: { root?: HTMLElement | undefined | null; }) => Node | undefined; /** * 设置元素样式或者获取元素样式 * @param el * @param style */ export declare const elementStyle: (el: HTMLElement, style: object) => void; /** * 获取元素属性 * @param el * @param attrName * @returns */ export declare const getElementAttr: (el: HTMLElement, attrName: string) => string | null; /** * 获取dom节点的xpath * @param el 节点 * @param option.full 从根节点html开始 * @param option.mode 生成模式 默认宽松模式 * @param option.endTag 结束标签,向上遍历时遇到该标签以它作为结尾 */ export declare const getElementXpath: (el: HTMLElement, option?: { full?: boolean; mode?: 'loose' | 'ordinary' | 'strict'; endTag?: any[]; }) => string; /** * 解析html Xpath为dom对象 * @param xpath * @returns */ export declare const useElementXpath: (xpath: string) => Node[];