/**
 * API Utilities
 *
 * Consolidates API response validation, data extraction, and error handling patterns.
 * Eliminates repetition of response validation and error handling across services.
 */
/**
 * API Response Body structure (matches SDK's ResBody interface)
 */
interface ApiResponseBody<T = unknown> {
    success: boolean;
    data?: T;
    error?: string;
    message?: string;
}
/**
 * Generic API response type - flexible to handle SDK union types
 */
type ApiResponse<T = unknown> = {
    status: number;
    body?: ApiResponseBody<T> | null | unknown;
    [key: string]: unknown;
};
/**
 * Validate API response structure
 * Consolidates the repeated pattern: response.status === 200 && response.body?.success
 */
export declare function isValidApiResponse<T = unknown>(response: ApiResponse<T>): response is ApiResponse<T> & {
    status: 200;
    body: ApiResponseBody<T>;
};
/**
 * Extract data from API response with validation
 * Consolidates the pattern: isValidApiResponse(response) && response.body.data
 */
export declare function extractApiData<T>(response: ApiResponse<T>): T | null;
/**
 * Check if error is a connection/network error
 * Consolidates the repeated pattern across widgetValidationService and other services
 */
export declare function isConnectionError(error: unknown): boolean;
/**
 * Extract error message from unknown error type
 * Consolidates error instanceof Error ? error.message : String(error)
 */
export declare function extractErrorMessage(error: unknown, fallback?: string): string;
/**
 * Handle API error with consistent error message extraction
 */
export declare function handleApiError(error: unknown, context?: string): {
    isValid: false;
    error: string;
};
export {};
//# sourceMappingURL=apiUtils.d.ts.map