import type { ErrorReport, OnError } from '../../types/errors.type'; import type { Reducer } from '../../types/reduce.type'; /** * @description * Use this helper to create an accumulated result given an array and an initial value. * - If the reducer throws an error for any element, the error is handled via the onError callback. * - Collects errors in an array and returns it in the report. * - Allows for custom error handling through the onError option. * * @param {Array} collection The array to reduce. * @param {Reducer} reducer A function that processes each element. * @param {TOutput} initialValue The initial value for the accumulator. * @param {{ onError?: OnError }} options Optional error handling configuration. * * @returns {{ result: TOutput; errors: Array> }} An object containing the accumulated result and any errors encountered. */ export declare const safeReduceWithErrors: (collection: Array, reducer: Reducer, initialValue: TOutput, options?: { onError?: OnError; }) => { result: TOutput; errors: Array>; };