import type { Key, Range } from './common.js'; /** * A set backed by a persistent store. */ interface AztecBaseSet { /** * Adds the given value. * @param key - The key to add. */ add(key: K): Promise; /** * Deletes the given key. * @param key - The key to delete. */ delete(key: K): Promise; } export interface AztecSet extends AztecBaseSet { /** * Checks if a key exists in the set. * @param key - The key to check * @returns True if the key exists, false otherwise */ has(key: K): boolean; /** * Iterates over the sets's keys entries in the key's natural order * @param range - The range of keys to iterate over */ entries(range?: Range): IterableIterator; } export interface AztecAsyncSet extends AztecBaseSet { /** * Checks if a key exists in the set. * @param key - The key to check * @returns True if the key exists, false otherwise */ hasAsync(key: K): Promise; /** * Iterates over the sets's keys entries in the key's natural order * @param range - The range of keys to iterate over */ entriesAsync(range?: Range): AsyncIterableIterator; }