import { IMessageAggregator, Result } from './result'; /** * A simple error aggregator to simplify collecting and reporting all errors in * a flow. * @public */ export declare class MessageAggregator implements IMessageAggregator { private readonly _messages; /** * Constructs a new {@link MessageAggregator | ErrorAggregator} with an * optionally specified initial set of error messages. * @param errors - optional array of errors to be included * in the aggregation. */ constructor(errors?: string[]); /** * {@inheritdoc IMessageAggregator.hasMessages} */ get hasMessages(): boolean; /** * {@inheritdoc IMessageAggregator.numMessages} */ get numMessages(): number; /** * {@inheritdoc IMessageAggregator.messages} */ get messages(): string[]; /** * {@inheritdoc IMessageAggregator.addMessage} */ addMessage(message: string | undefined): this; /** * {@inheritdoc IMessageAggregator.addMessages} */ addMessages(messages: string[] | undefined): this; /** * {@inheritdoc IMessageAggregator.toString} */ toString(separator?: string): string; /** * If any error messages have been aggregated, returns * {@link Failure | Failure} with the aggregated * messages concatenated using the optionally-supplied * separator, or newline. If the supplied {@link Result | Result} * contains an error message that has not already been aggregated, * it will be included in the aggregated messages. * * If no error messages have been aggregated, returns * the supplied {@link Result | Result}. * @param result - The {@link Result | Result} to be returned * if no messages have been aggregated. * @param separator - Optional string separator used to construct * the error message. * @returns {@link Failure | Failure} with an aggregated message * if any error messages were collected, the supplied * {@link Result | Result} otherwise. */ returnOrReport(result: Result, separator?: string): Result; } //# sourceMappingURL=messageAggregator.d.ts.map