import type { Stringifiable } from '..'; import type { Uint64, Uint64Cell } from '../dataStructures/uint64'; /** Options to create a S2MMapStore */ export interface MMapOptions { /** If true, then the values are stored in the index section of the keys file */ valuesAreIndex?: boolean; /** If true, then the data is already sorted and get calls can be immediately returned */ isSorted?: boolean; /** The maximum heap size in bytes for each grouping of data. */ maxHeap?: number; /** The number of threads to use for sorting */ threadCount?: number; /** If desired, a temporary directory to use */ tmpDir?: string; } /** An entry in a file */ export interface MMapEntry { key: Uint64Cell; value: V; } /** * NOTE: The File KVStore is designed to be used in states: * - write-only. The initial state is write-only. Write all you need to before reading * - read-only. Once you have written everything, the first read will lock the file to be static * and read-only. */ export declare class S2MMapStore { #private; readonly fileName: string; /** * Builds a new File based KV * @param fileName - the path + file name without the extension * @param options - the options of how the store should be created and ued */ constructor(fileName?: string, options?: MMapOptions); /** @returns - the length of the store */ get length(): number; /** * Adds a value to be associated with a key * @param key - the uint64 id * @param value - the value to store */ set(key: Uint64, value: V): void; /** * Gets the value associated with a key * @param key - the key * @param max - the max number of values to return * @param bigint - set to true if the key is a bigint * @returns the value if the map contains values for the key */ get(key: Uint64, max?: number, bigint?: boolean): Promise; /** Sort the data if not sorted */ sort(): Promise; /** * Closes the store * @param cleanup - set to true if you want to remove the .keys and .values files upon closing */ close(cleanup?: boolean): void; /** * Iterates over all values in the store * @param bigint - set to true if the value is a bigint stored in the index * @yields an iterator */ entries(bigint?: boolean): AsyncIterableIterator>; } //# sourceMappingURL=mmap.d.ts.map