/** * Vector Error * * Error class for vector database operations. */ import { VectorErrorType, VectorDBType } from '../types'; /** * Custom error class for vector database operations */ export declare class VectorError extends Error { /** Error type */ readonly type: VectorErrorType; /** Vector database type */ readonly dbType?: VectorDBType; /** Original error */ readonly originalError?: Error; /** Additional context */ readonly context?: Record; constructor(message: string, type?: VectorErrorType, options?: { dbType?: VectorDBType; originalError?: Error; context?: Record; }); /** * Create a connection error */ static connectionError(message: string, dbType?: VectorDBType, originalError?: Error): VectorError; /** * Create a configuration error */ static configurationError(message: string, context?: Record): VectorError; /** * Create an authentication error */ static authenticationError(message: string, dbType?: VectorDBType): VectorError; /** * Create a collection not found error */ static collectionNotFoundError(collectionName: string, dbType?: VectorDBType): VectorError; /** * Create a vector not found error */ static vectorNotFoundError(vectorId: string, dbType?: VectorDBType): VectorError; /** * Create a dimension mismatch error */ static dimensionMismatchError(expected: number, actual: number, dbType?: VectorDBType): VectorError; /** * Create an invalid operation error */ static invalidOperationError(message: string, dbType?: VectorDBType): VectorError; /** * Create a rate limit error */ static rateLimitError(message: string, dbType?: VectorDBType, retryAfter?: number): VectorError; /** * Create a timeout error */ static timeoutError(operation: string, timeoutMs: number, dbType?: VectorDBType): VectorError; /** * Wrap an unknown error */ static fromUnknown(error: unknown, dbType?: VectorDBType, context?: Record): VectorError; /** * Convert to JSON */ toJSON(): Record; } export default VectorError;