export interface Node { /** * Node type */ type: "text" | "tag"; /** * The starts position of the source */ start?: number; /** * The ends position of the source */ end?: number; } export interface TextNode extends Node { /** * the text */ text: string; } export interface TagNode extends Node { /** * tag name */ name: string; /** * properties, if don't have any properties, then properties is `undefined` */ properties?: Properties; /** * children array, if is a void tag, then children is `undefined` */ children?: NodeChildren; } export declare type NodeChildren = Array; export interface ErrorMessage { /** * position offset, start from 0 */ position: number; /** * error message */ message: string; } export interface Properties { [key: string]: string | boolean; } export interface Result { errors: ErrorMessage[]; nodes: NodeChildren; xmlMode: boolean; } export interface ParseOptions { /** * parse source on XML document mode */ xmlMode?: boolean; /** * don't returns node position `{ start, end }` */ removePosition?: boolean; } /** * parse HTML source and returns parsed Nodes * @param input HTML source */ export declare function parse(input: string, options?: ParseOptions): Result;