import type { S2CellId } from '../../index.js'; import type { MMEntry, MultiMapStore } from './index.js'; import type { Properties, Value } from '../../index.js'; /** * # MultiMap MMap Store * * ## Description * A mmap multimap store * * ## Usage * ```ts * import { MMapMultiMap } from 'gis-tools-ts/mmap'; * * interface Data { name: string }; * * const mm = new FileMultiMap(); * // set a key * mm.set(1n, { name: 'test' }); * mm.set(1n, { name: 'test2' }); * // get a key * const { name } = mm.get(1n); // [{ name: 'test' }, { name: 'test2' }] * // check if a key exists * mm.has(1n); // true * // get length of the store * console.log(mm.length); // 2 * * // iterate over the store * for await (const entry of mm) console.log(entry); * * // close the store * mm.close(); * ``` */ export declare class MMapMultiMap implements MultiMapStore { #private; /** * Builds a new MultiMap file store * @param fileName - the path + file name without the extension */ constructor(fileName?: string); /** @returns - the length of the map */ get length(): number; /** * Adds a value to the list of values associated with a key * @param key - the key * @param value - the value to store */ set(key: number | S2CellId, value: V): void; /** * Check if the key exists * @param key - the key * @returns true if the key exists */ has(key: number | S2CellId): Promise; /** * Gets the list of values associated with a key * @param key - the key * @returns the list of values if the map contains values for the key */ get(key: number | S2CellId): Promise; /** * iterate through the values * @yields {MMEntry} - the Key-Value iterator */ entries(): AsyncGenerator>; /** * iterate through the values * @returns - an iterator */ [Symbol.asyncIterator](): AsyncGenerator>; /** Closes the store */ close(): void; } //# sourceMappingURL=mmap.d.ts.map