/** * Structured error type for CLI commands. * Preserves Ably error codes and HTTP status codes through the error pipeline. */ export declare class CommandError extends Error { readonly code?: number; readonly statusCode?: number; readonly context: Record; constructor(message: string, opts?: { code?: number; statusCode?: number; context?: Record; cause?: Error; }); /** * Extract structured data from any error type: * - CommandError → pass through (merge context) * - Ably ErrorInfo (duck-typed: has code + statusCode) → extract structured fields * - Error with .code property → extract code * - Plain Error → message only * - string → wrap in CommandError * - unknown → String(error) */ static from(error: unknown, context?: Record): CommandError; /** * Create a CommandError from an HttpPaginatedResponse error. * Extracts errorCode, errorMessage, and statusCode from the response. */ static fromHttpResponse(response: { statusCode: number; errorCode?: number | null; errorMessage?: string | null; }, action: string): CommandError; /** Produce JSON-safe data for the error envelope */ toJsonData(hint?: string): Record; }