Open paoloricciuti opened 4 months ago
Thanks @paoloricciuti for mentioning this. The types could indeed be enhanced by making the Options
type generic with inferred arguments (this means that Output
should extend the necessary stream interface if defined).
Feel free to suggest a pull request.
Thanks @paoloricciuti for mentioning this. The types could indeed be enhanced by making the
Options
type generic with inferred arguments (this means thatOutput
should extend the necessary stream interface if defined).Feel free to suggest a pull request.
Sure, I'll try to open a PR later on :)
Motivation
Currently the types for the custom generator looks like this
which is fine but this means we have no way of parsing an actual custom tree without ignoring errors. What i propose is to change the signature of the generate function to allow the user to pass a generic that specifies the shape of it's own ast.
Something like this
Expected behavior
I would love to specify extra nodes of my Ast without incurring in ts errors.