//#region src/Array/findLastOrElse.d.ts /** * # findLastOrElse * * ```ts * function Array.findLastOrElse( * target: readonly T[], * predicate: ( * value: NoInfer, * index: number, * target: readonly NoInfer[], * ) => boolean, * orElse: (target: readonly NoInfer[]) => V, * ): Exclude | V * ``` * * Returns the last element in `array` that satisfies the provided `predicate` function, or the result of calling `callback` with the array if no element is found. * * ## Example * * ```ts [data-first] * import { Array } from "@monstermann/array"; * * Array.findLastOrElse( * [1, 2, 3, 4], * (x) => x > 10, * (arr) => arr.length, * ); // 4 * ``` * * ```ts [data-last] * import { Array } from "@monstermann/array"; * * pipe( * [1, 2, 3, 4], * Array.findLastOrElse( * (x) => x > 10, * (arr) => arr.length, * ), * ); // 4 * ``` * */ declare const findLastOrElse: { (predicate: (value: NoInfer, index: number, target: readonly NoInfer[]) => value is U, orElse: (target: readonly Exclude[]) => V): (target: readonly T[]) => Exclude | V; (predicate: (value: NoInfer, index: number, target: readonly NoInfer[]) => boolean, orElse: (target: readonly NoInfer[]) => V): (target: readonly T[]) => Exclude | V; (target: readonly T[], predicate: (value: NoInfer, index: number, target: readonly NoInfer[]) => value is U, orElse: (target: readonly Exclude[]) => V): Exclude | V; (target: readonly T[], predicate: (value: NoInfer, index: number, target: readonly NoInfer[]) => boolean, orElse: (target: readonly NoInfer[]) => V): Exclude | V; }; //#endregion export { findLastOrElse };