import { LodestarErrorObject } from "@lodestar/utils";
/**
 * Error that can be passed across thread boundaries
 */
export type ThreadBoundaryError = {
    error: null;
    object: LodestarErrorObject;
} | {
    error: Error;
    object: null;
};
/**
 * Structured clone does not work with Error objects.
 * For LodestarError, we want to specify the LodestarErrorObject with className so that we can deserialize later.
 */
export declare function toThreadBoundaryError(error: Error): ThreadBoundaryError;
/**
 * If error is LodestarError, deserialize it from the LodestarErrorObject.
 * Else use the generic Error object.
 */
export declare function fromThreadBoundaryError(error: ThreadBoundaryError): Error;
//# sourceMappingURL=error.d.ts.map