Interface: Storage
storage.Storage
Generic interface for data storage
Implemented by
Methods
clear
▸ clear(): Promise
<void
>
Deletes all data in this storage
Returns
Promise
<void
>
Defined in
delete
▸ delete<T
>(obj
): Promise
<void
>
Deletes an object
Type parameters
Name | Type |
---|---|
T |
extends Storable <T > |
Parameters
Name | Type |
---|---|
obj |
T |
Returns
Promise
<void
>
Defined in
get
▸ get<T
>(cls
, id
): Promise
<T
>
Retrieves an object of type T
based on its id
Type parameters
Name | Type |
---|---|
T |
extends Storable <T > |
Parameters
Name | Type |
---|---|
cls |
T | StorableConstructor <T > |
id |
string |
Returns
Promise
<T
>
Defined in
list
▸ list<T
>(cls
, opts?
): Promise
<T
[]>
Retrieves an object of type T
based on its id
Type parameters
Name | Type |
---|---|
T |
extends Storable <T > |
Parameters
Name | Type |
---|---|
cls |
StorableConstructor <T > |
opts? |
StorageListOptions <T > |
Returns
Promise
<T
[]>
Defined in
save
▸ save<T
>(obj
): Promise
<void
>
Saves an object to the storage
Type parameters
Name | Type |
---|---|
T |
extends Storable <T > |
Parameters
Name | Type |
---|---|
obj |
T |
Returns
Promise
<void
>