import { AbstractCreatable } from '@ariestools/sdk'; import type { SyncMap } from '@xyo-network/xl1-protocol/protocol-lib'; import type { Database, Key, RootDatabase } from 'lmdb'; import type { LmdbMapParams } from './Params.ts'; /** * A synchronous LMDB-backed Map implementation. * This class provides a synchronous interface to an LMDB database, allowing for key-value storage. * It allows for multi-tenancy within a single LMDB environment by using a root database (located * at this.folderPath) and a specific DB within the environment (specified by this.params.storeName). * @template K - The type of keys in the map. * @template V - The type of values in the map. */ export declare class SynchronousLmdbMap extends AbstractCreatable implements SyncMap { protected db: Database; protected rootDatabase: RootDatabase; /** * The path to the LMDB folder where the database is stored. * This is constructed from the location and dbName parameters * allowing for multiple DBs within the root (by specifying a * different storeName). * @returns The folder path for the LMDB database. */ get folderPath(): string; /** Returns all values currently stored in the named LMDB database. */ all(): V[]; /** Removes every key/value entry from the named database synchronously. */ clear(): void; /** Removes a key synchronously and reports whether it existed. */ delete(id: K): boolean; /** Returns the value stored for a key, or `undefined` when absent. */ get(id: K): V | undefined; /** Returns the values found for the supplied keys, omitting absent entries. */ getMany(ids: K[]): V[]; /** Returns whether the named database contains the key. */ has(id: K): boolean; /** Stores a key/value pair synchronously. */ set(id: K, data: V): void; /** Stores each supplied key/value pair synchronously. */ setMany(entries: [K, V][]): void; /** Opens the LMDB environment and named database before map operations begin. */ startHandler(): Promise; } //# sourceMappingURL=SynchronousLmdbMap.d.ts.map