import { SourceMapMappings } from '@jridgewell/sourcemap-codec'; import { Location } from 'locate-character'; import { SourceFile } from 'typescript'; interface Reference { module: string; name: string; } interface Declaration { module: string; name: string; alias: string; /** * Whether this declaration should have an `export` modifier in the output */ export: boolean; /** * Whether this declaration should have a `default` modifier in the output */ default: boolean; external: boolean; included: boolean; dependencies: Reference[]; /** * The name we'd like to use to refer to this binding. * Only applies to default imports from external modules */ preferred_alias: string; } interface Binding { id: string; external: boolean; name: string; } interface ModuleReference { id: string; external: boolean; } interface Module { file: string; dts: string; ast: SourceFile; locator: (pos: number) => Location | undefined; source: null | { code: string; map: any; // TODO mappings: SourceMapMappings; }; dependencies: string[]; globals: string[]; references: Set; declarations: Map; imports: Map; import_all: Map; export_from: Map; export_all: ModuleReference[]; ambient_imports: ModuleReference[]; /** A map of exports */ exports: Map; } interface Namespace { declarations: Map; references: Set; exports: Map; } interface Mapping { source: string; line: number; column: number; } export { Binding, Declaration, Mapping, Module, ModuleReference, Namespace };