node-html-parser 4.1.3 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ declare class DOMTokenList {
15
15
  private _set;
16
16
  private _afterUpdate;
17
17
  private _validate;
18
- constructor(valuesInit?: string[], afterUpdate?: ((t: DOMTokenList) => void));
18
+ constructor(valuesInit?: string[], afterUpdate?: (t: DOMTokenList) => void);
19
19
  add(c: string): void;
20
20
  replace(c1: string, c2: string): void;
21
21
  remove(c: string): void;
@@ -36,7 +36,7 @@ declare class DOMTokenList {
36
36
  * @extends {Node}
37
37
  */
38
38
  export default class HTMLElement extends Node {
39
- private rawAttrs;
39
+ rawAttrs: string;
40
40
  private _attrs;
41
41
  private _rawAttrs;
42
42
  rawTagName: string;
@@ -77,6 +77,7 @@ export default class HTMLElement extends Node {
77
77
  exchangeChild(oldNode: Node, newNode: Node): void;
78
78
  get tagName(): string;
79
79
  get localName(): string;
80
+ get isVoidElement(): boolean;
80
81
  /**
81
82
  * Get escpaed (as-it) text value of current node and its children.
82
83
  * @return {string} text content
@@ -125,9 +126,14 @@ export default class HTMLElement extends Node {
125
126
  /**
126
127
  * Query CSS Selector to find matching node.
127
128
  * @param {string} selector Simplified CSS selector
128
- * @return {HTMLElement} matching node
129
+ * @return {(HTMLElement|null)} matching node
129
130
  */
130
- querySelector(selector: string): HTMLElement;
131
+ querySelector(selector: string): HTMLElement | null;
132
+ /**
133
+ * find elements by their tagName
134
+ * @param {string} tagName the tagName of the elements to select
135
+ */
136
+ getElementsByTagName(tagName: string): Array<HTMLElement>;
131
137
  /**
132
138
  * traverses the Element and its parents (heading toward the document root) until it finds a node that matches the provided selector string. Will return itself or the matching ancestor. If no such element exists, it returns null.
133
139
  * @param selector a DOMString containing a selector list
@@ -157,7 +163,7 @@ export default class HTMLElement extends Node {
157
163
  get attrs(): Attributes;
158
164
  get attributes(): Record<string, string>;
159
165
  /**
160
- * Get escaped (as-it) attributes
166
+ * Get escaped (as-is) attributes
161
167
  * @return {Object} parsed attributes
162
168
  */
163
169
  get rawAttributes(): RawAttributes;