import { PersistentStorage } from '../types' ; example export class MMKVStorageWrapper implements PersistentStorage < string | null > { private storage ; constructor ( storage ) { this . storage = storage ; } getItem ( key ) { return this . storage . getItem ( key ) || null ; } removeItem ( key ) { return new Promise ( ( resolve , reject ) => { Promise . resolve ( this . storage . removeItem ( key ) ) . then ( ( ) => resolve ( ) ) . catch ( ( ) => reject ( ) ) ; } ) ; } setItem ( key , value ) { return new Promise ( ( resolve , reject ) => { this . storage . setItem ( key , value ) . then ( ( ) => resolve ( ) ) . catch ( ( ) => reject ( ) ) ; } ) ; } } interface MMKVStorageInterface { getItem ( key ) : Promise < string | null | undefined > ; setItem ( key , value ) : Promise < boolean | undefined > ; removeItem ( key ) : boolean | undefined | Promise < boolean | undefined > ; }