/** * Error utilities for @saavn-labs/sdk * @module errors * @internal */ import { ZodError } from 'zod'; export type SDKErrorCode = 'INVALID_PARAMS' | 'INVALID_RESPONSE' | 'API_ERROR' | 'NETWORK_ERROR' | 'UNSUPPORTED_RUNTIME' | 'EXPERIMENTAL_FEATURE' | 'INTERNAL_ERROR'; export declare class SDKError extends Error { readonly code: SDKErrorCode; readonly details?: unknown; cause?: unknown; constructor(code: SDKErrorCode, message: string, options?: { details?: unknown; cause?: unknown; }); } export declare function fromZodError(error: ZodError, kind: 'params' | 'response', context?: string): SDKError; export declare function networkError(context?: string, status?: number): SDKError; export declare function experimentalError(message?: string): SDKError; export declare function internalError(message?: string, cause?: unknown): SDKError; /** * Detect unusable API responses before schema validation. * Returns a user-friendly message or null if response looks valid. */ export declare function detectSaavnApiError(data: unknown): string | null;