//#region src/Map/findRemoveOrThrow.d.ts /** * # findRemoveOrThrow * * ```ts * function Map.findRemoveOrThrow( * target: ReadonlyMap, * predicate: ( * value: NoInfer, * key: NoInfer, * target: ReadonlyMap, * ) => boolean, * ): ReadonlyMap * ``` * * Finds the first entry in the map that satisfies the provided `predicate` function and removes it, returning a new map without the removed entry, or throws an error if no entry is found. * * ## Example * * ```ts [data-first] * import { Map } from "@monstermann/map"; * * Map.findRemoveOrThrow( * new Map([ * ["a", 1], * ["b", 2], * ["c", 3], * ]), * (value) => value > 1, * ); // Map(2) { "a" => 1, "c" => 3 } * ``` * * ```ts [data-last] * import { Map } from "@monstermann/map"; * * pipe( * new Map([ * ["a", 1], * ["b", 2], * ["c", 3], * ]), * Map.findRemoveOrThrow((value) => value > 1), * ); // Map(2) { "a" => 1, "c" => 3 } * ``` * */ declare const findRemoveOrThrow: { (predicate: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => boolean): (target: Map) => Map; (predicate: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => boolean): (target: ReadonlyMap) => ReadonlyMap; (target: Map, predicate: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => boolean): Map; (target: ReadonlyMap, predicate: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => boolean): ReadonlyMap; }; //#endregion export { findRemoveOrThrow };