import { TernSecureAPIError, TernSecureApiErrorJSON } from '@tern-secure/types'; declare function isUnauthorizedError(e: any): boolean; declare function isCaptchaError(e: TernSecureAPIResponseError): boolean; declare function is4xxError(e: any): boolean; declare function isNetworkError(e: any): boolean; declare function parseErrors(data?: TernSecureApiErrorJSON[]): TernSecureAPIError[]; declare function parseError(error: TernSecureApiErrorJSON): TernSecureAPIError; declare function errorToJSON(error: TernSecureAPIError | null): TernSecureApiErrorJSON; interface TernSecureAPIResponseOptions { data: TernSecureApiErrorJSON[]; status: number; retryAfter?: number; } declare class TernSecureAPIResponseError extends Error { ternSecureError: true; status: number; message: string; retryAfter?: number; errors: TernSecureAPIError[]; constructor(message: string, { data, status, retryAfter }: TernSecureAPIResponseOptions); toString: () => string; } declare class TernSecureRuntimeError extends Error { ternSecureRuntimeError: true; /** * The error message. * * @type {string} */ message: string; /** * A unique code identifying the error, can be used for localization. * * @type {string} */ code: string; constructor(message: string, { code }: { code: string; }); /** * Returns a string representation of the error. * * @returns {string} A formatted string with the error name and message. */ toString: () => string; } export { TernSecureAPIResponseError, TernSecureRuntimeError, errorToJSON, is4xxError, isCaptchaError, isNetworkError, isUnauthorizedError, parseError, parseErrors };