import { Observable } from "rxjs"; import { StorageOptions } from "./storage-options"; export type StorageUpdateType = "save" | "remove"; export type StorageUpdate = { key: string; updateType: StorageUpdateType; }; export interface ObservableStorageService { /** * Provides an {@link Observable} that represents a stream of updates that * have happened in this storage service or in the storage this service provides * an interface to. */ get updates$(): Observable; } export abstract class StorageService { abstract get valuesRequireDeserialization(): boolean; abstract get(key: string, options?: StorageOptions): Promise; abstract has(key: string, options?: StorageOptions): Promise; abstract save(key: string, obj: T, options?: StorageOptions): Promise; abstract remove(key: string, options?: StorageOptions): Promise; }