import type { Address } from "viem"; /** * Case-insensitive map keyed by EVM addresses. * * All keys are checksummed via viem's {@link getAddress} on insertion and * lookup, so `0xabc...` and `0xABC...` resolve to the same entry. * * @typeParam T - Type of values stored in the map. */ export declare class AddressMap { #private; /** * @param entries - Optional initial key-value pairs. Address strings are checksummed automatically. * @param name - Optional label used in error messages when a lookup fails. */ constructor(entries?: Array<[string, T]>, name?: string); /** * Adds or updates a value. Passing `undefined` removes the entry. * @param address - EVM address (checksummed automatically). * @param value - Value to store, or `undefined` to delete the entry. * @throws If the map has been {@link freeze | frozen}. */ upsert(address: string, value: T | undefined): void; /** * Inserts a value, throwing if the address is already present. * @param address - EVM address (checksummed automatically). * @param value - Value to store. * @throws If the map has been {@link freeze | frozen} or if `address` already exists. */ insert(address: string, value: T): void; /** * Checks whether an address is present in the map. * @param address - EVM address (case-insensitive). */ has(address: string): boolean; /** * Looks up a value by EVM address (case-insensitive). * @param address - EVM address to look up. * @returns The stored value, or `undefined` if not present. */ get(address: string): T | undefined; /** * Looks up a value by EVM address, throwing if the address is absent. * @param address - EVM address to look up. * @throws If `address` is not in the map. */ mustGet(address: string): T; /** * Removes an entry by address. No-op if the address is absent. * @param address - EVM address to remove. */ delete(address: string): void; /** * Removes all entries from the map. **/ clear(): void; /** * Returns all entries as an array of `[checksummedAddress, value]` tuples. **/ entries(): Array<[Address, T]>; /** * Returns all values in insertion order. **/ values(): T[]; /** * Returns all checksummed addresses in insertion order. **/ keys(): Address[]; /** * Converts the map to a plain `Record` object. **/ asRecord(): Record; /** * Number of entries in the map. **/ get size(): number; /** * Prevents further mutations. Any subsequent call to {@link upsert}, * {@link insert}, or {@link delete} will throw. */ freeze(): void; protected get name(): string | undefined; /** * Creates an `AddressMap` from a plain record object. * @param record - Object whose keys are EVM addresses. */ static fromRecord(record: Record): AddressMap; /** * Creates an `AddressMap` by extracting an address from each array element. * @param array - Source items. * @param mapFn - Function that returns the address key for a given item. */ static fromMappedArray(array: T[], mapFn: (item: T) => Address): AddressMap; }