@xylabs/storage


Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Reference
@xylabs/storage
Interfaces
interfaces
KeyValueStore
@xylabs/storage
A read/write storage device.
Extends
Type Parameters
Methods
get()
get(key: TKey): Promisable<TValue | undefined>;
Returns a promise that resolves to the value for the given key.
Parameters
key | TKey | The key to get the value for. |
Returns
Promisable<TValue | undefined>
Inherited from
ReadonlyKeyValueStore.get
keys()?
optional keys(): Promisable<TKey[]>;
The keys an array of keys.
Returns
Promisable<TKey[]>
Inherited from
ReadonlyKeyValueStore.keys
clear()?
optional clear(): Promisable<void>;
Removes all entries from the store.
Returns
Promisable<void>
delete()
delete(key: TKey): Promisable<void>;
Deletes the entry with the given key.
Parameters
key | TKey | The key of the entry to delete |
Returns
Promisable<void>
set()
set(key: TKey, value: TValue): Promisable<void>;
Sets a value for the given key, creating or updating the entry.
Parameters
key | TKey | The key to set |
value | TValue | The value to store |
Returns
Promisable<void>
ReadonlyKeyValueStore
@xylabs/storage
A readonly storage device.
Extended by
Type Parameters
Methods
get()
get(key: TKey): Promisable<TValue | undefined>;
Returns a promise that resolves to the value for the given key.
Parameters
key | TKey | The key to get the value for. |
Returns
Promisable<TValue | undefined>
keys()?
optional keys(): Promisable<TKey[]>;
The keys an array of keys.
Returns
Promisable<TKey[]>
Part of sdk-js
Maintainers
License
See the LICENSE file for license details
Credits
Made with š„ and āļø by XYLabs