Padloc Logo Docs & Resources

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

core/src/storage.ts:40


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

core/src/storage.ts:37


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

core/src/storage.ts:34


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

core/src/storage.ts:43


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>

Defined in

core/src/storage.ts:31