UNPKG

node-html-parser

Version:

A very fast HTML parser, generating a simplified DOM, with basic element query support.

25 lines (24 loc) 671 B
import NodeType from './type'; import HTMLElement from './html'; /** * Node Class as base class for TextNode and HTMLElement. */ export default abstract class Node { parentNode: HTMLElement; abstract rawTagName: string; abstract nodeType: NodeType; childNodes: Node[]; range: readonly [number, number]; abstract text: string; abstract rawText: string; abstract toString(): string; abstract clone(): Node; constructor(parentNode?: HTMLElement, range?: [number, number]); /** * Remove current node */ remove(): this; get innerText(): string; get textContent(): string; set textContent(val: string); }