import { isNullOrUndefined , getEnumValue } from '@syncfusion/ej2-base' ; import { ICellRenderer } from '../base/interface' ; import { CellType } from '../base/enum' ; hidden export class CellRendererFactory { public cellRenderMap : { [ c ] : ICellRenderer < { } > ; } = { } ; public addCellRenderer ( name , type ) { name = typeof name === 'string' ? name : < string > getEnumValue ( CellType , < CellType > name ) ; if ( isNullOrUndefined ( this . cellRenderMap [ name ] ) ) { this . cellRenderMap [ name ] = type ; } } public getCellRenderer ( name ) { name = typeof name === 'string' ? name : < string > getEnumValue ( CellType , < CellType > name ) ; if ( isNullOrUndefined ( this . cellRenderMap [ name ] ) ) { throw `The cellRenderer ${ name } is not found` ; } else { return this . cellRenderMap [ name ] ; } } }