项目作者: babel-utils

项目描述 :
[Deprecated] Use babel-utils/babel-type-scopes for both Flow & TypeScript support
高级语言: JavaScript
项目地址: git://github.com/babel-utils/babel-flow-scope.git
创建时间: 2017-06-01T23:53:06Z
项目社区:https://github.com/babel-utils/babel-flow-scope

开源协议:MIT License

下载


babel-flow-scope

Collect Flow bindings in a given scope

  1. import type foo from "mod";
  2. type baz<bar> = {};
  1. import {getFlowBindingsInScope} from 'babel-flow-scope';
  2. getFlowBindingsInScope(path);
  3. // {
  4. // foo: {
  5. // kind: 'import',
  6. // path: (Identifier)
  7. // },
  8. // bar: {
  9. // kind: 'param',
  10. // path: (TypeParameter)
  11. // },
  12. // baz: {
  13. // kind: 'declaration',
  14. // path: (Identifier)
  15. // }
  16. // }

API

getFlowScopePath(path)

Find the closest path to a Flow scope.

getFlowBindingsInScope(path)

Retreive all the Flow bindings in the local Flow scope.

findFlowBinding(path, name)

Search for a binding in the current scope and parent scopes.