From 6f7a35e4ac4ff1e79c83d0947d3e5e956c170ce3 Mon Sep 17 00:00:00 2001 From: Oloruntobi Allen Date: Wed, 12 Aug 2020 00:11:21 +0100 Subject: [PATCH] add types for kafka Admin --- types/index.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/types/index.d.ts b/types/index.d.ts index 24058b6d..ed22355c 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -145,6 +145,20 @@ export class ProducerStream extends Writable { _writev (chunks: Chunk[], cb: (error: any, data: any) => any): void; } +export class Admin extends EventEmitter { + constructor (kafkaClient: KafkaClient); + + listTopics (cb?: () => void): void; + + listGroups (cb?: () => void): void; + + describeGroups (consumerGroups: ConsumerGroup[], cb?: () => void): void; + + createTopics (topics: string[], cb?: () => void): void; + + describeConfigs(payload: { resources: Resource[], includeSynonyms?: boolean }, cb?: () => void): void; +} + // # Interfaces export interface Message { @@ -348,3 +362,14 @@ export interface MetadataResponse extends Array