From fc91e20b5e4ac84cb7caf85ee0e9962b871d1124 Mon Sep 17 00:00:00 2001 From: xusd320 Date: Fri, 19 Jul 2024 23:13:52 +0800 Subject: [PATCH] docs: update typedocs --- docs/functions/parse.html | 2 +- docs/interfaces/NodeRepr.html | 48 +++++++++++++++++------------------ index.d.ts | 2 +- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/functions/parse.html b/docs/functions/parse.html index 6171a1e..8b534ad 100644 --- a/docs/functions/parse.html +++ b/docs/functions/parse.html @@ -1,2 +1,2 @@ parse | niddle

Function parse

  • Parse string input to a html tree, return the root node.

    -

    Parameters

    • html: string

    Returns NodeRepr

+

Parameters

Returns NodeRepr

diff --git a/docs/interfaces/NodeRepr.html b/docs/interfaces/NodeRepr.html index ca1f056..6631cba 100644 --- a/docs/interfaces/NodeRepr.html +++ b/docs/interfaces/NodeRepr.html @@ -1,5 +1,5 @@ NodeRepr | niddle

Interface NodeRepr

The node object, cann't be instantiated in javascript.

-
interface NodeRepr {
    append(newChild: NodeRepr): void;
    appendSequence(newChildren: NodeRepr[]): void;
    clone(): NodeRepr;
    cloneRecursive(): NodeRepr;
    getAttribute(name: string): string;
    getAttributes(): Record<string, string>;
    getChildren(): NodeRepr[];
    innerHtml(): string;
    insertAfter(newSibling: NodeRepr): void;
    insertBefore(newSibling: NodeRepr): void;
    insertSequenceAfter(newSiblings: NodeRepr[]): void;
    insertSequenceBefore(newSiblings: NodeRepr[]): void;
    outerHtml(): string;
    prepend(newChild: NodeRepr): void;
    prependSequence(newChildren: NodeRepr[]): void;
    remove(): void;
    removeAllAttributes(): void;
    removeAttribute(name: string): void;
    select(selectors: string): NodeRepr;
    selectAll(selectors: string): NodeRepr[];
    setAttribute(name: string, value: string): void;
    setAttributes(attrs: Record<string, string>): void;
    text(): string;
}

Methods

interface NodeRepr {
    append(newChild: NodeRepr): void;
    appendSequence(newChildren: NodeRepr[]): void;
    clone(): NodeRepr;
    cloneRecursive(): NodeRepr;
    getAttribute(name: string): string;
    getAttributes(): Record<string, string>;
    getChildren(): NodeRepr[];
    innerHtml(): string;
    insertAfter(newSibling: NodeRepr): void;
    insertBefore(newSibling: NodeRepr): void;
    insertSequenceAfter(newSiblings: NodeRepr[]): void;
    insertSequenceBefore(newSiblings: NodeRepr[]): void;
    outerHtml(): string;
    prepend(newChild: NodeRepr): void;
    prependSequence(newChildren: NodeRepr[]): void;
    remove(): void;
    removeAllAttributes(): void;
    removeAttribute(name: string): void;
    select(selectors: string): NodeRepr;
    selectAll(selectors: string): NodeRepr[];
    setAttribute(name: string, value: string): void;
    setAttributes(attrs: Record<string, string>): void;
    text(): string;
}

Methods

Methods

  • Append a child node to this node, after existing children.

    The child node will be remove from its previous position.

    -

    Parameters

    Returns void

  • Append some children nodes to this node by order, after existing children.

    +

    Parameters

    Returns void

  • Append some children nodes to this node by order, after existing children.

    These children nodes will be remove from their previous position.

    -

    Parameters

    Returns void

  • Get attribute value of this node by given name.

    -

    Parameters

    • name: string

    Returns string

  • Get attributes K-V object of this node.

    -

    Returns Record<string, string>

  • Get the serialized html of this node, only including its all descendants;.

    -

    Returns string

  • Insert a new sibling after this node.

    +

    Parameters

    Returns void

  • Get attribute value of this node by given name.

    +

    Parameters

    • name: string

    Returns string

  • Get attributes K-V object of this node.

    +

    Returns Record<string, string>

  • Get the serialized html of this node, only including its all descendants;.

    +

    Returns string

  • Insert a new sibling after this node.

    The sibling node will be remove from its previous position.

    -

    Parameters

    Returns void

  • Insert a new sibling before this node.

    +

    Parameters

    Returns void

  • Insert a new sibling before this node.

    The sibling node will be remove from its previous position.

    -

    Parameters

    Returns void

  • Insert some siblings after this node.

    +

    Parameters

    Returns void

  • Insert some siblings after this node.

    These sibling nodes will be remove from their previous position.

    -

    Parameters

    Returns void

  • Insert some siblings before this node.

    +

    Parameters

    Returns void

  • Insert some siblings before this node.

    These sibling nodes will be remove from their previous position.

    -

    Parameters

    Returns void

  • Get the serialized html of this node, including its all descendants and itelf;.

    -

    Returns string

  • Prepend a child node to this node, before existing children.

    +

    Parameters

    Returns void

  • Get the serialized html of this node, including its all descendants and itelf;.

    +

    Returns string

  • Prepend a child node to this node, before existing children.

    The child node will be remove from its previous position.

    -

    Parameters

    Returns void

  • Prepend some children nodes to this node by order, before existing children.

    +

    Parameters

    Returns void

  • Prepend some children nodes to this node by order, before existing children.

    These children nodes will be remove from their previous position.

    -

    Parameters

    Returns void

  • Remove a node from its parent and siblings. Children are not affected.

    -

    Returns void

  • Remove all attributes of this node

    -

    Returns void

  • Remove an attribute of this node by name

    -

    Parameters

    • name: string

    Returns void

  • Select the the fist node that match the given selector, like document.querySelector.

    -

    Parameters

    • selectors: string

    Returns NodeRepr

  • Select all nodes that match the given selector, like document.querySelectorAll.

    -

    Parameters

    • selectors: string

    Returns NodeRepr[]

  • Assign an attribute K-V to this node

    -

    Parameters

    • name: string
    • value: string

    Returns void

  • Assign attributes K-V object to this node

    -

    Parameters

    • attrs: Record<string, string>

    Returns void

  • Get all text nodes content of this node, including its all descendants and itelf;.

    -

    Returns string

+

Parameters

Returns void

diff --git a/index.d.ts b/index.d.ts index 0645cf7..c12df90 100644 --- a/index.d.ts +++ b/index.d.ts @@ -6,7 +6,7 @@ /** Parse string input to a html tree, return the root node. */ export function parse(html: string): NodeRepr; /** The node object, cann't be instantiated in javascript. */ -export declare interface NodeRepr { +export interface NodeRepr { /** * Append a child node to this node, after existing children. *