UNPKG

semanticpen

Version:

AI Article Writer & SEO Blog Generator SDK - Professional TypeScript/JavaScript library for automated content creation, AI-powered article generation, and SEO blog writing with SemanticPen

56 lines 2.38 kB
import { ErrorType } from '../types'; export declare abstract class SemanticPenError extends Error { readonly type: ErrorType; readonly timestamp: Date; readonly details?: Record<string, any>; constructor(message: string, type: ErrorType, details?: Record<string, any>); toJSON(): Record<string, any>; abstract format(): string; } export declare class AuthenticationError extends SemanticPenError { constructor(message?: string, details?: Record<string, any>); format(): string; } export declare class ValidationError extends SemanticPenError { readonly field?: string; readonly value?: any; constructor(message: string, field?: string, value?: any, details?: Record<string, any>); format(): string; } export declare class RateLimitError extends SemanticPenError { readonly retryAfter?: number; readonly dailyLimit?: number; readonly currentUsage?: number; constructor(message?: string, retryAfter?: number, details?: Record<string, any>); format(): string; } export declare class NetworkError extends SemanticPenError { readonly statusCode?: number; readonly endpoint?: string; constructor(message: string, statusCode?: number, endpoint?: string, details?: Record<string, any>); format(): string; } export declare class ApiError extends SemanticPenError { readonly statusCode: number; readonly endpoint: string; readonly response?: any; constructor(message: string, statusCode: number, endpoint: string, response?: any, details?: Record<string, any>); format(): string; static fromResponse(response: Response, endpoint: string, responseData?: any): ApiError; } export declare class TimeoutError extends SemanticPenError { readonly timeoutMs: number; readonly operation?: string; constructor(message: string, timeoutMs: number, operation?: string, details?: Record<string, any>); format(): string; } export declare class UnknownError extends SemanticPenError { readonly originalError?: Error; constructor(message?: string, originalError?: Error, details?: Record<string, any>); format(): string; } export declare class ErrorFactory { static fromHttpResponse(response: Response, endpoint: string, responseData?: any): SemanticPenError; static fromError(error: any, context?: string): SemanticPenError; } //# sourceMappingURL=index.d.ts.map