import { ObjectWrapper } from './object'; import type { Pipe } from './lift'; import { Draft, NoReturn, AtomicObject } from './immupdate'; /** A Map wrapper providing extra functionalities and more chaining opportunities */ export declare class MapWrapper> { private _value; constructor(_value: M); private _isLiftWrapper; value(): M; private _clone; /** * Sets a new key/value. */ set(key: K, value: V): MapWrapper>; /** * Deletes a key/value. */ delete(key: K): MapWrapper>; /** * Maps this Map's keys and values, unless void or undefined is returned, in which case the entry is filtered. * This is effectively a filter + map combined in one. */ collect(iterator: (key: K, value: V) => [KK, VV] | undefined | void): MapWrapper>; /** * Filters this Map's keys and values by aplying a predicate to all values and refine its type. */ filter(predicate: (key: K, value: V) => value is VV): MapWrapper>; /** * Filters this Map's keys and values. */ filter(predicate: (key: K, value: V) => boolean): this; /** * Returns the first element in this Map or undefined. */ first(): V | undefined; /** * Returns the last element in this Map or undefined. */ last(): V | undefined; /** * Maps this map's values. */ mapValues(mapFunction: (value: V) => VV): MapWrapper>; /** * Pipes this Map with an arbitrary transformation function. */ pipe: typeof import("./lift").pipe; /** * If this key is missing, set a default value. */ setDefaultValue(key: K, value: V): MapWrapper; /** * If the key is found, run the drafted value through an update function. * For primitives, the update function must return a new value whereas for objects, the drafted value can be modified directly. */ updateValue(key: K, updater: (value: Draft) => V extends AtomicObject ? V : NoReturn): MapWrapper; /** * Transforms this Map into an Array of [key, value] tuples. */ toArray(): import("./array").ArrayWrapper<[K, V][]>; /** * Transforms this Map into an Object. * Only available if this Map's keys are a subtype of string or number. */ toObject(this: MapWrapper): ObjectWrapper>; } export declare function setMapPipe(_pipe: Pipe): void; declare type MapOf, K, V> = T extends Map ? Map : ReadonlyMap; export {};