UNPKG

@message-queue-toolkit/kafka

Version:
9 lines (8 loc) 792 B
import type { SupportedMessageValues, SupportedMessageValuesForTopic, SupportedTopics, TopicConfig } from '../types.ts'; import type { KafkaHandlerConfig } from './KafkaHandlerConfig.ts'; export type KafkaHandlerRouting<TopicsConfig extends TopicConfig[], ExecutionContext> = Record<string, KafkaHandlerConfig<SupportedMessageValues<TopicsConfig>, ExecutionContext>[]>; export declare class KafkaHandlerRoutingBuilder<const TopicsConfig extends TopicConfig[], ExecutionContext> { private readonly configs; addConfig<Topic extends SupportedTopics<TopicsConfig>, MessageValue extends SupportedMessageValuesForTopic<TopicsConfig, Topic>>(topic: Topic, config: KafkaHandlerConfig<MessageValue, ExecutionContext>): this; build(): KafkaHandlerRouting<TopicsConfig, ExecutionContext>; }