/**
 * @module errors
 * Named error class hierarchy for Xchange (@private.me/xchange).
 *
 * Provides structured error types for XorIDA key transport operations
 * including key generation, encryption, decryption, and bundle validation.
 */
import type { ACIErrorDetail } from '@private.me/ux-helpers';
/** Base error class for all Xchange operations. */
export declare class XchangeErrorClass extends Error {
    readonly code: string;
    readonly subCode?: string;
    readonly docUrl?: string;
    constructor(code: string, message: string, docUrl?: string);
}
/** Error thrown when AES-256-GCM key generation fails. */
export declare class KeygenError extends XchangeErrorClass {
    constructor(code: string, message: string);
}
/** Error thrown when bundle encryption fails. */
export declare class EncryptError extends XchangeErrorClass {
    constructor(code: string, message: string);
}
/** Error thrown when bundle decryption fails. */
export declare class DecryptError extends XchangeErrorClass {
    constructor(code: string, message: string);
}
/** Error thrown when bundle format is invalid. */
export declare class BundleError extends XchangeErrorClass {
    constructor(code: string, message: string);
}
/** Human-readable messages for each error code. */
export declare const ERROR_MESSAGES: Record<string, string>;
/**
 * Convert an unknown error into a XchangeErrorClass.
 *
 * @param error - The unknown error to convert
 * @returns A XchangeErrorClass instance
 */
export declare function toXchangeError(error: unknown): XchangeErrorClass;
/**
 * Type guard to check if an error is a XchangeErrorClass.
 *
 * @param error - The value to check
 * @returns true if the value is a XchangeErrorClass instance
 */
export declare function isXchangeError(error: unknown): error is XchangeErrorClass;
/**
 * Create detailed error information for a Xchange error code.
 *
 * Provides user-friendly messages, resolution hints, field names, and
 * documentation links for all Xchange error codes.
 *
 * @param code - Error code from Result<T, XchangeError>
 * @param additionalContext - Optional override for hint or field
 * @returns Detailed error information
 *
 * @example
 * ```typescript
 * const error = createXchangeErrorDetail('INVALID_BUNDLE:TOO_SHORT');
 * console.log(error.message); // "Bundle is too short (minimum 60 bytes required)"
 * console.log(error.hint);    // "Bundle must contain at least 32B key + 12B IV + 16B auth tag..."
 * console.log(error.field);   // "bundle"
 * ```
 */
export declare function createXchangeErrorDetail(code: string, additionalContext?: {
    field?: string;
    hint?: string;
}): ACIErrorDetail;
