import { AbortOptions, ContentId, MaybeAsyncIterableIterator, MaybePromise } from '@mithic/commons'; import { MaybeAsyncReadonlySet, MaybeAsyncReadonlySetBatch, MaybeAsyncSetDeleteBatch } from './set.js'; /** A readonly Map that may have async operations. */ export interface MaybeAsyncReadonlyMap extends MaybeAsyncReadonlySet { /** Gets a value by key from the map. */ get(key: K, options?: AbortOptions): MaybePromise; /** Returns whether a key exists in the map. */ has(key: K, options?: AbortOptions): MaybePromise; } /** A Map that may have async operations. */ export interface MaybeAsyncMap extends MaybeAsyncReadonlyMap { /** Deletes an entry by key from the map. Returns `MaybePromise` to be compatible with ES Map. */ delete(key: K, options?: AbortOptions): MaybePromise; /** Sets an entry in the map. Returns `MaybePromise` to be compatible with ES Map. */ set(key: K, value: V, options?: AbortOptions): MaybePromise; } /** A map store with auto-generated key. */ export interface AutoKeyMap extends AppendOnlyAutoKeyMap { /** Deletes the value with given key. */ delete(key: K, options?: AbortOptions): MaybePromise; } /** An append-only map store with auto-generated key. */ export interface AppendOnlyAutoKeyMap extends MaybeAsyncReadonlyMap { /** Puts given value and returns its key. */ put(value: V, options?: AbortOptions): MaybePromise; /** Gets the key of given value. */ getKey(value: V, options?: AbortOptions): MaybePromise; } /** Batch APIs for a {@link MaybeAsyncReadonlyMap}. */ export interface MaybeAsyncReadonlyMapBatch extends MaybeAsyncReadonlySetBatch { /** Gets the list of data identified by given keys. */ getMany(keys: Iterable, options?: AbortOptions): MaybeAsyncIterableIterator; } /** Batch set API for a {@link MaybeAsyncMap}. */ export interface MaybeAsyncMapSetBatch { /** Sets given list of entries. */ setMany(entries: Iterable<[K, V]>, options?: AbortOptions): MaybeAsyncIterableIterator; } /** Batch update API for a {@link MaybeAsyncMap}. */ export interface MaybeAsyncMapUpdateBatch { /** Sets or deletes given list of entries. */ updateMany(entries: Iterable<[key: K, value?: V]>, options?: AbortOptions): MaybeAsyncIterableIterator; } /** Batch APIs for a {@link MaybeAsyncMap}. */ export interface MaybeAsyncMapBatch extends MaybeAsyncReadonlyMapBatch, MaybeAsyncMapSetBatch, MaybeAsyncSetDeleteBatch, MaybeAsyncMapUpdateBatch { } /** Batch put API for a {@link AutoKeyMap}. */ export interface AutoKeyMapPutBatch { /** Puts given list of values and returns their keys. */ putMany(values: Iterable, options?: AbortOptions): MaybeAsyncIterableIterator<[key: K, error?: Error]>; } /** Batch APIs for a {@link AutoKeyMap}. */ export interface AutoKeyMapBatch extends MaybeAsyncReadonlyMapBatch, MaybeAsyncSetDeleteBatch, AutoKeyMapPutBatch { } //# sourceMappingURL=map.d.ts.map