|
| 1 | +/* auto-generated by NAPI-RS */ |
| 2 | +/* eslint-disable */ |
| 3 | +export declare class NodeRepr { |
| 4 | + /** |
| 5 | + * Append a child node to this node, after existing children. |
| 6 | + * |
| 7 | + * The child node will be remove from its previous position. |
| 8 | + */ |
| 9 | + append(newChild: NodeRepr): void |
| 10 | + appendChild(newChild: NodeRepr): NodeRepr |
| 11 | + removeChild(child: NodeRepr): NodeRepr |
| 12 | + /** |
| 13 | + * Prepend a child node to this node, before existing children. |
| 14 | + * |
| 15 | + * The child node will be remove from its previous position. |
| 16 | + */ |
| 17 | + prepend(newChild: NodeRepr): void |
| 18 | + /** |
| 19 | + * Insert a new sibling after this node. |
| 20 | + * |
| 21 | + * The sibling node will be remove from its previous position. |
| 22 | + */ |
| 23 | + after(newSibling: NodeRepr): void |
| 24 | + /** |
| 25 | + * Insert a new sibling before this node. |
| 26 | + * |
| 27 | + * The sibling node will be remove from its previous position. |
| 28 | + */ |
| 29 | + before(newSibling: NodeRepr): void |
| 30 | + insertBefore(newNode: NodeRepr, refNode?: NodeRepr | undefined | null): NodeRepr |
| 31 | + /** Remove a node from its parent and siblings. Children are not affected. */ |
| 32 | + remove(): void |
| 33 | + /** Assign an attribute K-V to this node */ |
| 34 | + setAttribute(name: string, value: string): void |
| 35 | + /** Remove an attribute of this node by name. */ |
| 36 | + removeAttribute(name: string): void |
| 37 | + toggleAttribute(name: string, force?: boolean | undefined | null): boolean |
| 38 | + setAttributeNS(namespace: string | undefined | null, name: string, value: string): void |
| 39 | + removeAttributeNS(namespace: string | undefined | null, localName: string): void |
| 40 | + createElement(tagName: string): NodeRepr |
| 41 | + createTextNode(data: string): NodeRepr |
| 42 | + createComment(data: string): NodeRepr |
| 43 | + createDocumentFragment(): NodeRepr |
| 44 | + createProcessingInstruction(target: string, data: string): NodeRepr |
| 45 | + importNode(externalNode: NodeRepr, deep?: boolean | undefined | null): NodeRepr |
| 46 | + adoptNode(externalNode: NodeRepr): NodeRepr |
| 47 | + replaceChild(newChild: NodeRepr, oldChild: NodeRepr): NodeRepr |
| 48 | + replaceWith(newNode: NodeRepr): void |
| 49 | + insertAdjacentElement(position: string, element: NodeRepr): NodeRepr | null |
| 50 | + insertAdjacentText(position: string, data: string): void |
| 51 | + insertAdjacentHTML(position: string, html: string): void |
| 52 | + normalize(): void |
| 53 | + splitText(offset: number): NodeRepr |
| 54 | + substringData(offset: number, count: number): string |
| 55 | + appendData(data: string): void |
| 56 | + insertData(offset: number, data: string): void |
| 57 | + deleteData(offset: number, count: number): void |
| 58 | + replaceData(offset: number, count: number, data: string): void |
| 59 | + get nodeType(): number |
| 60 | + get nodeName(): string |
| 61 | + get tagName(): string | null |
| 62 | + get namespaceURI(): string | null |
| 63 | + get prefix(): string | null |
| 64 | + get localName(): string | null |
| 65 | + get id(): string |
| 66 | + set id(id: string) |
| 67 | + get className(): string |
| 68 | + set className(className: string) |
| 69 | + get parentNode(): NodeRepr | null |
| 70 | + get firstChild(): NodeRepr | null |
| 71 | + get lastChild(): NodeRepr | null |
| 72 | + get previousSibling(): NodeRepr | null |
| 73 | + get nextSibling(): NodeRepr | null |
| 74 | + get parentElement(): NodeRepr | null |
| 75 | + get firstElementChild(): NodeRepr | null |
| 76 | + get lastElementChild(): NodeRepr | null |
| 77 | + get previousElementSibling(): NodeRepr | null |
| 78 | + get nextElementSibling(): NodeRepr | null |
| 79 | + get children(): Array<NodeRepr> |
| 80 | + get childElementCount(): number |
| 81 | + getRootNode(): NodeRepr |
| 82 | + get nodeValue(): string | null |
| 83 | + set nodeValue(value?: string | undefined | null) |
| 84 | + get data(): string | null |
| 85 | + set data(value: string) |
| 86 | + get textContent(): string |
| 87 | + set textContent(text: string) |
| 88 | + isSameNode(otherNode: NodeRepr): boolean |
| 89 | + get innerHTML(): string |
| 90 | + set innerHTML(html: string) |
| 91 | + get outerHTML(): string |
| 92 | + set outerHTML(html: string) |
| 93 | + get ownerDocument(): NodeRepr | null |
| 94 | + get childNodes(): Array<NodeRepr> |
| 95 | + get isConnected(): boolean |
| 96 | + get doctype(): NodeRepr | null |
| 97 | + get publicId(): string |
| 98 | + get systemId(): string |
| 99 | + get name(): string |
| 100 | + get target(): string |
| 101 | + classListAdd(className: string): void |
| 102 | + classListRemove(className: string): void |
| 103 | + classListToggle(className: string, force?: boolean | undefined | null): boolean |
| 104 | + classListContains(className: string): boolean |
| 105 | + datasetGet(): Record<string, string> |
| 106 | + datasetSet(key: string, value: string): void |
| 107 | + datasetRemove(key: string): void |
| 108 | + /** Select the the fist node that match the given css selector, like document.querySelector. */ |
| 109 | + select(selectors: string): NodeRepr | null |
| 110 | + /** Select all nodes that match the given css selector, like document.querySelectorAll. */ |
| 111 | + selectAll(selectors: string): Array<NodeRepr> |
| 112 | + /** Get all children nodes of this node. */ |
| 113 | + getChildren(): Array<NodeRepr> |
| 114 | + /** Get attribute value of this node by given name. */ |
| 115 | + getAttribute(name: string): string | null |
| 116 | + /** Get attributes K-V object of this node. */ |
| 117 | + getAttributes(): Record<string, string> |
| 118 | + getAttributeNames(): Array<string> |
| 119 | + hasAttributes(): boolean |
| 120 | + hasChildNodes(): boolean |
| 121 | + compareDocumentPosition(other: NodeRepr): number |
| 122 | + /** Get the serialized html of this node, including its all descendants and itelf. */ |
| 123 | + outerHtml(): string |
| 124 | + /** Get the serialized html of this node, only including its all descendants. */ |
| 125 | + innerHtml(): string |
| 126 | + /** Get all text nodes content of this node, including its all descendants and itelf. */ |
| 127 | + text(): string |
| 128 | + querySelector(selectors: string): NodeRepr | null |
| 129 | + querySelectorAll(selectors: string): Array<NodeRepr> |
| 130 | + getAttribute(name: string): string | null |
| 131 | + hasAttribute(name: string): boolean |
| 132 | + getAttributeNS(namespace: string | undefined | null, localName: string): string | null |
| 133 | + hasAttributeNS(namespace: string | undefined | null, localName: string): boolean |
| 134 | + lookupPrefix(namespace?: string | undefined | null): string | null |
| 135 | + lookupNamespaceURI(prefix?: string | undefined | null): string | null |
| 136 | + isDefaultNamespace(namespace?: string | undefined | null): boolean |
| 137 | + getElementById(id: string): NodeRepr | null |
| 138 | + getElementsByClassName(classNames: string): Array<NodeRepr> |
| 139 | + getElementsByTagName(tagName: string): Array<NodeRepr> |
| 140 | + contains(otherNode: NodeRepr): boolean |
| 141 | + isEqualNode(otherNode: NodeRepr): boolean |
| 142 | + get head(): NodeRepr | null |
| 143 | + get body(): NodeRepr | null |
| 144 | + get title(): string |
| 145 | + get documentElement(): NodeRepr | null |
| 146 | + matches(selectors: string): boolean |
| 147 | + closest(selectors: string): NodeRepr | null |
| 148 | + /** The node object, cann't be instantiated in javascript. So call the constructor will throw an error. */ |
| 149 | + constructor(): void |
| 150 | + get elementNode(): number |
| 151 | + get attributeNode(): number |
| 152 | + get textNode(): number |
| 153 | + get cdataSectionNode(): number |
| 154 | + get entityReferenceNode(): number |
| 155 | + get entityNode(): number |
| 156 | + get processingInstructionNode(): number |
| 157 | + get commentNode(): number |
| 158 | + get documentNode(): number |
| 159 | + get documentTypeNode(): number |
| 160 | + get documentFragmentNode(): number |
| 161 | + get notationNode(): number |
| 162 | + get documentPositionDisconnected(): number |
| 163 | + get documentPositionPreceding(): number |
| 164 | + get documentPositionFollowing(): number |
| 165 | + get documentPositionContains(): number |
| 166 | + get documentPositionContainedBy(): number |
| 167 | + get documentPositionImplementationSpecific(): number |
| 168 | + /** Clone this node to a new instance, not clone its descendants. */ |
| 169 | + clone(): NodeRepr |
| 170 | + /** Clone this node to a new instance, including its all descendants. */ |
| 171 | + cloneRecursive(): NodeRepr |
| 172 | + cloneNode(deep?: boolean | undefined | null): NodeRepr |
| 173 | +} |
| 174 | + |
| 175 | +/** Parse string input to a html tree, return the root node. */ |
| 176 | +export declare function parse(html: string): NodeRepr |
0 commit comments