IStorageManager<T>
Defined in: atomiq-base/src/storage/IStorageManager.ts:11
Interface for storage managers that persist StorageObject instances. Provides basic CRUD operations with in-memory caching via the data property.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends StorageObject | Type of StorageObject to manage |
Properties
data
data: object;
Defined in: atomiq-base/src/storage/IStorageManager.ts:14
In-memory cache of stored objects, keyed by hash
Index Signature
[key: string]: T
Methods
init()
init(): Promise<void>;
Defined in: atomiq-base/src/storage/IStorageManager.ts:19
Initializes the storage backend
Returns
Promise<void>
loadData()
loadData(type): Promise<T[]>;
Defined in: atomiq-base/src/storage/IStorageManager.ts:42
Loads all stored objects and deserializes them using the provided constructor
Parameters
| Parameter | Type | Description |
|---|---|---|
type | (data) => T | Constructor function to instantiate each object |
Returns
Promise<T[]>
Array of deserialized objects
removeData()
removeData(hash): Promise<void>;
Defined in: atomiq-base/src/storage/IStorageManager.ts:34
Removes an object from storage
Parameters
| Parameter | Type | Description |
|---|---|---|
hash | string | Identifier of the object to remove |
Returns
Promise<void>
removeDataArr()?
optional removeDataArr(keys): Promise<void>;
Defined in: atomiq-base/src/storage/IStorageManager.ts:49
Removes multiple objects from storage (optional batch operation)
Parameters
| Parameter | Type | Description |
|---|---|---|
keys | string[] | Array of identifiers to remove |
Returns
Promise<void>
saveData()
saveData(hash, object): Promise<void>;
Defined in: atomiq-base/src/storage/IStorageManager.ts:27
Saves an object to storage
Parameters
| Parameter | Type | Description |
|---|---|---|
hash | string | Unique identifier for the object |
object | T | Object to save |
Returns
Promise<void>
saveDataArr()?
optional saveDataArr(values): Promise<void>;
Defined in: atomiq-base/src/storage/IStorageManager.ts:56
Saves multiple objects to storage (optional batch operation)
Parameters
| Parameter | Type | Description |
|---|---|---|
values | object[] | Array of id-object pairs to save |
Returns
Promise<void>