declare const __DEFAULT_ENV__ ; class WebEnvSwitcher { storageKey : string = 'envName' ; defaultAppEnv : string = __DEFAULT_ENV__ || 'prod' ; get envName ( ) : string { let storedEnvName ; try { storedEnvName = localStorage . getItem ( this . storageKey ) ; } catch ( e ) { return '' ; } return storedEnvName || this . defaultAppEnv ; } set envName ( name ) { if ( typeof name === 'string' ) { try { localStorage . setItem ( this . storageKey , name ) ; } catch ( e ) { return ; } } } async setEnv ( name ) { this . envName = name ; } } export const EnvSwitcher = new WebEnvSwitcher ( ) ;