declare type StorageValue = null | string | String | number | Number | boolean | Boolean | object; declare type WatchEvent = 'update' | 'remove'; declare type WatchCallback = (event: WatchEvent, key: string) => any; interface StorageMeta { atime?: Date; mtime?: Date; [key: string]: StorageValue | Date | undefined; } interface Driver { hasItem: (key: string) => boolean | Promise; getItem: (key: string) => StorageValue; setItem?: (key: string, value: string) => void | Promise; removeItem?: (key: string) => void | Promise; getMeta?: (key: string) => StorageMeta | Promise; getKeys: (base?: string) => string[] | Promise; clear?: () => void | Promise; dispose?: () => void | Promise; watch?: (callback: WatchCallback) => void | Promise; } interface Storage { hasItem: (key: string) => Promise; getItem: (key: string) => Promise; setItem: (key: string, value: StorageValue) => Promise; removeItem: (key: string, removeMeta?: boolean) => Promise; getMeta: (key: string, nativeMetaOnly?: true) => StorageMeta | Promise; setMeta: (key: string, value: StorageMeta) => Promise; removeMeta: (key: string) => Promise; getKeys: (base?: string) => Promise; clear: (base?: string) => Promise; dispose: () => Promise; watch: (callback: WatchCallback) => Promise; mount: (base: string, driver: Driver) => Storage; unmount: (base: string, dispose?: boolean) => Promise; } export { Driver as D, Storage as S, WatchEvent as W, StorageValue as a, WatchCallback as b, StorageMeta as c };