import { App } from './../app' ; import { AppManagerDriver } from './app-manager-driver' ; import { ArrayAppManager } from './array-app-manager' ; import { Log } from './../log' ; import { ApiAppManager } from './api-app-manager' ; /**
 * Class that controls the key/value data store.
 */ export class AppManager implements AppManagerDriver { /**
     * App manager driver.
     */ protected driver : AppManagerDriver ; param { any } options constructor ( protected options ) { if ( options . appManager . driver === 'array' ) { this . driver = new ArrayAppManager ( options ) ; } else if ( options . appManager . driver === 'api' ) { this . driver = new ApiAppManager ( options ) ; } else { Log . error ( 'Clients driver not set.' ) ; } } param { string } id param { any } socket param { any } data return { Promise < App | null > } findById ( id , socket , data ) { return this . driver . findById ( id , socket , data ) ; } param { string } key param { any } socket param { any } data return { Promise < App | null > } findByKey ( key , socket , data ) { return this . driver . findByKey ( key , socket , data ) ; } }