import TypeIndex from "./type_index.js"; /** * A minimal perfect hash indexing lookup that */ export default class MinimalPerfectHash implements ReadonlyMap, TypeIndex { private readonly gMap_; private readonly keyPrefixSum_; private readonly slotMap_; private readonly keyBlob_; /** * * @param gMap_ The G mapping (see minimum perfect hashing algorithm) * that provides the initial mapping from the first colliding hash function * to the secondary disambiguation hash function. * @param keyPrefixSum_ The mapping to the actual key buffer in the form * of a prefix sum table. * @param slotMap_ The slots in the hash mapped back to their enum values. * @param keyBlob_ The blob of keys indexed by the prefix sum. */ constructor(gMap_: Int32Array, keyPrefixSum_: Uint32Array, slotMap_: Int32Array, keyBlob_: Uint8Array); /** * Iterates through this (alias for this.entries() that works with for of loop). * * @return {IterableIterator} The iterator to iterate through this. */ [Symbol.iterator](): IterableIterator<[ Uint8Array, ValueType ]>; /** * Get the number of keys/slots in this. * * @return {number} The number of keys/slots. */ get size(): number; /** * Implements the for each idiom on this map. * * @param callbackfn The callback function to call per element. * @param thisArg Extra arg to bind this to callback function. */ forEach(callbackfn: (value: ValueType, key: Uint8Array, map: MinimalPerfectHash) => void, thisArg?: any): void; /** * Get all the items in this map in the form of a lazy iterator. * * @return {IterableIterator} The lazy iterator to loop through the entries in the map. * @yields {[Uint8Array, number]} A key value tuple pair between slot valeus and the * key data. */ entries(): IterableIterator<[ Uint8Array, ValueType ]>; /** * Get all the keys in this map in the form of a lazy iterator. * * @return {IterableIterator} The lazy iterator to loop through the keys in the map. * @yields {Uint8Array} A key from this map. */ keys(): IterableIterator; /** * Get all the values in this map in the form of a lazy iterator. * * @return {IterableIterator} The lazy iterator to loop through the values in the map. * @yields {number} A value from this map. */ values(): IterableIterator; /** * Does this map have a particular key. * * @param buffer The buffer to get the key to match from. * @param offset An optional offset into the buffer (will be 0 if not specified) * @param end The end offset in the buffer (non inclusive, will be length if specified. * @return {boolean} True if the key is in the map. */ has(buffer: Uint8Array, offset?: number, end?: number): boolean; /** * Get the corresponding value in this map for a particular key. * * @param buffer The buffer to get the key to match from. * @param offset An optional offset into the buffer (will be 0 if not specified) * @param end The end offset in the buffer (non inclusive, will be length if specified. * @return {number | undefined} The matching value if the key is in the map, * otherwise undefined. */ get(buffer: Uint8Array, offset?: number, end?: number): ValueType | undefined; } //# sourceMappingURL=minimal_perfect_hash.d.ts.map