import { IContext } from "../api/IContext" ; import { ILogger } from "../api/ILogger" ; private export class ExtensionInstaller { private _classes : Map < any , any > = new Map < any , any > ( ) ; private _context : IContext ; private _logger : ILogger ; private constructor ( context ) { this . _context = context ; this . _logger = this . _context . getLogger ( this ) ; } param extension public install ( extension ) { if ( typeof extension === "function" && extension . prototype . extend !== undefined ) { if ( ! this . _classes . get ( extension ) ) { this . install ( new extension ( ) ) ; } } else { let extensionClass = < any > extension . constructor ; if ( ! this . _classes . get ( extensionClass ) ) { this . _logger . debug ( "Installing extension {0}" , [ extension ] ) ; this . _classes . set ( extensionClass , true ) ; extension . extend ( this . _context ) ; } } } /**
     * Destroy
     */ public destroy ( ) { this . _classes . clear ( ) ; } }