fork of hey-api/openapi-ts because I need some additional things
at feat/skip-token 56 lines 1.6 kB view raw
1import type { File } from './files/file'; 2import type { BindingKind } from './symbols/types'; 3 4export interface ExportMember { 5 /** 6 * Name under which the symbol is exported in this file. 7 * 8 * export { Foo as Bar } from "./models" 9 * 10 * exportedName === "Bar" 11 */ 12 exportedName: string; 13 /** Whether this export is type-only. */ 14 isTypeOnly: boolean; 15 /** Export flavor. */ 16 kind: BindingKind; 17 /** The exported name of the symbol in its source file. */ 18 sourceName: string; 19} 20 21export type ExportModule = Pick<ExportMember, 'isTypeOnly'> & { 22 /** Whether this module can export all symbols: `export * from 'module'`. */ 23 canExportAll: boolean; 24 /** Members exported from this module. */ 25 exports: Array<ExportMember>; 26 /** Source file. */ 27 from: File; 28 /** Namespace export: `export * as ns from 'module'`. Mutually exclusive with `exports`. */ 29 namespaceExport?: string; 30}; 31 32export interface ImportMember { 33 /** Whether this import is type-only. */ 34 isTypeOnly: boolean; 35 /** 36 * The name this symbol will have locally in this file. 37 * This is where aliasing is applied: 38 * 39 * import { Foo as Foo$2 } from "./x" 40 * 41 * localName === "Foo$2" 42 */ 43 localName: string; 44 /** The exported name of the symbol in its source file. */ 45 sourceName: string; 46} 47 48export type ImportModule = Pick<ImportMember, 'isTypeOnly'> & 49 Pick<Partial<ImportMember>, 'localName'> & { 50 /** Source file. */ 51 from: File; 52 /** List of symbols imported from this module. */ 53 imports: Array<ImportMember>; 54 /** Import flavor. */ 55 kind: BindingKind; 56 };