UNPKG

715 BTypeScriptView Raw
1import type { NodePath } from '@babel/traverse';
2import type { Expression, PrivateName } from '@babel/types';
3interface MemberDescriptor {
4 path: NodePath<Expression | PrivateName>;
5 computed: boolean;
6 argumentPaths: NodePath[];
7}
8/**
9 * Given a "nested" Member/CallExpression, e.g.
10 *
11 * foo.bar()[baz][42]
12 *
13 * this returns a list of "members". In this example it would be something like
14 * [
15 * {path: NodePath<bar>, arguments: NodePath<empty>, computed: false},
16 * {path: NodePath<baz>, arguments: null, computed: true},
17 * {path: NodePath<42>, arguments: null, computed: false}
18 * ]
19 */
20export default function getMembers(path: NodePath, includeRoot?: boolean): MemberDescriptor[];
21export {};