import { AppKitError } from "./base.js";

//#region src/errors/connection.d.ts

/**
 * Error thrown when a connection or network operation fails.
 * Use for database pool errors, API failures, timeouts, etc.
 *
 * @example
 * ```typescript
 * throw new ConnectionError("Query failed", { cause: pgError });
 * throw new ConnectionError("No response received from SQL Warehouse API");
 * ```
 */
declare class ConnectionError extends AppKitError {
  readonly code = "CONNECTION_ERROR";
  readonly statusCode = 503;
  readonly isRetryable = true;
  /**
   * Create a connection error for query failure
   */
  static queryFailed(cause?: Error): ConnectionError;
  /**
   * Create a connection error for transaction failure
   */
  static transactionFailed(cause?: Error): ConnectionError;
  /**
   * Create a connection error for pool errors
   */
  static poolError(operation: string, cause?: Error): ConnectionError;
  /**
   * Create a connection error for API failures
   */
  static apiFailure(service: string, cause?: Error): ConnectionError;
  /**
   * Create a connection error for client unavailable
   */
  static clientUnavailable(clientType: string, hint?: string): ConnectionError;
}
//#endregion
export { ConnectionError };
//# sourceMappingURL=connection.d.ts.map