declare global {
    interface Error {
        code?: unknown;
    }
}
export type PlainObject = Record<string, unknown>;
export interface SerializedError extends PlainObject {
    message: string;
    name: string;
    stack?: string;
    code?: unknown;
}
export declare function serializeError(error: Error): SerializedError;
/**
 * Creates a javascript `Error` from an unknown value if it's not already an error.
 * Does a best effort at inferring a message. Intended to be used typically in `catch`
 * blocks, as there is no way to enforce only `Error` objects being thrown.
 *
 * ```
 * try {
 *   // ...
 * } catch (rawError) {
 *   const error = errorFrom(rawError);
 *   console.assert(error instanceof Error);
 * }
 * ```
 */
export declare function errorFrom(maybeError: unknown): Error;
