Skip to content

Typescript: More specific types for children #35

@osdiab

Description

@osdiab

This is not necessarily the right place to put this since typings are managed at DefinitelyTyped, but figured it would get more relevant eyeballs here so posting:

One of the great things about MJML is that it validates your email HTML. But it would be even better if some of those validations could occur at compile time instead.

There's a lot of low hanging fruit like "children of mj-sections need to be mj-columns" or "an h1 tag can only be inside of an mj-text instance", which can be checked before even running your code. Would be amazing if those were typed explicitly - although I am not sure how to type "an instance of a specific component" off the top of my head yeah i don't think it's possible :P

Exploring other ways it can potentially be done without messing with the API of this library

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions