import type { AstNodes, Token } from '../internal'; import type { TokenTypeMap, SelectedTokenTypes } from '../map'; declare type ElementConstructor = abstract new (...args: any[]) => { readonly parentNode: Token | undefined; readonly childNodes: readonly AstNodes[]; }; export interface ElementLike { /** * Get the closest ancestor node that matches the selector * * 最近的符合选择器的祖先节点 * @param selector selector / 选择器 */ closest(selector: K): TokenTypeMap[K] | undefined; closest(selector: string): T | undefined; /** * Get the first descendant that matches the selector * * 符合选择器的第一个后代节点 * @param selector selector / 选择器 */ querySelector(selector: K): TokenTypeMap[K] | undefined; querySelector(selector: string): T | undefined; /** * Get all descendants that match the selector * * 符合选择器的所有后代节点 * @param selector selector / 选择器 */ querySelectorAll(selector: K): TokenTypeMap[K][]; querySelectorAll(selector: string): T[]; /** * Escape `=` and `|` * * 转义 `=` 和 `|` * @since v1.18.3 */ escape(): void; } /** @ignore */