UNPKG

@hirosystems/api-toolkit

Version:
21 lines (20 loc) 669 B
/** * Custom errors can only be deserialized correctly if they are registered here. */ export declare function addKnownErrorConstructor(constructor: new (message?: string, ..._arguments: unknown[]) => Error): void; type SerializedError = { constructorName: string; name: string; message: string; stack: string; [key: string]: any; }; export type ErrorLike = { name: string; message: string; stack: string; }; export declare function isErrorLike(value: unknown): value is ErrorLike; export declare function serializeError(subject: Error): SerializedError; export declare function deserializeError(subject: ErrorLike): Error; export {};