ast-types
ast-types copied to clipboard
How to get type NodePath in typescript
When use this module in typescript , can not get a type NodePath.
import { NodePath} from 'ast-types'
...
recast.visit(ast, {
// 'NodePath' refers to a value, but is being used as a type
visitMemberExpression: (path: NodePath<recast.types.namedTypes.MemberExpression>) => {
It loss export type after commit. It changes to export a const NodePath, so how to get type NodePath?
Hey, I'm wondering the same thing.
I worked around this with import { NodePath } from "ast-types/lib/node-path";.