/* tslint:disable */ /* eslint-disable */ /* auto-generated by NAPI-RS */ /** * Parse string input to a html tree, return the root node. * */ function parse(html: string): NodeRepr export declare class NodeRepr { /** * Append a child node to this node, after existing children. * * The child node will be remove from its previous position. * */ append(newChild: NodeRepr): void /** * Append some children nodes to this node by order, after existing children. * * These children nodes will be remove from their previous position. * */ appendSequence(newChildren: Array): void /** * Prepend a child node to this node, before existing children. * * The child node will be remove from its previous position. * */ prepend(newChild: NodeRepr): void /** * Prepend some children nodes to this node by order, before existing children. * * These children nodes will be remove from their previous position. * */ prependSequence(newChildren: Array): void /** * Insert a new sibling after this node. * * The sibling node will be remove from its previous position. * */ insertAfter(newSibling: NodeRepr): void /** * Insert some siblings after this node. * * These sibling nodes will be remove from their previous position. * */ insertSequenceAfter(newSiblings: Array): void /** * Insert a new sibling before this node. * * The sibling node will be remove from its previous position. * */ insertBefore(newSibling: NodeRepr): void /** * Insert some siblings before this node. * * These sibling nodes will be remove from their previous position. * */ insertSequenceBefore(newSiblings: Array): void /** * Remove a node from its parent and siblings. Children are not affected. * */ remove(): void /** * Assign an attribute K-V to this node * */ setAttribute(name: string, value: string): void /** * Assign attributes K-V object to this node. * */ setAttributes(attrs: Record): void /** * Remove an attribute of this node by name. * */ removeAttribute(name: string): void /** *Remove all attributes of this node. * */ removeAllAttributes(): void /** * Select the the fist node that match the given css selector, like document.querySelector. * */ select(selectors: string): NodeRepr | null /** * Select all nodes that match the given css selector, like document.querySelectorAll. * */ selectAll(selectors: string): Array /** * Get all children nodes of this node. * */ getChildren(): Array /** * Get attribute value of this node by given name. * */ getAttribute(name: string): string | null /** * Get attributes K-V object of this node. * */ getAttributes(): Record /** * Get the serialized html of this node, including its all descendants and itelf. * */ outerHtml(): string /** * Get the serialized html of this node, only including its all descendants. * */ innerHtml(): string /** * Get all text nodes content of this node, including its all descendants and itelf. * */ text(): string /** * The node object, cann't be instantiated in javascript. So call the constructor will throw an error. * */ constructor(): void /** * Clone this node to a new instance, not clone its descendants. * */ clone(): NodeRepr /** * Clone this node to a new instance, including its all descendants. * */ cloneRecursive(): NodeRepr } export declare interface NodeRepr { select(selectors: "html"): NodeRepr; select(selectors: "head"): NodeRepr; select(selectors: "body"): NodeRepr; }