import type { ValueOf } from '../../type.utils.js'; import { type Id } from '../identifier.utils.js'; /** * Consumer kind options for offset operations. */ export declare const ConsumerKind: { /** Single consumer (not part of a group) */ readonly Single: 1; /** Consumer group member */ readonly Group: 2; }; /** Type alias for the ConsumerKind object */ export type ConsumerKind = typeof ConsumerKind; /** String literal type of consumer kind names */ export type ConsumerKindId = keyof ConsumerKind; /** Numeric values of consumer kinds */ export type ConsumerKindValue = ValueOf; /** * Consumer identifier for offset operations. */ export type Consumer = { /** Consumer kind (Single or Group) */ kind: ConsumerKindValue; /** Consumer or group identifier */ id: Id; }; /** * Default single consumer instance. */ export declare const ConsumerSingle: { kind: 1; id: number; }; /** Type for single consumer */ export type ConsumerSingle = typeof ConsumerSingle; /** * Consumer factory for creating consumer identifiers. */ export declare const Consumer: { /** Single consumer instance */ Single: { kind: 1; id: number; }; /** Creates a group consumer identifier */ Group: (groupId: Id) => { kind: 2; id: Id; }; }; /** * Response from offset operations. */ export type OffsetResponse = { /** Partition ID */ partitionId: number; /** Current offset in the partition */ currentOffset: bigint; /** Stored consumer offset */ storedOffset: bigint; }; /** * Serializes parameters for get/delete offset operations. * * @param streamId - Stream identifier (ID or name) * @param topicId - Topic identifier (ID or name) * @param consumer - Consumer identifier (single or group) * @param partitionId - Partition ID. VSR requires an explicit partition. * @returns Buffer containing serialized offset request * @throws Error if partitionId is null for single consumer kind */ export declare const serializeGetOffset: (streamId: Id, topicId: Id, consumer: Consumer, partitionId: number | null) => Buffer; /** * Serializes parameters for store offset operation. * * @param streamId - Stream identifier (ID or name) * @param topicId - Topic identifier (ID or name) * @param consumer - Consumer identifier (single or group) * @param partitionId - Partition ID. VSR requires an explicit partition. * @param offset - Offset value to store * @returns Buffer containing serialized store offset request */ export declare const serializeStoreOffset: (streamId: Id, topicId: Id, consumer: Consumer, partitionId: number | null, offset: bigint) => Buffer; /** * Serializes parameters for delete offset operation. * * @param streamId - Stream identifier (ID or name) * @param topicId - Topic identifier (ID or name) * @param consumer - Consumer identifier (single or group) * @param partitionId - Partition ID. VSR requires an explicit partition. * @returns Buffer containing serialized delete offset request */ export declare const serializeDeleteOffset: (streamId: Id, topicId: Id, consumer: Consumer, partitionId: number | null) => Buffer; //# sourceMappingURL=offset.utils.d.ts.map