//#region src/Map/findReplaceOrElse.d.ts /** * # findReplaceOrElse * * ```ts * function Map.findReplaceOrElse( * target: ReadonlyMap, * predicate: ( * value: NoInfer, * key: NoInfer, * target: ReadonlyMap, * ) => boolean, * replacement: NoInfer, * orElse: (target: ReadonlyMap) => O, * ): ReadonlyMap | O * ``` * * Finds the first entry in the map that satisfies the provided `predicate` function and replaces its value with `replacement`, returning a new map with the replaced value, or the result of calling `orElse` with the map if no entry is found. * * ## Example * * ```ts [data-first] * import { Map } from "@monstermann/map"; * * Map.findReplaceOrElse( * new Map([ * ["a", 1], * ["b", 2], * ["c", 3], * ]), * (value) => value > 10, * 99, * (map) => map.size, * ); // 3 * ``` * * ```ts [data-last] * import { Map } from "@monstermann/map"; * * pipe( * new Map([ * ["a", 1], * ["b", 2], * ["c", 3], * ]), * Map.findReplaceOrElse( * (value) => value > 10, * 99, * (map) => map.size, * ), * ); // 3 * ``` * */ declare const findReplaceOrElse: { (predicate: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => boolean, replacement: NoInfer, orElse: (target: ReadonlyMap) => O): (target: Map) => Map | O; (predicate: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => boolean, replacement: NoInfer, orElse: (target: ReadonlyMap) => O): (target: ReadonlyMap) => ReadonlyMap | O; (target: Map, predicate: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => boolean, replacement: NoInfer, orElse: (target: ReadonlyMap) => O): Map | O; (target: ReadonlyMap, predicate: (value: NoInfer, key: NoInfer, target: ReadonlyMap) => boolean, replacement: NoInfer, orElse: (target: ReadonlyMap) => O): ReadonlyMap | O; }; //#endregion export { findReplaceOrElse };