UNPKG

622 BTypeScriptView Raw
1export interface ErrorLike {
2 message: string;
3 code?: string;
4}
5export declare const isErrorLike: (val: any) => val is ErrorLike;
6/**
7 * Ensures a value is a proper Error, copying all properties if needed.
8 */
9export declare const asError: (err: any) => Error;
10/**
11 * An Error that aggregates multiple errors.
12 */
13export interface AggregateError extends Error {
14 name: 'AggregateError';
15 errors: Error[];
16}
17/**
18 * Creates an AggregateError from multiple ErrorLikes.
19 *
20 * @param errors errors or ErrorLikes to aggregate
21 */
22export declare const createAggregateError: (errors?: ErrorLike[]) => AggregateError;