export declare let config: { dev: boolean; debug: boolean; debugStream: boolean; autoRepair: boolean; }; interface ParseResult { res: string; data: T; } export declare abstract class Node { abstract outerHTML: string; abstract minifiedOuterHTML: string; abstract textContent: string | null; childNodes?: Node[]; forEachChildNode(f: (node: Node, idx: number, childNodes: Node[]) => void): void; abstract clone(): this; } export interface NodeConstructor { name: string; new (): T; parse(html: string): ParseResult; } export declare function walkNode(node: Node, f: (node: Node, parent: Node, idx: number) => void, parent?: Node, idx?: number): void; export declare function walkNodeReversed(node: Node, f: (node: Node, parent: Node, idx: number) => void, parent?: Node): void; /** * trim the left and right whitespace, but preserve at most one whitespace if it exist * */ export declare function trimText(s: string): string; export declare class Text extends Node { outerHTML: string; clone(): this; get minifiedOuterHTML(): string; get textContent(): string; static parse(html: string): ParseResult; } export interface Attr { name: string; extraAfterName?: string; extraBeforeValue?: string; value?: string; } export declare class Attributes extends Node { attrs: Array; textContent: null; clone(): this; get outerHTML(): string; get minifiedOuterHTML(): string; forEachAttr(f: (attr: Attr) => void): void; hasName(name: string): boolean; getValue(name: string): string | undefined; static parse(html: string): ParseResult; } export declare function isTagName(node: Node, tagName: string): boolean; export declare function isAnyTagName(node: Node, tagNames: string[]): boolean; export declare class HTMLElement extends Node { tagName: string; noBody?: boolean; attributes?: Attributes; notClosed: boolean; extraClosing?: boolean; clone(): this; get innerHTML(): string; get outerHTML(): string; get minifiedOuterHTML(): string; get textContent(): string; /** * @param tagName assume to be in lower case * TODO optimize this part if possible * */ isTagName(tagName: string): boolean; /** * @param tagNames assume to be in lower case * TODO optimize this part if possible * */ isAnyTagName(tagNames: string[]): boolean; hasText(): boolean; /** * not including this element * */ getElementsByTagName(tagName: string): HTMLElement[]; /** * not including this element * */ hasElementByTagName(tagName: string): boolean; /** * not including this element * */ hasElementByAnyTagName(tagNames: string[]): boolean; static parse(html: string): ParseResult; } /** * including the given node * */ export declare function getElementByTagName(node: Node, tagName: string): HTMLElement | undefined; /** * including the given node * */ export declare function getElementsByTagName(node: Node, tagName: string): HTMLElement[]; /** * including the given node * */ export declare function hasElementByTagName(node: Node, tagName: string): boolean; /** * including the given node * */ export declare function hasElementByAnyTagName(node: Node, tagNames: string[]): boolean; export declare class Command extends HTMLElement { constructor(); get outerHTML(): string; get minifiedOuterHTML(): string; static parse(html: string): ParseResult; } export declare class Comment extends Command { tagName: string; content: string; clone(): this; get outerHTML(): string; get minifiedOuterHTML(): string; static parse(html: string): ParseResult; } export declare abstract class DSLElement extends HTMLElement { get textContent(): string; set textContent(value: string); get outerHTML(): string; get minifiedOuterHTML(): string; abstract minifiedTextContent: string; private _textContent; clone(): this; } export declare class Style extends DSLElement { get minifiedTextContent(): string; } export declare class Script extends DSLElement { get minifiedTextContent(): string; } export declare class Document extends Node { childNodes: Node[]; clone(): this; get outerHTML(): string; get minifiedOuterHTML(): string; get textContent(): string; static parse(html: string): ParseResult; } export declare function parseHtmlDocument(html: string, skipTrim?: boolean): Document; /**@deprecated*/ export declare let parseHtml: typeof parseHtmlDocument; export declare function wrapNode(node: Node): any; export declare function logNode(node: Node): void; export declare let NodeClasses: Array; export {};