import { Readable } from 'node:stream'; import { type CallbackWithPromise } from '../../apis/callbacks.ts'; import type { ConnectionPool } from '../../network/connection-pool.ts'; import { type Message } from '../../protocol/records.ts'; import { kAutocommit, kInstance, kRefreshOffsetsAndFetch } from '../../symbols.ts'; import { kConnections, kInspect } from '../base/base.ts'; import type { Consumer } from './consumer.ts'; import { type CommitOptionsPartition, type ConsumeOptions } from './types.ts'; export declare function noopDeserializer(data?: Buffer): Buffer | undefined; export declare function defaultCorruptedMessageHandler(): boolean; export declare class MessagesStream extends Readable { #private; [kInstance]: number; [kConnections]: ConnectionPool; constructor(consumer: Consumer, options: ConsumeOptions); get consumer(): Consumer; get offsetsToFetch(): Map; get context(): unknown; get offsetsToCommit(): Map; get offsetsCommitted(): Map; get committedOffsets(): Map; close(callback: CallbackWithPromise): void; close(): Promise; isActive(): boolean; isConnected(): boolean; resume(): this; pause(): this; addListener(event: 'autocommit', listener: (err: Error, offsets: CommitOptionsPartition[]) => void): this; addListener(event: 'fetch', listener: () => void): this; addListener(event: 'offsets', listener: () => void): this; addListener(event: 'data', listener: (message: Message) => void): this; addListener(event: 'close', listener: () => void): this; addListener(event: 'end', listener: () => void): this; addListener(event: 'error', listener: (err: Error) => void): this; addListener(event: 'pause', listener: () => void): this; addListener(event: 'readable', listener: () => void): this; addListener(event: 'resume', listener: () => void): this; on(event: 'autocommit', listener: (err: Error, offsets: CommitOptionsPartition[]) => void): this; on(event: 'fetch', listener: () => void): this; on(event: 'offsets', listener: () => void): this; on(event: 'data', listener: (message: Message) => void): this; on(event: 'close', listener: () => void): this; on(event: 'end', listener: () => void): this; on(event: 'error', listener: (err: Error) => void): this; on(event: 'pause', listener: () => void): this; on(event: 'readable', listener: () => void): this; on(event: 'resume', listener: () => void): this; once(event: 'autocommit', listener: (err: Error, offsets: CommitOptionsPartition[]) => void): this; once(event: 'fetch', listener: () => void): this; once(event: 'offsets', listener: () => void): this; once(event: 'data', listener: (message: Message) => void): this; once(event: 'close', listener: () => void): this; once(event: 'end', listener: () => void): this; once(event: 'error', listener: (err: Error) => void): this; once(event: 'pause', listener: () => void): this; once(event: 'readable', listener: () => void): this; once(event: 'resume', listener: () => void): this; prependListener(event: 'autocommit', listener: (err: Error, offsets: CommitOptionsPartition[]) => void): this; prependListener(event: 'fetch', listener: () => void): this; prependListener(event: 'offsets', listener: () => void): this; prependListener(event: 'data', listener: (message: Message) => void): this; prependListener(event: 'close', listener: () => void): this; prependListener(event: 'end', listener: () => void): this; prependListener(event: 'error', listener: (err: Error) => void): this; prependListener(event: 'pause', listener: () => void): this; prependListener(event: 'readable', listener: () => void): this; prependListener(event: 'resume', listener: () => void): this; prependOnceListener(event: 'autocommit', listener: (err: Error, offsets: CommitOptionsPartition[]) => void): this; prependOnceListener(event: 'fetch', listener: () => void): this; prependOnceListener(event: 'offsets', listener: () => void): this; prependOnceListener(event: 'data', listener: (message: Message) => void): this; prependOnceListener(event: 'close', listener: () => void): this; prependOnceListener(event: 'end', listener: () => void): this; prependOnceListener(event: 'error', listener: (err: Error) => void): this; prependOnceListener(event: 'pause', listener: () => void): this; prependOnceListener(event: 'readable', listener: () => void): this; prependOnceListener(event: 'resume', listener: () => void): this; [Symbol.asyncIterator](): NodeJS.AsyncIterator>; _construct(callback: (error?: Error) => void): void; _destroy(error: Error | null, callback: (error?: Error | null) => void): void; _read(): void; [kAutocommit](): void; [kRefreshOffsetsAndFetch](): void; [kInspect](...args: unknown[]): void; }