UNPKG

docxml

Version:

TypeScript (component) library for building and parsing a DOCX file

30 lines (29 loc) 1.16 kB
/** * Serialize an XML node to string using Slimdom's own serializer function, but with the "standard" * typing that Deno has for Node and Document. */ export declare function serialize(node: Node | Document): string; /** * Parse an XML string to DOM using Slimdom's own parser function, but with the "standard" * typing that Deno has for Node and Document -- so that type matching is not complicated further * down the line. */ export declare function parse(xml: string): Document; declare type UnknownObject = { [key: string]: unknown; }; /** * Create a new XML DOM node using XQuery. */ export declare function create(query: string, variables?: UnknownObject, asDocument?: false): Node; /** * Create a new XML DOM element using XQuery, and return it as a Document. */ export declare function create(query: string, variables: UnknownObject, asDocument: true): Document; /** * Run an XQuery Update Facility expression, maybe even repeatedly, which can change an existing DOM. * * Updates by references, returns an empty promise. */ export declare function update(dom: Node | Document, expression: string, times?: number): void; export {};