import type { AstNodes, Token, HtmlToken, ExtToken } from '../internal';
import type { TokenTypeMap, SelectedTokenTypes } from '../map';
declare type ElementConstructor = abstract new (...args: any[]) => {
readonly parentNode: Token | undefined;
readonly childNodes: readonly AstNodes[];
detach?: () => void;
};
export interface ElementLike {
/** all child elements / 全部非文本子节点 */
readonly children: Token[];
/** first child element / 首位非文本子节点 */
readonly firstElementChild: Token | undefined;
/** last child element / 末位非文本子节点 */
readonly lastElementChild: Token | undefined;
/** number of child elements / 非文本子节点总数 */
readonly childElementCount: number;
/**
* Get the closest ancestor node that matches the selector
*
* 最近的符合选择器的祖先节点
* @param selector selector / 选择器
* @throws `SyntaxError` if the selector is invalid
*/
closest(selector: K): TokenTypeMap[K] | undefined;
closest(selector: string): T | undefined;
/**
* Get the first descendant that matches the selector
*
* 符合选择器的第一个后代节点
* @param selector selector / 选择器
* @throws `SyntaxError` if the selector is invalid
*/
querySelector(selector: K): TokenTypeMap[K] | undefined;
querySelector(selector: string): T | undefined;
/**
* Get all descendants that match the selector
*
* 符合选择器的所有后代节点
* @param selector selector / 选择器
* @throws `SyntaxError` if the selector is invalid
*/
querySelectorAll(selector: K): TokenTypeMap[K][];
querySelectorAll(selector: string): T[];
/**
* Escape `=` and `|`
*
* 转义 `=` 和 `|`
* @since v1.18.3
*/
escape(): void;
/**
* Get the first descendant of the types
*
* 类型选择器
* @param types token types / 节点类型
*/
getElementByTypes(types: K): TokenTypeMap[K] | undefined;
getElementByTypes(types: string): T | undefined;
/**
* Get the first descendant with the id
*
* id选择器
* @param id id名
*/
getElementById(id: string): T | undefined;
/**
* Get all descendants with the class
*
* 类选择器
* @param className class name / 类名之一
*/
getElementsByClassName(className: string): T[];
/**
* Get all descendants with the tag name
*
* 标签名选择器
* @param tag tag name / 标签名
*/
getElementsByTagName(tag: string): T[];
}
/** @ignore */