import { CommandType } from './command.types'; /** * TCP Request structure * Sent from client to server */ export interface TCPRequest { id: string; command: CommandType; params: { username?: string; password?: string; dbName?: string; collectionName?: string; crypto?: boolean; key?: string; data?: Record; documents?: Record[]; query?: Record; id?: string; ids?: string[]; updateData?: Record; updateOne?: boolean; deleteOne?: boolean; limit?: number; skip?: number; sort?: Record; findOne?: boolean; hint?: string; pipeline?: object[]; fieldNames?: string[]; indexName?: string; transactionId?: string; savepointName?: string; }; } /** * TCP Response structure * Sent from server to client */ export interface TCPResponse { id: string; statusCode: number; message: string; data?: unknown; error?: string; } /** * Connection state */ export declare enum ConnectionState { DISCONNECTED = "DISCONNECTED", CONNECTING = "CONNECTING", CONNECTED = "CONNECTED", RECONNECTING = "RECONNECTING", FAILED = "FAILED" } /** * Pending request tracking */ export interface PendingRequest { resolve: (value: unknown) => void; reject: (error: Error) => void; timeout: NodeJS.Timeout; timestamp: number; } /** * Connection options */ export interface ConnectionOptions { host: string; port: number; timeout?: number; reconnectAttempts?: number; reconnectDelay?: number; heartbeatInterval?: number; }