# Path: draftjs_exporter/engines/base.py
# class DOMEngine(object):
#     def create_tag(type_: Tag, attr: Optional[Attr] = None) -> Any:
#     def parse_html(markup: HTML) -> Element:
#     def append_child(elt: Element, child: Element) -> Any:
#     def render(elt: Element) -> HTML:
#     def render_debug(elt: Element) -> HTML:
# 
# Path: draftjs_exporter/types.py
# HTML = str


from html import escape
from typing import List, Optional, Sequence, Union
from draftjs_exporter.engines.base import Attr, DOMEngine
from draftjs_exporter.types import HTML, Tag

# http://w3c.github.io/html/single-page.html#void-elements
# https://github.com/html5lib/html5lib-python/blob/0cae52b2073e3f2220db93a7650901f2200f2a13/html5lib/constants.py#L560
VOID_ELEMENTS = (
    "area",
    "base",
    "br",
    "col",
    "embed",
    "hr",
    "img",
    "input",
    "link",
    "meta",
    "param",
    "source",
    "track",
    "wbr",
)


class Elt(object):
    """
    A DOM element that the string engine manipulates.
    This class doesn't do much, but the exporter relies on
    comparing elements by reference so it's useful nonetheless.
    """

    __slots__ = ("type", "attr", "children", "markup")


# Path: draftjs_exporter/engines/base.py
# class DOMEngine(object):
#     def create_tag(type_: Tag, attr: Optional[Attr] = None) -> Any:
#     def parse_html(markup: HTML) -> Element:
#     def append_child(elt: Element, child: Element) -> Any:
#     def render(elt: Element) -> HTML:
#     def render_debug(elt: Element) -> HTML:
# 
# Path: draftjs_exporter/types.py
# HTML = str


# Path: draftjs_exporter/engines/string.py
from html import escape
from typing import List, Optional, Sequence, Union
from draftjs_exporter.engines.base import Attr, DOMEngine
from draftjs_exporter.types import HTML, Tag


# http://w3c.github.io/html/single-page.html#void-elements
# https://github.com/html5lib/html5lib-python/blob/0cae52b2073e3f2220db93a7650901f2200f2a13/html5lib/constants.py#L560
VOID_ELEMENTS = (
    "area",
    "base",
    "br",
    "col",
    "embed",
    "hr",
    "img",
    "input",
    "link",
    "meta",
    "param",
    "source",
    "track",
    "wbr",
)


class Elt(object):
    """
    A DOM element that the string engine manipulates.
    This class doesn't do much, but the exporter relies on
    comparing elements by reference so it's useful nonetheless.
    """

    __slots__ = ("type", "attr", "children", "markup")


    def __init__(self, type_: Tag, attr: Optional[Attr], markup: HTML = None):