import { AbortOptions, MaybePromise } from '@mithic/commons'; import { MaybeAsyncMap, MaybeAsyncMapBatch } from '../map.js'; /** A map adapter that encodes keys and/or values. */ export declare class EncodedMap & Partial & Iterable<[TK, TV]> & AsyncIterable<[TK, TV]>> = MaybeAsyncMap & Partial & Iterable<[TK, TV]> & AsyncIterable<[TK, TV]>>> implements MaybeAsyncMap, MaybeAsyncMapBatch, Partial & AsyncIterable<[K, V]>> { /** The underlying map. */ readonly map: M; protected readonly encodeKey: (key: K) => TK; protected readonly decodeKey: (key: TK) => K; protected readonly encodeValue: (value: V) => TV; protected readonly decodeValue: (value: TV) => V; [Symbol.iterator]: M extends Iterable<[TK, TV]> ? () => IterableIterator<[K, V]> : undefined; [Symbol.asyncIterator]: M extends (Iterable<[TK, TV]> | AsyncIterable<[TK, TV]>) ? () => AsyncIterableIterator<[K, V]> : undefined; constructor( /** The underlying map. */ map: M, { encodeKey, decodeKey, encodeValue, decodeValue, }?: EncodedMapOptions); get(key: K, options?: AbortOptions): MaybePromise; set(key: K, value: V, options?: AbortOptions): MaybePromise; delete(key: K, options?: AbortOptions): MaybePromise; has(key: K, options?: AbortOptions): MaybePromise; getMany(keys: Iterable, options?: AbortOptions): AsyncIterableIterator; hasMany(keys: Iterable, options?: AbortOptions): AsyncIterableIterator; setMany(entries: Iterable<[K, V]>, options?: AbortOptions): AsyncIterableIterator; deleteMany(keys: Iterable, options?: AbortOptions): AsyncIterableIterator; updateMany(entries: Iterable<[K, V?]>, options?: AbortOptions): AsyncIterableIterator; get [Symbol.toStringTag](): string; private decodeOptionalValue; } /** Options for creating an {@link EncodedMap}. */ export interface EncodedMapOptions { /** The key encoder. */ encodeKey?: (key: K) => TK; /** The key decoder. Optional if map key iteration is not needed. */ decodeKey?: (key: TK) => K; /** The value encoder. */ encodeValue?: (value: V) => TV; /** The value decoder. */ decodeValue?: (value: TV) => V; } //# sourceMappingURL=encodedmap.d.ts.map