import { AstroChartHandle } from './AstroChart'; import { TimeSeriesPoint, DataPoint } from './types'; export interface StreamOptions { /** Maximum data points to keep */ maxPoints?: number; /** Time window in milliseconds (alternative to maxPoints) */ timeWindow?: number; /** Throttle interval in milliseconds */ throttleMs?: number; /** Buffer size before flushing */ bufferSize?: number; /** Enable data decimation for large datasets */ decimate?: boolean; /** Decimation threshold (start decimating above this count) */ decimateThreshold?: number; } export interface StreamController { /** Push a single data point */ push: (seriesIndex: number, point: TimeSeriesPoint | DataPoint) => void; /** Push multiple data points */ pushBatch: (seriesIndex: number, points: (TimeSeriesPoint | DataPoint)[]) => void; /** Clear all data */ clear: () => void; /** Pause streaming */ pause: () => void; /** Resume streaming */ resume: () => void; /** Get current state */ isPaused: boolean; /** Get current point count */ pointCount: number; } export declare function useChartStream(chartRef: React.RefObject, options?: StreamOptions): StreamController; export interface WebSocketStreamOptions extends StreamOptions { /** WebSocket URL */ url: string; /** Reconnect on disconnect */ reconnect?: boolean; /** Reconnect delay in milliseconds */ reconnectDelay?: number; /** Maximum reconnect attempts */ maxReconnects?: number; /** Message parser */ parseMessage?: (data: unknown) => { seriesIndex: number; point: TimeSeriesPoint | DataPoint; } | null; } export interface WebSocketStreamController extends StreamController { /** WebSocket connection state */ connectionState: "connecting" | "connected" | "disconnected" | "error"; /** Manually connect */ connect: () => void; /** Manually disconnect */ disconnect: () => void; } export declare function useWebSocketStream(chartRef: React.RefObject, options: WebSocketStreamOptions): WebSocketStreamController;