import { Writable } from 'stream'; import { type DebugLogger } from '../debug.ts'; import { type ManagedRealTimeIterator } from '../realtimeiterator.ts'; import { Exchange, Filter } from '../types.ts'; export type RealTimeFeed = { new (exchange: Exchange, filters: Filter[], timeoutIntervalMS: number | undefined, onError?: (error: Error) => void, validateSequence?: boolean): RealTimeFeedIterable; }; export type RealTimeFeedIterable = { [Symbol.asyncIterator](): ManagedRealTimeIterator; }; export type Sequence = { key: string; sequence: number; previousSequence: number | undefined; }; export declare class SequenceGapError extends Error { readonly exchange: string; readonly key: string; readonly expectedPreviousSequence: number; readonly previousSequence: number; readonly sequence: number; constructor(exchange: string, key: string, expectedPreviousSequence: number, previousSequence: number, sequence: number); } export declare abstract class RealTimeFeedBase implements RealTimeFeedIterable { protected readonly _exchange: string; private readonly _timeoutIntervalMS; private readonly _onError?; private readonly _validateSequence; [Symbol.asyncIterator](): ManagedRealTimeIterator; protected readonly debug: DebugLogger; protected abstract readonly wssURL: string; protected readonly throttleSubscribeMS: number; protected readonly manualSnapshotsBuffer: any[]; private readonly _filters; private readonly _parseJson; private _wsClientOptions; private _closed; private readonly _closeController; private _connection?; protected readonly originHeader: string | undefined; protected readonly extraHeaders: Record | undefined; protected readonly perMessageDeflate: boolean; constructor(_exchange: string, filters: Filter[], _timeoutIntervalMS: number | undefined, _onError?: ((error: Error) => void) | undefined, _validateSequence?: boolean); protected getWebSocketUrl(): Promise; private _close; private _stream; protected send(msg: any): void; protected sendRaw(msg: string | Buffer): void; protected abstract mapToSubscribeMessages(filters: Filter[]): any[]; protected abstract messageIsError(message: any): boolean; protected parseMessage(message: Buffer): any; protected sendCustomPing: (() => void) | undefined; protected isIgnoredError(_message: any): boolean; protected messageIsHeartbeat(_msg: any): boolean; protected provideManualSnapshots(_filters: Filter[], _shouldCancel: () => boolean): Promise; protected onMessage(_msg: any): void; protected getSequence(_message: any): Sequence | undefined; protected onConnected(): Promise; protected decompress?: (msg: any) => Buffer; private _monitorConnectionIfStale; private _sendPeriodicPing; private _onConnectionEstablished; private _onConnectionClosed; private _onConnectionOpen; private _send; private _isConnectionActive; private _isConnectionOpen; private _closeConnection; } export declare abstract class MultiConnectionRealTimeFeedBase implements RealTimeFeedIterable { private readonly _exchange; private readonly _filters; private readonly _timeoutIntervalMS; private readonly _onError?; private readonly _validateSequence; private readonly _closeController; private _connections?; constructor(_exchange: string, _filters: Filter[], _timeoutIntervalMS: number | undefined, _onError?: ((error: Error) => void) | undefined, _validateSequence?: boolean); [Symbol.asyncIterator](): ManagedRealTimeIterator; private _stream; protected abstract _getRealTimeFeeds(exchange: string, filters: Filter[], timeoutIntervalMS?: number, onError?: (error: Error) => void, validateSequence?: boolean): IterableIterator; } export declare abstract class PoolingClientBase implements RealTimeFeedIterable { private readonly _poolingIntervalSeconds; protected readonly onError?: ((error: Error) => void) | undefined; protected readonly debug: DebugLogger; private _tid; private _outputStream; constructor(exchange: string, _poolingIntervalSeconds: number, onError?: ((error: Error) => void) | undefined); [Symbol.asyncIterator](): ManagedRealTimeIterator; protected abstract poolDataToStream(outputStream: Writable): Promise; protected getPoolingDelayMS(): number; private _close; private _startPooling; private _stream; } //# sourceMappingURL=realtimefeed.d.ts.map