import { isNullOrUndefined , getEnumValue } from '@syncfusion/ej2-base' ; import { IRenderer } from '../base/interface' ; import { RenderType } from '../base/enum' ; hidden export class RendererFactory { public rendererMap : { [ c ] : IRenderer ; } = { } ; public addRenderer ( name , type ) { let rName = < string > getEnumValue ( RenderType , < RenderType > name ) ; if ( isNullOrUndefined ( this . rendererMap [ rName ] ) ) { this . rendererMap [ rName ] = type ; } } public getRenderer ( name ) { let rName = < string > getEnumValue ( RenderType , < RenderType > name ) ; if ( isNullOrUndefined ( this . rendererMap [ rName ] ) ) { throw `The renderer ${ rName } is not found` ; } else { return this . rendererMap [ rName ] ; } } }