@message-queue-toolkit/kafka
Version:
Kafka adapter for message-queue-toolkit
11 lines (10 loc) • 977 B
TypeScript
import type { SupportedMessageValuesForTopic, SupportedTopics, TopicConfig } from '../types.ts';
import type { KafkaHandlerConfig } from './KafkaHandlerConfig.ts';
export type KafkaHandlerRouting<TopicsConfig extends TopicConfig[], ExecutionContext, BatchProcessingEnabled extends boolean> = Partial<{
[Topic in SupportedTopics<TopicsConfig>]: KafkaHandlerConfig<SupportedMessageValuesForTopic<TopicsConfig, Topic>, ExecutionContext, BatchProcessingEnabled>;
}>;
export declare class KafkaHandlerRoutingBuilder<const TopicsConfig extends TopicConfig[], ExecutionContext, BatchProcessingEnabled extends boolean> {
private readonly configs;
addConfig<Topic extends SupportedTopics<TopicsConfig>, MessageValue extends SupportedMessageValuesForTopic<TopicsConfig, Topic>>(topic: Topic, config: KafkaHandlerConfig<MessageValue, ExecutionContext, BatchProcessingEnabled>): this;
build(): KafkaHandlerRouting<TopicsConfig, ExecutionContext, BatchProcessingEnabled>;
}