LocalStorage class
A basic storage plugin that stores data to the local file system.
Signature:
export declare class LocalStorage implements IStorage Implements: IStorage
References: IStorage
Constructor
new LocalStorage (client: Client, root: string)Constructs a new instance of the LocalStorage class.
Parameters:
Methods
.fetch ()
Fetches a value from storage.
Signature:
fetch<T>(key: string, id: string): Promise<T>;Parameters:
| Parameter | Type | Description |
|---|---|---|
| key | String | The path to the value to fetch. |
| id | String | The file name of the value to fetch. |
Return type: Promise < T >
.remove ()
Deletes a value from storage.
Signature:
remove(key: string, id: string): void;Parameters:
| Parameter | Type | Description |
|---|---|---|
| key | String | The path to the value to delete. |
| id | String | The file name of the value to delete. |
Return type: void
.save ()
Saves a value to storage.
Signature:
save<T>(value: T, key: string, id: string): Promise<T>;Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | T | The value to save. |
| key | String | The path to the value to save. |
| id | String | The file name of the value to save. |
Return type: Promise < T >
.search ()
Signature:
search<T>(key: string, query: { [key: string]: any; }): Promise<T[]>;Parameters:
| Parameter | Type | Description |
|---|---|---|
| key | String | |
| query | { key: string: any; } |
Return type: Promise < T >
Table of Contents
