import type { StorageItem, StorageTarget } from '../definitions/interfaces.js'; import type { KeyOf } from '../definitions/types.js'; import { Storage } from './storage.js'; /** * The SyncStorage class is an abstraction to implement any synchronous storage API in an uniform way. * * [Aracna Reference](https://aracna.dariosechi.it/core/classes/sync-storage) */ export declare class SyncStorage extends Storage { constructor(name: string, clear: () => void, get: (key: string) => T, has: (key: string) => boolean, remove: (key: string) => void, set: (key: string, item: T) => void); /** * Clears the storage, removing all the items. */ clear(): void | Error; /** * Retrieves an item from the storage. */ get(key: string): T | Error; /** * 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.Shallow[]): void | Error; /** * 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.Shallow[]): void | Error; /** * 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.Shallow[]): void | Error; /** * 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.Shallow[]): boolean; }