import { BehaviorSubject } from 'rxjs/BehaviorSubject' ; import * as appSettings from 'application-settings' ; interface IAPP_SETTING_KEYS { INTRO : string ; SHOUTOUT_START : string ; SHOUTOUT_ASK_NAME : string ; SHOUTOUT_READY_MSG_SHOWN : string ; } export class Config { public static USER_KEY : string ; public static SELECTED_PLAYLIST_ID : string ; public static SHARE_URL$ : BehaviorSubject < string > = new BehaviorSubject ( null ) ; public static PLAY_SHARED$ : BehaviorSubject < any > = new BehaviorSubject ( null ) ; public static APP_SETTING_KEYS : IAPP_SETTING_KEYS = { INTRO : `viewed-intro` , SHOUTOUT_START : 'shoutout-start' , SHOUTOUT_ASK_NAME : 'shoutout-ask-name' , SHOUTOUT_READY_MSG_SHOWN : 'shoutout-ready-msg-shown' } ; public static SEEN_INTRO ( ) { return appSettings . getBoolean ( Config . APP_SETTING_KEYS . INTRO , false ) ; } public static SET_SEEN_INTRO ( value ) { appSettings . setBoolean ( Config . APP_SETTING_KEYS . INTRO , value ) ; } public static SHOUTOUT_START_TIME ( ) { return appSettings . getNumber ( Config . APP_SETTING_KEYS . SHOUTOUT_START , 6000 ) ; } public static SET_SHOUTOUT_START_TIME ( value ) { appSettings . setNumber ( Config . APP_SETTING_KEYS . SHOUTOUT_START , value ) ; } public static SHOUTOUT_ASK_NAME ( ) { return appSettings . getBoolean ( Config . APP_SETTING_KEYS . SHOUTOUT_ASK_NAME , false ) ; } public static SET_SHOUTOUT_ASK_NAME ( value ) { appSettings . setBoolean ( Config . APP_SETTING_KEYS . SHOUTOUT_ASK_NAME , value ) ; } public static SHOUTOUT_READY_SHOWN ( ) { return appSettings . getBoolean ( Config . APP_SETTING_KEYS . SHOUTOUT_READY_MSG_SHOWN , false ) ; } public static SET_SHOUTOUT_READY_SHOWN ( value ) { appSettings . setBoolean ( Config . APP_SETTING_KEYS . SHOUTOUT_READY_MSG_SHOWN , value ) ; } public static DEBUG : any = { LEVEL_1 : false , LEVEL_2 : false , LEVEL_3 : false , LEVEL_4 : false } ; public static IS_DEBUG_MODE ( ) { for ( let key in Config . DEBUG ) { if ( Config . DEBUG [ key ] ) { return true ; } } return false ; } public static RESET ( ) { for ( let key in Config . DEBUG ) { Config . DEBUG [ key ] = false ; } } }