import type { StorageItem, StorageTarget } from '../definitions/interfaces.js'; import type { KeyOf } from '../definitions/types.js'; import { Storage } from './storage.js'; /** * The AsyncStorage class is an abstraction to implement any asynchronous storage API in an uniform way. * * [Aracna Reference](https://aracna.dariosechi.it/core/classes/async-storage) */ export declare class AsyncStorage extends Storage { constructor(name: string, clear: () => Promise, get: (key: string) => Promise, has: (key: string) => Promise, remove: (key: string) => Promise, set: (key: string, item: T) => Promise); /** * Clears the storage, removing all the items. */ clear(): Promise; /** * Retrieves an item from the storage. */ get(key: string): Promise; /** * Removes an item from the storage. * Optionally you can specify the keys of the item that you want to remove, if you don't specify any key the whole item will be removed. */ remove(key: string, keys?: KeyOf.Deep[]): Promise; /** * Sets an item in the storage. * Optionally you can specify the keys of the item that you want to set, if you don't specify any key the whole item will be set. */ set(key: string, item: T, keys?: KeyOf.Deep[]): Promise; /** * Copies an item from the storage to a target object. * Optionally you can specify the keys of the item that you want to copy, if you don't specify any key the whole item will be copied. */ copy(key: string, target: T2, keys?: KeyOf.Deep[]): Promise; /** * Checks if an item exists in the storage. * Optionally you can specify the keys of the item that you want to check, if you don't specify any key the whole item will be checked. */ has(key: string, keys?: KeyOf.Deep[]): Promise; }