Repository navigation
Expand file tree
/
Copy pathindex.d.ts
More file actions
215 lines (214 loc) · 12.6 KB
/
Copy pathindex.d.ts
File metadata and controls
215 lines (214 loc) · 12.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/* auto-generated by NAPI-RS */
/* eslint-disable */
export declare class NodeRepr {
/** Inserts a set of Node objects or DOMString objects after the last child of the Element. */
append(newChild: NodeRepr): void
/** Adds a node to the end of the list of children of a specified parent node. */
appendChild(newChild: NodeRepr): NodeRepr
/** Removes a child node from the DOM and returns the removed node. */
removeChild(child: NodeRepr): NodeRepr
/** Inserts a set of Node objects or DOMString objects before the first child of the Element. */
prepend(newChild: NodeRepr): void
/** Inserts a set of Node or DOMString objects in the children list of this Element's parent, just after this Element. */
after(newSibling: NodeRepr): void
/** Inserts a set of Node or DOMString objects in the children list of this Element's parent, just before this Element. */
before(newSibling: NodeRepr): void
/** Inserts a node before a reference node as a child of a specified parent node. */
insertBefore(newNode: NodeRepr, refNode?: NodeRepr | undefined | null): NodeRepr
/** Removes the object from the tree it belongs to. */
remove(): void
/** Sets the value of an attribute on the specified element. */
setAttribute(name: string, value: string): void
/** Removes an attribute from the specified element. */
removeAttribute(name: string): void
/** Toggles a boolean attribute (removing it if it is present and adding it if it is not present) on the given element. */
toggleAttribute(name: string, force?: boolean | undefined | null): boolean
/** Sets the value of an attribute on the specified element. */
setAttributeNS(namespace: string | undefined | null, name: string, value: string): void
/** Removes an attribute from the specified element. */
removeAttributeNS(namespace: string | undefined | null, localName: string): void
/** Creates the HTML element specified by tagName. */
createElement(tagName: string): NodeRepr
/** Creates a new Text node. */
createTextNode(data: string): NodeRepr
/** Creates a new Comment node. */
createComment(data: string): NodeRepr
/** Creates a new empty DocumentFragment. */
createDocumentFragment(): NodeRepr
createProcessingInstruction(target: string, data: string): NodeRepr
importNode(externalNode: NodeRepr, deep?: boolean | undefined | null): NodeRepr
adoptNode(externalNode: NodeRepr): NodeRepr
replaceChild(newChild: NodeRepr, oldChild: NodeRepr): NodeRepr
replaceWith(newNode: NodeRepr): void
/** Returns an integer representing the type of the node. */
get nodeType(): number
/** Returns a string containing the name of the Node. */
get nodeName(): string
/** Returns the name of the element. */
get tagName(): string | null
/** Returns the namespace URI of the element, or null if the element is not in a namespace. */
get namespaceURI(): string | null
/** Returns the namespace prefix of the specified element, or null if no prefix is specified. */
get prefix(): string | null
/** Returns the local part of the qualified name of an element. */
get localName(): string | null
/** Returns the value of the id attribute of the element. */
get id(): string
/** Sets the value of the id attribute of the element. */
set id(id: string)
/** Returns the value of the class attribute of the element. */
get className(): string
/** Sets the value of the class attribute of the element. */
set className(className: string)
/** Returns the parent of the specified node in the DOM tree. */
get parentNode(): NodeRepr | null
/** Returns the first child of the node. */
get firstChild(): NodeRepr | null
/** Returns the last child of the node. */
get lastChild(): NodeRepr | null
/** Returns the node immediately preceding the specified one in its parent's childNodes list. */
get previousSibling(): NodeRepr | null
/** Returns the node immediately following the specified one in its parent's childNodes list. */
get nextSibling(): NodeRepr | null
/** Returns the DOM node's parent Element, or null if the node either has no parent, or its parent isn't a DOM Element. */
get parentElement(): NodeRepr | null
/** Returns the first child that is an element, or null if there is none. */
get firstElementChild(): NodeRepr | null
/** Returns the last child that is an element, or null if there is none. */
get lastElementChild(): NodeRepr | null
/** Returns the Element immediately prior to the specified one in its parent's children list, or null if the specified element is the first one in the list. */
get previousElementSibling(): NodeRepr | null
/** Returns the Element immediately following the specified one in its parent's children list, or null if the specified element is the last one in the list. */
get nextElementSibling(): NodeRepr | null
/** Returns a live HTMLCollection which contains all of the child elements of the node upon which it was called. */
get children(): Array<NodeRepr>
/** Returns the number of child elements of the given element. */
get childElementCount(): number
/** Returns the context object's root. */
getRootNode(): NodeRepr
/** Returns or sets the value of the current node. */
get nodeValue(): string | null
/** Returns or sets the value of the current node. */
set nodeValue(value: string | undefined | null)
/** Returns the target of the processing instruction. */
get target(): string | null
/** Returns the name of the attribute. */
get name(): string | null
/** Returns the public identifier of the document type. */
get publicId(): string | null
/** Returns the system identifier of the document type. */
get systemId(): string | null
/** Returns the Document Type Declaration (DTD) associated with current document. */
get doctype(): NodeRepr | null
/** Returns the character data of the node. */
get data(): string | null
/** Sets the character data of the node. */
set data(value: string)
/** Returns the text content of the node and its descendants. */
get textContent(): string
/** Sets the text content of the node and its descendants. */
set textContent(text: string)
/** Returns a boolean value indicating whether the two nodes are the same (that is, they reference the same object). */
isSameNode(otherNode: NodeRepr): boolean
/** Returns the HTML serialization of the element's descendants. */
get innerHTML(): string
/** Returns the number of characters in the data. */
get length(): number
/** Sets the HTML serialization of the element's descendants. */
set innerHTML(html: string)
/** Returns the HTML serialization of the element and its descendants. */
get outerHTML(): string
/** Sets the HTML serialization of the element and its descendants. */
set outerHTML(html: string)
/** Returns the top-level document object for this node. */
get ownerDocument(): NodeRepr | null
/** Returns a string representation of the object. */
toString(): string
/** Returns a live NodeList containing all the children of this node. */
get childNodes(): Array<NodeRepr>
_classListAdd(token: string): void
_classListRemove(token: string): void
_classListToggle(token: string, force?: boolean | undefined | null): boolean
_classListContains(token: string): boolean
_datasetGet(): Record<string, string>
_datasetSet(key: string, value: string): void
_datasetRemove(key: string): void
/** Returns a string containing the part of CharacterData.data of the specified length and starting at the specified offset. */
substringData(offset: number, count: number): string
/** Appends the given string to the CharacterData.data string; when this method returns, data contains the concatenated string. */
appendData(data: string): void
/** Inserts the specified string at the specified offset. */
insertData(offset: number, data: string): void
/** Removes the specified amount of characters, starting at the specified offset. */
deleteData(offset: number, count: number): void
/** Replaces the specified amount of characters, starting at the specified offset, with the specified string. */
replaceData(offset: number, count: number, data: string): void
/** Breaks the Text node into two nodes at the specified offset, keeping both in the tree as siblings. */
splitText(offset: number): NodeRepr | null
/** Parses the specified text as HTML or XML and inserts the resulting nodes into the DOM tree at a specified position. */
insertAdjacentHTML(position: string, html: string): void
/** Inserts a given text node at a given position relative to the element it is invoked upon. */
insertAdjacentText(position: string, text: string): void
/** Inserts a given element node at a given position relative to the element it is invoked upon. */
insertAdjacentElement(position: string, element: NodeRepr): void
/** Puts the specified node and all of its subtree into a "normalized" form. */
normalize(): void
/** Returns the namespace URI associated with the given prefix. */
lookupNamespaceURI(prefix?: string | undefined | null): string | null
/** Returns the prefix for a given namespace URI, if present, and null if not. */
lookupPrefix(namespace: string): string | null
/** Compares the position of the current node against another node in any other document. */
compareDocumentPosition(other: NodeRepr): number
/** Returns the value of a specified attribute on the element. */
getAttribute(name: string): string | null
/** Returns the attribute names of the element as an Array of strings. */
getAttributeNames(): Array<string>
/** Returns a boolean value indicating whether the current element has any attributes. */
hasAttributes(): boolean
/** Returns a boolean value indicating whether the current Node has any child nodes. */
hasChildNodes(): boolean
/** Returns the first Element within the document that matches the specified selector, or group of selectors. */
querySelector(selectors: string): NodeRepr | null
/** Returns a static (not live) NodeList representing a list of the document's elements that match the specified group of selectors. */
querySelectorAll(selectors: string): Array<NodeRepr>
/** Returns a boolean value indicating whether the specified element has the specified attribute or not. */
hasAttribute(name: string): boolean
/** Returns the string value of the attribute with the specified namespace and name. */
getAttributeNS(namespace: string | undefined | null, localName: string): string | null
/** Returns a boolean value indicating whether the current element has the specified attribute. */
hasAttributeNS(namespace: string | undefined | null, localName: string): boolean
/** Returns a boolean value indicating whether the specified namespace is the default namespace or not. */
isDefaultNamespace(namespace?: string | undefined | null): boolean
/** Returns an Element object representing the element whose id property matches the specified string. */
getElementById(id: string): NodeRepr | null
/** Returns an array-like object of all child elements which have all of the given class name(s). */
getElementsByClassName(classNames: string): Array<NodeRepr>
/** Returns an HTMLCollection of elements with the given tag name. */
getElementsByTagName(tagName: string): Array<NodeRepr>
/** Returns a boolean value indicating whether a node is a descendant of a given node, that is the node itself, one of its direct children (childNodes), one of the children's direct children, and so on. */
contains(otherNode: NodeRepr): boolean
/** Returns a boolean value indicating whether the node is equal to the specified node. */
isEqualNode(otherNode: NodeRepr): boolean
/** Returns the head element of the document. */
get head(): NodeRepr | null
/** Returns the body element of the document. */
get body(): NodeRepr | null
/** Returns the title of the document. */
get title(): string
/** Returns the Element that is the root element of the document (for example, the <html> element for HTML documents). */
get documentElement(): NodeRepr | null
/** Returns a boolean value indicating whether the element would be selected by the specified selector string. */
matches(selectors: string): boolean
/** Returns the closest ancestor of the current element (or the current element itself) which matches the selectors given in parameter. */
closest(selectors: string): NodeRepr | null
/** 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.
* If `deep` is true, clone its all descendants.
* If `deep` is false, only clone this node.
*/
cloneNode(deep?: boolean | undefined | null): NodeRepr
}
/** Parse string input to a html tree, return the root node. */
export declare function parse(html: string): NodeRepr