import { PersistentStorage } from '../types'; export class IonicStorageWrapper implements PersistentStorage { protected storage; constructor(storage: IonicStorageInterface) { this.storage = storage; } getItem(key: string): Promise { return this.storage.get(key); } removeItem(key: string): Promise { return this.storage.remove(key); } setItem(key: string, value: string | null): Promise { return this.storage.set(key, value); } } interface IonicStorageInterface { // Actual type definition: https://github.com/ionic-team/ionic-storage/blob/main/lib/src/index.ts get(key: string): Promise; set(key: string, value: string | null): Promise; remove(key: string): Promise; }