/** * AI Error Handler Middleware * Provides user-friendly error messages for AI API errors */ import { Request, Response, NextFunction } from "express"; import { ApiResponse } from "../types/index.js"; import { AIError } from "../services/aiService.js"; /** * AI-specific error handler middleware */ export declare function aiErrorHandler(err: any, _req: Request, res: Response>, next: NextFunction): void; /** * Rate limit handler for AI endpoints */ export declare function aiRateLimitHandler(_req: Request, res: Response>): void; /** * Create AI error with user-friendly message */ export declare function createAIError(message: string, userMessage: string, status?: number, details?: string[], action?: string): AIError; /** * Wrap async AI handlers with error handling */ export declare function wrapAIHandler(handler: (req: Request, res: Response, next: NextFunction) => Promise): (req: Request, res: Response, next: NextFunction) => Promise; declare const _default: { aiErrorHandler: typeof aiErrorHandler; aiRateLimitHandler: typeof aiRateLimitHandler; createAIError: typeof createAIError; wrapAIHandler: typeof wrapAIHandler; }; export default _default; //# sourceMappingURL=aiErrorHandler.d.ts.map