namespace NT { /**
     * Manages components and their creation.
     */ export class ComponentManager { private static _registeredBuilders : { [ type ] : IComponentBuilder ; } = { } ; param builder public static registerBuilder ( builder ) { ComponentManager . _registeredBuilders [ builder . type ] = builder ; } param json public static extractComponent ( json ) { if ( json . type !== undefined ) { if ( ComponentManager . _registeredBuilders [ String ( json . type ) ] !== undefined ) { return ComponentManager . _registeredBuilders [ String ( json . type ) ] . buildFromJson ( json ) ; } throw new Error ( "Component manager error - type is missing or builder is not registered for this type." ) ; } } } }