import ComponentSetup from './ComponentSetup' ; let counter = 0 ; export default class ComponentSetupManager { private map : Record < string , ComponentSetup > = { } ; public add ( id , setup ) { if ( ! id ) { throw new Error ( `Wrong id: ${ id }` ) ; } this . map [ id ] = setup ; } public get ( id ) { return this . map [ id ] ; } public genId ( ) { return `setup-${ counter ++ }` ; } } export const setupManager = new ComponentSetupManager ( ) ;