/** * Vault Error Codes per ZK-Vault Specification ยง11 */ export declare enum VaultErrorCode { /** Unknown or unsupported suite */ BAD_SUITE = "ERR_BAD_SUITE", /** STARK verification failed */ BAD_PROOF = "ERR_BAD_PROOF", /** Nonce reused (replay attack detected) */ REPLAY = "ERR_REPLAY", /** Proof exceeds maxProofBytes */ SIZE = "ERR_SIZE", /** Unknown or stale context */ CTX = "ERR_CTX", /** No recipient wrap decapsulated */ DECRYPT_KEM = "ERR_DECRYPT_KEM", /** AEAD tag failure (AAD tamper or wrong CEK) */ DECRYPT_AEAD = "ERR_DECRYPT_AEAD", /** Header policy malformed or inconsistent */ POLICY = "ERR_POLICY", /** Vault not found */ NOT_FOUND = "ERR_NOT_FOUND", /** Threshold not met for reconstruction */ THRESHOLD_NOT_MET = "ERR_THRESHOLD_NOT_MET", /** Session expired */ SESSION_EXPIRED = "ERR_SESSION_EXPIRED", /** Storage operation failed */ STORAGE = "ERR_STORAGE", /** Storage operation failed (alias for STORAGE) */ STORAGE_ERROR = "ERR_STORAGE", /** Data integrity check failed (checksum mismatch) */ INTEGRITY_CHECK_FAILED = "ERR_INTEGRITY", /** Invalid key commitment */ KEY_COMMITMENT = "ERR_KEY_COMMITMENT", /** Invalid or missing key for operation */ INVALID_KEY = "ERR_INVALID_KEY" } /** * Base error class for all vault-related errors */ export declare class VaultError extends Error { readonly code: VaultErrorCode; constructor(code: VaultErrorCode, message: string); /** * Check if error matches a specific code */ is(code: VaultErrorCode): boolean; /** * Create a human-readable error message */ toString(): string; }