Add an API which returns alias symbol of import specifier and the export nodes on the searching path.
Use Cases
I want to write a little tool to extract certain type in typescript code and its dependent types.
Current approaches just return the alias symbol, and it's difficult to establish relationship between import specifier and export star statements.
Examples
a.ts:
import {C} from './b';
b.ts:
export * from './c';
export * from './d';
export * from './e';
c.ts:
export const C = 1;
I want to get not only the location of symbol "C", but also the export star node in the AST of "b.ts", which is "export * from './c'".
Checklist
My suggestion meets these guidelines:
[x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
[x] This wouldn't change the runtime behavior of existing JavaScript code
[x] This could be implemented without emitting different JS based on the types of the expressions
[x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
Search Terms
export star node
Suggestion
Add an API which returns alias symbol of import specifier and the export nodes on the searching path.
Use Cases
I want to write a little tool to extract certain type in typescript code and its dependent types. Current approaches just return the alias symbol, and it's difficult to establish relationship between import specifier and export star statements.
Examples
a.ts:
b.ts:
c.ts:
I want to get not only the location of symbol "C", but also the export star node in the AST of "b.ts", which is "export * from './c'".
Checklist
My suggestion meets these guidelines: