mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #32395 from cameron-martin/feature/babel-traverse-node-aliases
[@babel/traverse]: Allowed node aliases as keys in visitors.
This commit is contained in:
@@ -150,3 +150,8 @@ const VisitorStateTest: Visitor<SomeVisitorState> = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const VisitorAliasTest: Visitor = {
|
||||
Function() {},
|
||||
Expression() {},
|
||||
};
|
||||
|
||||
Vendored
+2
@@ -145,6 +145,8 @@ export class Binding {
|
||||
|
||||
export type Visitor<S = {}> = VisitNodeObject<S, Node> & {
|
||||
[Type in Node["type"]]?: VisitNode<S, Extract<Node, { type: Type; }>>;
|
||||
} & {
|
||||
[K in keyof t.Aliases]?: VisitNode<S, t.Aliases[K]>
|
||||
};
|
||||
|
||||
export type VisitNode<S, P> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.0.0"
|
||||
"@babel/types": "^7.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user