Open realdoug opened 4 years ago
The types could certainly be improved. Personally, I would try not to use any
at all. The type of copy
should probably be copy<T>(node: T): T
at minimum, perhaps even with a type constraint T extends …
to restrict it to some sort of basic Node
type. Part of the problem is that recast supports lots of different parsers with slightly different AST formats.
I'd like to use this library via Typescript but the top-level parse function returns any, meaning I need to do at least one cast to start using the type system. What is the suggested way of getting typed values out of recast?
Thanks