Skip to content

babel-utils/babel-flow-scope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-flow-scope

Collect Flow bindings in a given scope

import type foo from "mod";
type baz<bar> = {};
import {getFlowBindingsInScope} from 'babel-flow-scope';

getFlowBindingsInScope(path);
// {
//   foo: {
//     kind: 'import',
//     path: (Identifier)
//   },
//   bar: {
//     kind: 'param',
//     path: (TypeParameter)
//   },
//   baz: {
//     kind: 'declaration',
//     path: (Identifier)
//   }
// }

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.

About

[Deprecated] Use babel-utils/babel-type-scopes for both Flow & TypeScript support

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published