libxmljs
Version:
libxml bindings for v8 javascript engine
21 lines (20 loc) • 1.55 kB
TypeScript
/// <reference types="node" />
import { HTMLDocument, XMLDocument } from "./document";
import { XMLElement, XMLText, XMLNamespace } from "./node";
import { parseHtml, parseHtmlAsync, parseXml, parseXmlAsync } from "./parse";
import { SaxParser, SaxPushParser } from "./sax";
import { HTMLParseOptions, XMLParseOptions } from "./types";
declare function Document(_ref?: null | string | Buffer, encoding?: string): XMLDocument;
declare namespace Document {
var fromXml: (buffer: string | Buffer, options?: XMLParseOptions | undefined) => XMLDocument;
var fromXmlAsync: (buffer: string | Buffer, options: XMLParseOptions) => Promise<XMLDocument>;
var fromHtml: (buffer: string | Buffer, options?: HTMLParseOptions | undefined) => HTMLDocument;
var fromHtmlAsync: (buffer: string | Buffer, options: HTMLParseOptions) => Promise<HTMLDocument>;
var fromHtmlFragment: (buffer: string, options?: HTMLParseOptions | undefined) => HTMLDocument;
}
declare function Element(_ref: XMLDocument, name: string, content?: string): XMLElement;
declare function Text(document: XMLDocument, content?: string): XMLText;
declare function Comment(document: XMLDocument, content?: string): XMLText;
declare function ProcessingInstruction(document: XMLDocument, name: string, content?: string): XMLText;
declare function Namespace(node: XMLElement, prefix: string, href: string): XMLNamespace;
export { Document, Element, Text, Comment, ProcessingInstruction, Namespace, parseXml, parseXmlAsync, parseHtml, parseHtmlAsync, SaxParser, SaxPushParser };