{"_id":"babel-type-scopes","_rev":"3957194","name":"babel-type-scopes","description":"Utils for looking up and working with Flow & TypeScript scopes in Babel","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"thejameskyle","email":"me@thejameskyle.com"}],"time":{"modified":"2025-09-01T01:42:19.000Z","created":"2017-09-01T05:43:17.801Z","1.1.0":"2018-06-14T00:17:31.369Z","1.0.0":"2017-09-01T05:43:17.801Z"},"users":{},"author":{"name":"James Kyle","email":"me@thejameskyle.com"},"repository":{"type":"git","url":"git+https://github.com/babel-utils/babel-type-scopes.git"},"versions":{"1.1.0":{"name":"babel-type-scopes","version":"1.1.0","description":"Utils for looking up and working with Flow & TypeScript scopes in Babel","main":"index.js","repository":{"type":"git","url":"git+https://github.com/babel-utils/babel-type-scopes.git"},"author":{"name":"James Kyle","email":"me@thejameskyle.com"},"license":"MIT","files":["index.js"],"keywords":["babel","utils","flow","typescript","scope","binding"],"scripts":{"test":"jest"},"dependencies":{"babel-flow-types":"^1.2.1"},"devDependencies":{"babel-core":"^7.0.0-alpha.19","babylon-options":"^1.1.2","flow-bin":"^0.53.1","jest":"^20.0.4","jest-in-case":"^1.0.1"},"gitHead":"0ac161160c8ae54687da9a8acd44927c401a0037","bugs":{"url":"https://github.com/babel-utils/babel-type-scopes/issues"},"homepage":"https://github.com/babel-utils/babel-type-scopes#readme","_id":"babel-type-scopes@1.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"thejameskyle","email":"me@thejameskyle.com"},"dist":{"shasum":"040228035d5c3205036f38aa4c594fb831c2366a","size":3128,"noattachment":false,"key":"/babel-type-scopes/-/babel-type-scopes-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-type-scopes/download/babel-type-scopes-1.1.0.tgz"},"maintainers":[{"name":"thejameskyle","email":"me@thejameskyle.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-type-scopes_1.1.0_1528935451281_0.5940703875195443"},"_hasShrinkwrap":false,"publish_time":1528935451369,"_cnpm_publish_time":1528935451369,"_cnpmcore_publish_time":"2021-12-16T20:13:38.961Z"},"1.0.0":{"name":"babel-type-scopes","version":"1.0.0","description":"Utils for looking up and working with Flow & TypeScript scopes in Babel","main":"index.js","repository":{"type":"git","url":"git+https://github.com/babel-utils/babel-type-scopes.git"},"author":{"name":"James Kyle","email":"me@thejameskyle.com"},"license":"MIT","files":["index.js"],"keywords":["babel","utils","flow","typescript","scope","binding"],"scripts":{"test":"jest"},"dependencies":{"babel-flow-types":"^1.2.1"},"devDependencies":{"babel-core":"^7.0.0-alpha.19","babylon-options":"^1.1.2","flow-bin":"^0.53.1","jest":"^20.0.4","jest-in-case":"^1.0.1"},"gitHead":"43a912f1e6a7e060c4f1f6f241db8d594d302174","bugs":{"url":"https://github.com/babel-utils/babel-type-scopes/issues"},"homepage":"https://github.com/babel-utils/babel-type-scopes#readme","_id":"babel-type-scopes@1.0.0","_shasum":"53c7e035a0e4129b2c58b1ecb402d78cbe7e6a11","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"thejameskyle","email":"me@thejameskyle.com"},"dist":{"shasum":"53c7e035a0e4129b2c58b1ecb402d78cbe7e6a11","size":2880,"noattachment":false,"key":"/babel-type-scopes/-/babel-type-scopes-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/babel-type-scopes/download/babel-type-scopes-1.0.0.tgz"},"maintainers":[{"name":"thejameskyle","email":"me@thejameskyle.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/babel-type-scopes-1.0.0.tgz_1504244597724_0.1543286037631333"},"directories":{},"publish_time":1504244597801,"_hasShrinkwrap":false,"_cnpm_publish_time":1504244597801,"_cnpmcore_publish_time":"2021-12-16T20:13:39.421Z"}},"readme":"# babel-type-scopes\n\n> Utils for looking up and working with Flow & TypeScript scopes in Babel\n\n```js\nimport {\n  isTypeScope,\n  getClosestTypeScopePath,\n  getOwnTypeBindings,\n  getTypeBinding,\n} from 'babel-type-scopes';\n\nisTypeScope(path); // true | false\ngetClosestTypeScopePath(path); // (Path)\ngetOwnTypeBindings(path) // { foo: { kind, path, id }, bar: { kind, path, id } }\ngetTypeBinding(path, 'foo') // { kind, path, id }\n```\n\n## Installation\n\n```sh\nyarn add babel-type-scopes\n```\n\n## API\n\n#### `isTypeScope(path: Path) => boolean`\n\nCheck if a path creates a type scope.\n\n#### `getClosestTypeScope(path: Path) => Path`\n\nFind the closest path to a type scope.\n\n#### `getOwnTypeBindings(path: Path) => Bindings`\n\nFind the closest path to a type scope.\n\n#### `getTypeBinding(path: Path) => Binding`\n\nSearch for a binding in the current scope and parent scopes.\n\n### Types\n\n#### `Binding`\n\n```js\ntype Binding = {\n  kind: 'import' | 'declaration' | 'expression' | 'param',\n  path: Path,\n  id: Path,\n};\n```\n\n#### `Bindings`\n\n```js\ntype Bindings = { [name: string]: Binding };\n```\n","_attachments":{},"homepage":"https://github.com/babel-utils/babel-type-scopes#readme","bugs":{"url":"https://github.com/babel-utils/babel-type-scopes/issues"},"license":"MIT"}