import { type Broker, type ConnectionOptions } from '../../network/connection.ts'; import { type NullableString } from '../../protocol/definitions.ts'; import { type Metrics } from '../metrics.ts'; export interface TopicWithPartitionAndOffset { topic: string; partition: number; offset: bigint; } export interface ClusterPartitionMetadata { leader: number; leaderEpoch: number; replicas: number[]; isr: number[]; offlineReplicas: number[]; } export interface ClusterTopicMetadata { id: string; partitions: ClusterPartitionMetadata[]; partitionsCount: number; lastUpdate: number; } export interface BrokerWithRack extends Broker { rack: NullableString; } export interface ClusterMetadata { id: string; brokers: Map; controllerId: number; topics: Map; lastUpdate: number; } export type RetryDelayGetter = (client: Owner, operationId: string, attempt: number, retries: number, error: Error) => number; export interface BaseOptions extends ConnectionOptions { clientId: string; bootstrapBrokers: Broker[] | string[]; context?: unknown; timeout?: number; retries?: number | boolean; retryDelay?: number | RetryDelayGetter; metadataMaxAge?: number; autocreateTopics?: boolean; strict?: boolean; metrics?: Metrics; } export interface MetadataOptions { topics?: string[]; autocreateTopics?: boolean; forceUpdate?: boolean; metadataMaxAge?: number; }