{"id":18653237,"url":"https://github.com/babel-utils/babel-type-scopes","last_synced_at":"2025-07-15T12:13:35.241Z","repository":{"id":57189043,"uuid":"102077657","full_name":"babel-utils/babel-type-scopes","owner":"babel-utils","description":"Utils for looking up and working with Flow \u0026 TypeScript scopes in Babel","archived":false,"fork":false,"pushed_at":"2019-02-09T10:09:08.000Z","size":29,"stargazers_count":12,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T04:32:26.159Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/babel-utils.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-01T05:41:28.000Z","updated_at":"2022-04-30T18:30:30.000Z","dependencies_parsed_at":"2022-09-15T03:53:32.129Z","dependency_job_id":null,"html_url":"https://github.com/babel-utils/babel-type-scopes","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel-utils%2Fbabel-type-scopes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel-utils%2Fbabel-type-scopes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel-utils%2Fbabel-type-scopes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babel-utils%2Fbabel-type-scopes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babel-utils","download_url":"https://codeload.github.com/babel-utils/babel-type-scopes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248032818,"owners_count":21036675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T07:10:41.532Z","updated_at":"2025-04-11T16:32:18.735Z","avatar_url":"https://github.com/babel-utils.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-type-scopes\n\n\u003e Utils for looking up and working with Flow \u0026 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) =\u003e boolean`\n\nCheck if a path creates a type scope.\n\n#### `getClosestTypeScope(path: Path) =\u003e Path`\n\nFind the closest path to a type scope.\n\n#### `getOwnTypeBindings(path: Path) =\u003e Bindings`\n\nFind the closest path to a type scope.\n\n#### `getTypeBinding(path: Path) =\u003e 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabel-utils%2Fbabel-type-scopes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabel-utils%2Fbabel-type-scopes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabel-utils%2Fbabel-type-scopes/lists"}