diff --git a/types/libxmljs/index.d.ts b/types/libxmljs/index.d.ts index a29a6adeda..6540561a07 100644 --- a/types/libxmljs/index.d.ts +++ b/types/libxmljs/index.d.ts @@ -14,12 +14,48 @@ export const libxml_parser_version: string; // tslint:disable-next-line:strict-export-declare-modifiers interface StringMap { [key: string]: string; } -export function parseXml(source: string, options?: StringMap): Document; -export function parseXmlString(source: string, options?: StringMap): Document; +// tslint:disable-next-line:strict-export-declare-modifiers +interface ParserOptions { + recover?: boolean; + noent?: boolean; + dtdload?: boolean; + doctype?: boolean; + dtdattr?: any; + dtdvalid?: boolean; + noerror?: boolean; + errors?: boolean; + nowarning?: boolean; + warnings?: boolean; + pedantic?: boolean; + noblanks?: boolean; + blanks?: boolean; + sax1?: boolean; + xinclude?: boolean; + nonet?: boolean; + net?: boolean; + nodict?: boolean; + dict?: boolean; + nsclean?: boolean; + implied?: boolean; + nocdata?: boolean; + cdata?: boolean; + noxincnode?: boolean; + compact?: boolean; + old?: boolean; + nobasefix?: boolean; + basefix?: boolean; + huge?: boolean; + oldsax?: boolean; + ignore_enc?: boolean; + big_lines?: boolean; +} -export function parseHtml(source: string, options?: StringMap): Document; -export function parseHtmlString(source: string, options?: StringMap): Document; -export function parseHtmlFragment(source: string, options?: StringMap): Document; +export function parseXml(source: string, options?: ParserOptions): Document; +export function parseXmlString(source: string, options?: ParserOptions): Document; + +export function parseHtml(source: string, options?: ParserOptions): Document; +export function parseHtmlString(source: string, options?: ParserOptions): Document; +export function parseHtmlFragment(source: string, options?: ParserOptions): Document; export function memoryUsage(): number; export function nodeCount(): number; @@ -113,6 +149,7 @@ export class Element extends Node { prevElement(): Element|null; nextElement(): Element|null; addNextSibling(siblingNode: Node): Node; + addPrevSibling(siblingNode: Node): Node; find(xpath: string, ns_uri?: string): Node[]; find(xpath: string, namespaces: StringMap): Node[];