import type { ContextMetadata, EvaluationResult } from '../types/context-types';
import type { ValidationResult, EvaluationType } from '../types/base-types';
import type { LLMDocumentation } from '../types/command-types';
export declare const SocketsInputSchema: import("../validation/lightweight-validators").RuntimeValidator<unknown>;
export declare const SocketsOutputSchema: import("../validation/lightweight-validators").RuntimeValidator<unknown>;
export type SocketsInput = any;
export type SocketsOutput = any;
export interface SocketConnection {
    id: string;
    url: string;
    protocols: string[];
    websocket: WebSocket | null;
    state: 'connecting' | 'connected' | 'disconnecting' | 'disconnected' | 'error';
    reconnectAttempts: number;
    lastError?: Error;
    connectedAt?: number;
    disconnectedAt?: number;
    totalReconnects: number;
    messagesSent: number;
    messagesReceived: number;
}
export interface SocketEventHandler {
    id: string;
    event: 'open' | 'close' | 'error' | 'message';
    filter?: string;
    commands: any[];
    options: {
        once?: boolean;
        debounce?: number;
        throttle?: number;
    };
    isActive: boolean;
    executionCount: number;
    lastExecutionTime: number;
}
export interface QueuedMessage {
    id: string;
    data: any;
    format: 'json' | 'text' | 'binary';
    timestamp: number;
    attempts: number;
    maxAttempts: number;
    lastAttempt?: number;
    error?: Error;
}
export interface SocketMessage {
    id: string;
    connectionId: string;
    type: 'incoming' | 'outgoing';
    data: any;
    format: 'json' | 'text' | 'binary';
    timestamp: number;
    size: number;
    validated: boolean;
    validationError?: string;
}
export interface SocketMetrics {
    connectionId: string;
    connectedAt?: number;
    totalReconnects: number;
    messagesSent: number;
    messagesReceived: number;
    bytesTransmitted: number;
    bytesReceived: number;
    averageLatency: number;
    errorCount: number;
    uptime: number;
}
export declare class TypedSocketsFeatureImplementation {
    readonly name = "socketsFeature";
    readonly category: "Frontend";
    readonly description = "Type-safe WebSocket management feature with reconnection, message queuing, and comprehensive error handling";
    readonly inputSchema: import("../validation/lightweight-validators").RuntimeValidator<unknown>;
    readonly outputType: EvaluationType;
    private evaluationHistory;
    private connections;
    private eventHandlers;
    private messageQueue;
    private messageHistory;
    private errorHistory;
    private throttleTimers;
    private debounceTimers;
    readonly metadata: ContextMetadata;
    readonly documentation: LLMDocumentation;
    initialize(input: SocketsInput): Promise<EvaluationResult<SocketsOutput>>;
    validate(input: unknown): ValidationResult;
    private initializeConfig;
    private createSocketConnection;
    private registerEventHandler;
    private connectWebSocket;
    private handleWebSocketOpen;
    private handleWebSocketClose;
    private handleWebSocketError;
    private handleWebSocketMessage;
    private executeEventHandlers;
    private executeHandlerCommands;
    private executeBasicCommand;
    private detectMessageFormat;
    private calculateMessageSize;
    private testMessageFilter;
    private isThrottled;
    private applyDebounce;
    private processQueuedMessages;
    private sendMessage;
    private queueMessage;
    private createConnectionEstablisher;
    private createConnectionTerminator;
    private createReconnector;
    private createConnectionChecker;
    private createStateGetter;
    private createConnectionInfoGetter;
    private createMessageSender;
    private createJSONSender;
    private createBinarySender;
    private createMessageSubscriber;
    private createMessageUnsubscriber;
    private createMessageHistoryGetter;
    private createEventHandlerAdder;
    private createEventHandlerRemover;
    private createEventEmitter;
    private createHandlerGetter;
    private createQueueAdder;
    private createQueueProcessor;
    private createQueueClearer;
    private createQueueSizeGetter;
    private createPendingGetter;
    private createErrorHandler;
    private createErrorHistoryGetter;
    private createErrorClearer;
    private createErrorHandlerSetter;
    private trackPerformance;
    getPerformanceMetrics(): {
        totalInitializations: number;
        successRate: number;
        averageDuration: number;
        lastEvaluationTime: number;
        evaluationHistory: {
            input: SocketsInput;
            output?: SocketsOutput;
            success: boolean;
            duration: number;
            timestamp: number;
        }[];
        totalConnections: number;
        totalHandlers: number;
        totalMessages: number;
        totalErrors: number;
        queuedMessages: number;
    };
}
export declare function createSocketsFeature(): TypedSocketsFeatureImplementation;
export declare function createSockets(socket: Partial<SocketsInput['socket']>, options?: Partial<SocketsInput>): Promise<EvaluationResult<SocketsOutput>>;
export declare const enhancedSocketsImplementation: TypedSocketsFeatureImplementation;
//# sourceMappingURL=sockets.d.ts.map