Skip to content

Commit

Permalink
add types for kafka Admin
Browse files Browse the repository at this point in the history
  • Loading branch information
tobydigz authored and allen-paystack committed Aug 11, 2020
1 parent fcc8aef commit 6f7a35e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -348,3 +362,14 @@ export interface MetadataResponse extends Array<BrokerMetadataResponse|ClusterMe
0: BrokerMetadataResponse;
1: ClusterMetadataResponse;
}

export enum RESOURCE_TYPES {
topic = 'topic',
broker = 'broker'
}

export interface Resource {
resourceType: RESOURCE_TYPES;
resourceName: string,
configNames: string[],
}

0 comments on commit 6f7a35e

Please sign in to comment.