-
Notifications
You must be signed in to change notification settings - Fork 0
/
kafka-stream-readable.d.ts
34 lines (34 loc) · 1.06 KB
/
kafka-stream-readable.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { Readable } from 'stream';
import { CommitMode } from './js-binding';
import { KafkaConsumer, OffsetModel, TopicPartitionConfig } from './js-binding';
/**
* KafkaStreamReadable class
* @extends Readable
*/
export declare class KafkaStreamReadable extends Readable {
private readonly kafkaConsumer;
/**
* Creates a KafkaStreamReadable instance
*/
constructor(kafkaConsumer: KafkaConsumer);
/**
* Subscribes to topics
*/
subscribe(topics: string | Array<TopicPartitionConfig>): Promise<void>;
seek(topic: string, partition: number, offsetModel: OffsetModel, timeout?: number | undefined): void;
commit(topic: string, partition: number, offset: number, commit: CommitMode): void;
/**
* Unsubscribe from topics
*/
unsubscribe(): void;
/**
* Returns the raw Kafka consumer
* @returns {KafkaConsumer} The Kafka consumer instance
*/
rawConsumer(): KafkaConsumer;
/**
* Internal method called by the Readable stream to fetch data
* @private
*/
_read(): Promise<void>;
}