import { Import } from "../Languages/Imports/Import" ; /**
 * Holds accumulated package imports during a conversion.
 */ export class ImportsStore { /**
     * Accumulated package imports, keyed by joined package name.
     */ private imports : { [ i ] : Import ; } ; /**
     * Initializes a new instance of the ImportsStore class.
     */ public constructor ( ) { this . imports = { } ; } param addedImports public addImports ( addedImports ) { for ( const addedImport of addedImports ) { this . addImport ( addedImport ) ; } } returns public getAllImportStores ( ) { const stores = [ ] ; for ( const i in this . imports ) { if ( { } . hasOwnProperty . call ( this . imports , i ) ) { stores . push ( this . imports [ i ] ) ; } } return stores ; } returns public hasAnyImports ( ) { return Object . keys ( this . imports ) . length > 0 ; } param addedImport private addImport ( addedImport ) { const internalPackageNameKey = addedImport . relativity + addedImport . packagePath . join ( "/" ) ; if ( internalPackageNameKey in this . imports ) { this . imports [ internalPackageNameKey ] . addItems ( addedImport . items ) ; } else { this . imports [ internalPackageNameKey ] = addedImport ; } } }