import { type Maybe } from '../value/maybe.type'; import { type StorageObject } from './storage.object'; /** * A StorageObject implementation that stores data in memory. * This is not persistent and will be cleared when the JavaScript context is lost. */ export declare class MemoryStorageInstance implements StorageObject { private _length; private _storage; /** * The number of items stored. * * @returns the current count of stored key-value pairs */ get length(): number; /** * Returns the key at the given index. * * @param index The index of the key to retrieve. * @returns The key string if found, otherwise null. */ key(index: number): string; /** * Checks if a key exists in the storage. * * @param key The key to check. * @returns True if the key exists, false otherwise. */ hasKey(key: string): boolean; /** * Retrieves an item from storage. * * @param key The key of the item to retrieve. * @returns The item string if found, otherwise null or undefined. */ getItem(key: string): Maybe; /** * Sets an item in storage. * If the item is null or undefined, the key will be removed. * * @param key The key of the item to set. * @param item The item string to store. */ setItem(key: string, item: Maybe): void; /** * Removes an item from storage. * * @param key The key of the item to remove. */ removeItem(key: string): void; /** * Clears all items from the storage. */ clear(): void; } /** * A shared, global instance of MemoryStorageInstance. * Useful for singleton-like access to an in-memory store throughout an application. */ export declare const SHARED_MEMORY_STORAGE: MemoryStorageInstance;