import { TypeIdentifier } from "./deps.ts" ; import { ExtendedModuleMetadata , ModuleClass , ModuleMetadata , } from "./module-metadata.ts" ; export class ModuleCatalog { private static readonly catalog = new Map < ModuleClass , ExtendedModuleMetadata > ( ) ; static registerMetadata ( type , params , props , config ) { this . catalog . set ( type , { ... config , type , params , props } ) ; } static getMetadata ( type ) { const metadata = this . catalog . get ( type ) ; if ( ! metadata ) { throw new Error ( `Module ${ type } is not registered` ) ; } return metadata ; } }