import { AbstractError } from "./AbstractError.js"; /** * The shape of an {@linkcode !Error} instance, after it has been serialized into a simple hash. */ export type SerializedError = Record | string | undefined>; /** * Determine if the given unknown subject is an {@linkcode !Error} instance. * @param subject - The object to inspect. * @returns `true` if the subject is an {@linkcode !Error}, `false` otherwise. */ export declare const isError: (subject: unknown) => subject is Error; /** * Returns an {@linkcode AbstractError} that best represents the passed subject. * If the passed subject is already an {@linkcode AbstractError}, it is returned as-is. * Otherwise, it will be converted into an appropriate error type. * @param subject - The subject to inspect * @returns An {@linkcode AbstractError} instance. */ export declare const unknownToError: (subject: unknown) => AbstractError; /** * Serializes an error into a string. * @param error - The error to stringify. * @returns A string representing the error. */ export declare const errorToString: (error: Error & { toString?: () => string; }) => string; /** * Serializes an error into a JSON string. * @param error - The error to stringify. * @returns A JSON string representing the error. */ export declare const errorToJSON: (error: Error) => string; /** * Converts an error into a regular hash. * @param error - The error to convert. * @returns A new object that contains all the properties of the error. */ export declare const errorToRecord: (error: Error) => Record; /** * Serializes an error into a simpler shape. * @param error - The error to serialize. * @returns A simple representation of the error. */ export declare const errorToSimpleSerializable: (error: AbstractError) => SerializedError;