IStorageProvider

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.

Source:

Methods

.clear() → Promise<void>

Async method that removes all keys and their values from storage

Source:
Returns:
Promise<void>

.get(key: string) → Promise<string>

Async method that gets the value of a key in storage

Parameters:
Name Type Description
key
string

The name of the key in storage

Source:
Returns:
Promise<string>

.init() → Promise<void>

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

Source:
Returns:
Promise<void>

.keys() → Promise<string[]>

Async method returning an array of stored key names

Source:
Returns:
Promise<string[]>

.remove(key: string) → Promise<void>

Async method that removes a key and its value from storage

Parameters:
Name Type Description
key
string

The name of the key in storage

Source:
Returns:
Promise<void>

.set(key: string, value: string) → Promise<void>

Async method that sets the value of a key in storage

Parameters:
Name Type Description
key
string

The name of the key in storage

value
string

The value to set in storage

Source:
Returns:
Promise<void>