import type { Category } from "./hardware-errors-enums.mjs"; import { ErrorCode, Severity } from "./hardware-errors-enums.mjs"; export type HardwareWalletErrorOptions = { code: ErrorCode; severity: Severity; category: Category; userMessage: string; cause?: Error; metadata?: Record; }; export declare class HardwareWalletError extends Error { #private; readonly id: string; readonly code: ErrorCode; readonly severity: Severity; readonly category: Category; readonly userMessage: string; readonly timestamp: Date; readonly metadata: Record | undefined; readonly cause: Error | undefined; constructor(message: string, options: HardwareWalletErrorOptions); /** * Checks if this error is critical. * * @returns True if the error is critical, false otherwise. */ isCritical(): boolean; /** * Checks if this error is a warning. * * @returns True if the error is a warning, false otherwise. */ isWarning(): boolean; /** * Creates a new error instance with additional metadata. * * @param additionalMetadata - Additional metadata to merge with existing metadata. * @returns A new HardwareWalletError instance with merged metadata. */ withMetadata(additionalMetadata: Record): HardwareWalletError; /** * Serializes the error to a JSON-compatible object. * Note: The cause property is serialized if it exists. * * @returns A JSON-compatible object representation of the error. */ toJSON(): Record; /** * Returns a user-friendly string representation of the error. * * @returns A user-friendly string representation of the error. */ toString(): string; /** * Returns a detailed string representation for debugging. * * @returns A detailed string representation of the error for debugging. */ toDetailedString(): string; static isHardwareWalletError(error: unknown): error is HardwareWalletError; } //# sourceMappingURL=hardware-error.d.mts.map