UNPKG

1.76 kBTypeScriptView Raw
1import { AnyNode } from "domhandler";
2import { DomSerializerOptions } from "dom-serializer";
3/**
4 * @category Stringify
5 * @deprecated Use the `dom-serializer` module directly.
6 * @param node Node to get the outer HTML of.
7 * @param options Options for serialization.
8 * @returns `node`'s outer HTML.
9 */
10export declare function getOuterHTML(node: AnyNode | ArrayLike<AnyNode>, options?: DomSerializerOptions): string;
11/**
12 * @category Stringify
13 * @deprecated Use the `dom-serializer` module directly.
14 * @param node Node to get the inner HTML of.
15 * @param options Options for serialization.
16 * @returns `node`'s inner HTML.
17 */
18export declare function getInnerHTML(node: AnyNode, options?: DomSerializerOptions): string;
19/**
20 * Get a node's inner text. Same as `textContent`, but inserts newlines for `<br>` tags. Ignores comments.
21 *
22 * @category Stringify
23 * @deprecated Use `textContent` instead.
24 * @param node Node to get the inner text of.
25 * @returns `node`'s inner text.
26 */
27export declare function getText(node: AnyNode | AnyNode[]): string;
28/**
29 * Get a node's text content. Ignores comments.
30 *
31 * @category Stringify
32 * @param node Node to get the text content of.
33 * @returns `node`'s text content.
34 * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent}
35 */
36export declare function textContent(node: AnyNode | AnyNode[]): string;
37/**
38 * Get a node's inner text, ignoring `<script>` and `<style>` tags. Ignores comments.
39 *
40 * @category Stringify
41 * @param node Node to get the inner text of.
42 * @returns `node`'s inner text.
43 * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/innerText}
44 */
45export declare function innerText(node: AnyNode | AnyNode[]): string;
46//# sourceMappingURL=stringify.d.ts.map
\No newline at end of file