/** * Interface for storage providers to implement, providing compile-time * errors for incorrect implementations alongside the abstract StorageProvider * class to extend which provides runtime errors for missing method implementations * * >**Note:** This is a TypeScript feature and you do not need to worry about this bit so much * if you are using JavaScript. * @interface IStorageProvider */ /** * Async method to be run that will set up the storage provider * for use. Calls to other provider methods should not be made * until this method has been called and resolved * @method IStorageProvider#init * @returns {Promise} */ /** * Async method returning an array of stored key names * @method IStorageProvider#keys * @returns {Promise} */ /** * Async method that gets the value of a key in storage * @method IStorageProvider#get * @param {string} key The name of the key in storage * @returns {Promise} */ /** * Async method that sets the value of a key in storage * @method IStorageProvider#set * @param {string} key The name of the key in storage * @param {string} value The value to set in storage * @returns {Promise} */ /** * Async method that removes a key and its value from storage * @method IStorageProvider#remove * @param {string} key The name of the key in storage * @returns {Promise} */ /** * Async method that removes all keys and their values from storage * @method IStorageProvider#clear * @returns {Promise} */ export interface IStorageProvider { init(): Promise; keys(): Promise; get(key: string): Promise; set(key: string, value: string): Promise; remove(key: string): Promise; clear(): Promise; }