Skip to content

Add specific types for known HTML elements #122

@pelme

Description

@pelme

instead of just

article = Element("article")

we could have something like:

class Article(Element): pass
article = Article("article")

then a component could use a more specific type annotation to ensure that the right html element is returned:

def my_component() -> h.Article:
    return h.article["hi!"]

with #111, we could also specify different kinds of attributes types for different elements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions