import { PersistentStorage } from '../types' ; export class SessionStorageWrapper implements PersistentStorage < string | null > { private storage ; constructor ( storage ) { this . storage = storage ; } getItem ( key ) { return this . storage . getItem ( key ) ; } removeItem ( key ) { return this . storage . removeItem ( key ) ; } setItem ( key , value ) { if ( value !== null ) { return this . storage . setItem ( key , value ) ; } else { return this . removeItem ( key ) ; } } } interface SessionStorageInterface { getItem ( key ) : string | null ; setItem ( key , value ) : void ; removeItem ( key ) : void ; }