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 EventSourceInputSchema: import("../validation/lightweight-validators").RuntimeValidator<{
    [x: string]: unknown;
}>;
export declare const EventSourceOutputSchema: import("../validation/lightweight-validators").RuntimeValidator<{
    [x: string]: unknown;
}>;
export type EventSourceInput = any;
export type EventSourceOutput = any;
export interface EventSourceConnection {
    id: string;
    url: string;
    eventSource: EventSource | null;
    state: 'connecting' | 'connected' | 'disconnecting' | 'disconnected' | 'error';
    createdAt: number;
    connectedAt?: number;
    disconnectedAt?: number;
    lastMessageTime: number;
    messageCount: number;
    errorCount: number;
    retryAttempts: number;
    maxRetryAttempts: number;
}
export interface SSEMessage {
    id: string;
    connectionId: string;
    event: string;
    data: any;
    timestamp: number;
    format: 'text' | 'json' | 'raw';
    lastEventId?: string;
    retry?: number;
    origin?: string;
}
export interface SSEEventHandler {
    id: string;
    connectionId: string;
    eventType: string;
    commands: any[];
    filter?: string;
    options?: {
        throttle?: number;
        debounce?: number;
    };
    isActive: boolean;
    executionCount: number;
    lastExecutionTime: number;
}
export interface MessageBuffer {
    connectionId: string;
    messages: SSEMessage[];
    maxSize: number;
    flushInterval: number;
    lastFlushTime: number;
    autoFlushTimer?: number;
}
export declare class TypedEventSourceFeatureImplementation {
    readonly name = "eventsourceFeature";
    readonly category: "Frontend";
    readonly description = "Type-safe Server-Sent Events management feature with connection handling, message processing, and comprehensive error recovery";
    readonly inputSchema: import("../validation/lightweight-validators").RuntimeValidator<{
        [x: string]: unknown;
    }>;
    readonly outputType: EvaluationType;
    private evaluationHistory;
    private connections;
    private messageHistory;
    private eventHandlers;
    private messageBuffers;
    private errorHistory;
    private throttleTimers;
    private debounceTimers;
    private filterCache;
    readonly metadata: ContextMetadata;
    readonly documentation: LLMDocumentation;
    initialize(input: EventSourceInput): Promise<EvaluationResult<EventSourceOutput>>;
    validate(input: unknown): ValidationResult;
    private initializeConfig;
    private createConnection;
    private handleConnectionOpen;
    private handleMessage;
    private handleConnectionError;
    private scheduleReconnection;
    private attemptReconnection;
    private processEventHandlers;
    private executeEventHandler;
    private executeCommands;
    private executeBasicCommand;
    private isValidEventSourceURL;
    private detectMessageFormat;
    private testEventFilter;
    private isThrottled;
    private applyDebounce;
    private createConnectionEstablisher;
    private createConnectionDisconnector;
    private createConnectionReconnector;
    private createStateGetter;
    private createConnectionInfoGetter;
    private createConnectionChecker;
    private createEventHandlerAdder;
    private createEventHandlerRemover;
    private createEventHandlerGetter;
    private createEventEmitter;
    private createMessageHistoryGetter;
    private createBufferGetter;
    private createBufferFlusher;
    private createHistoryClearer;
    private createMessageSubscriber;
    private createMessageUnsubscriber;
    private createErrorHandler;
    private createErrorHistoryGetter;
    private createErrorClearer;
    private createErrorHandlerSetter;
    dispose(): void;
    private trackPerformance;
    getPerformanceMetrics(): {
        totalInitializations: number;
        successRate: number;
        averageDuration: number;
        lastEvaluationTime: number;
        evaluationHistory: {
            input: EventSourceInput;
            output?: EventSourceOutput;
            success: boolean;
            duration: number;
            timestamp: number;
        }[];
        totalConnections: number;
        totalMessages: number;
        totalErrors: number;
        totalEventHandlers: number;
        bufferedMessages: number;
    };
}
export declare function createEventSourceFeature(): TypedEventSourceFeatureImplementation;
export declare function createEventSource(source: Partial<EventSourceInput['source']>, options?: Partial<EventSourceInput>): Promise<EvaluationResult<EventSourceOutput>>;
export declare const enhancedEventSourceImplementation: TypedEventSourceFeatureImplementation;
//# sourceMappingURL=eventsource.d.ts.map