export declare type ErrorInfo = { space: ErrorCodeSpace; code: ErrorCode; message: string; innerError?: ErrorInfo; nativeError?: Error; customData?: any; }; export declare type ErrorInfoSpace = ErrorInfo & { space: T; }; /** * Caution: This does a (recursive) shallow clone. May matter if you have custom data. * In case you want that actually copied, take care of it yourself * @param errorInfo */ export declare function cloneErrorInfo(errorInfo: ErrorInfo, synthesizeNativeError?: boolean, onlyGenericProps?: boolean, withCustomData?: boolean): ErrorInfo; export declare function cloneErrorInfoSafe(errorInfo: ErrorInfo): ErrorInfo; /** * Uses `cloneErrorInfo` applied to an existing object of a type extending (i.e overlaping completely with) `ErrorInfo`. * @param errorInfo */ export declare function assignErrorInfo(errorInfoOut: Partial, errorInfoIn: ErrorInfo): ErrorInfo; export declare enum ErrorCodeSpace { NONE = 0, FLOW = 1, PROC = 2 } export declare function isErrorCodeSpace(errCode: ErrorCode, space: ErrorCodeSpace): boolean; export declare enum ErrorCode { GENERIC, FLOW_GENERIC, FLOW_INTERNAL, PROC_GENERIC, PROC_BAD_FORMAT, PROC_EARLY_EOS, PROC_INTERNAL } export declare function getErrorNameByCode(errCode: ErrorCode): string; export declare function getErrorSpaceByCode(errCode: ErrorCode): ErrorCodeSpace;