import { MaybeAsyncAppendOnlySet } from '../set.js'; /** A simple bloom filter implementation. */ export declare class BloomFilter implements MaybeAsyncAppendOnlySet { private readonly m; private readonly k; private readonly hash; private value; private n; constructor({ m, k, hash, value, n }: BloomFilterOptions); /** Returns the approximate number of elements in the bloom filter. */ get size(): number; /** Returns the false positive rate of the bloom filter = `(1 - e^(-kn/m))^k`. */ get rate(): number; /** Clears the bloom filter. */ clear(): void; add(value: T): this; /** * Returns false if the bloom filter definitely does not contain the given value; * true if it probably contains the value; */ has(value: T): boolean; toJSON(): BloomFilterJSON; get [Symbol.toStringTag](): string; } /** The JSON representation of a {@link BloomFilter}. */ export interface BloomFilterJSON { /** The hexstring bit value of the bloom filter. */ value: string; /** The bit size of the bloom filter. */ m: number; /** The number of hash functions to use. */ k: number; /** The number of elements in the bloom filter. */ n: number; } /** Options for creating a {@link BloomFilter}. */ export interface BloomFilterOptions { /** The bit size of the bloom filter. */ m: number; /** The number of hash functions to use. */ k: number; /** The k hash functions */ hash?: (value: T, seed: number) => number; /** The initial bit value of the bloom filter. */ value?: bigint | number | string; /** The initial number of elements in the bloom filter. */ n?: number; } //# sourceMappingURL=bloomfilter.d.ts.map