Type alias SimplifiedElement

SimplifiedElement: {
    attribs: {
        [key: string]: string;
    };
    children?: SimplifiedElement[];
    containsText?: boolean;
    tagName?: string;
    text?: string;
    type?: string;
}

Simplified HTML element/node.

Type declaration

  • attribs: {
        [key: string]: string;
    }

    Html tag attributes.

    Example

    { src: 'https://example.com/image.jpg', alt: 'example image' }
    
    • [key: string]: string
  • Optional children?: SimplifiedElement[]

    List of child nodes.

  • Optional containsText?: boolean

    Flag if node has text content.

  • Optional tagName?: string

    Html tag name.

  • Optional text?: string

    Node text content.

  • Optional type?: string

    Node type (text, style, script, comment, etc).

Generated using TypeDoc