import { enumify , IBackupService , ILoggerService } from "@connext/types" ; import { Sequelize } from "sequelize" ; export type StoreOptions = { backupService ? : IBackupService ; logger ? : ILoggerService ; sequelize ? : Sequelize ; prefix ? : string ; separator ? : string ; } ; export interface IAsyncStorage { getItem ( key ) : Promise < string | null > ; setItem ( key , value ) : Promise < void > ; removeItem ( key ) : Promise < void > ; } export const StoreTypes = enumify ( { AsyncStorage : "AsyncStorage" , File : "File" , LocalStorage : "LocalStorage" , Postgres : "Postgres" , Memory : "Memory" , } ) ; export type StoreTypes = typeof StoreTypes [ keyof typeof StoreTypes ] ; export interface KeyValueStorage { init ( ) : Promise < void > ; close ( ) : Promise < void > ; getKey ( ... args ) : string ; getKeys ( ) : Promise < string [ ] > ; getEntries ( ) : Promise < [ string , any ] [ ] > ; getItem < T = any > ( key ) : Promise < T | undefined > ; setItem < T = any > ( key , value ) : Promise < void > ; removeItem ( key ) : Promise < void > ; }