import { CrossStorageClientI } from '../utils/cross-storage-client' ; export class CrossStorageClientStub implements CrossStorageClientI { public storage : any = { } ; async onConnect ( ) { return Promise . resolve ( ) ; } async set ( key , value ) { return this . exec ( ( ) => this . storage [ key ] = value ) ; } async get ( key ) { return this . exec ( ( ) => this . storage [ key ] || null ) ; } async clear ( key ? ) { return this . exec ( ( ) => { this . storage = { } ; } ) ; } async del ( key ? ) { return this . exec ( ( ) => { if ( key ) delete this . storage [ key ] ; } ) ; } protected async exec ( fn ) { return Promise . resolve ( fn ( ) ) ; } }