Skip to content

Exported transform type should return MaybePromise #495

@43081j

Description

@43081j

What happened?

Since you introduced async transformers, transform now actually returns a MaybePromise<RenderableTreeNodes> from what i can tell.

Meanwhile, the exported transform function defines its return type as RenderableTreeNode (or RenderableTreeNode[])

We should probably update the exported function to match, otherwise we can't await the result without casting.

To reproduce

In a typescript project, try await Markdoc.transform(...) with an async transformer in your config. it'll work at runtime but will fail to build

Version

latest

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions