import type { CommandResponse } from '../../client/client.type.js'; import { type Id } from '../identifier.utils.js'; import { type OptionEntry } from '../options.utils.js'; import { Durability, type Topic, type CompressionAlgorithm as CompressionAlgorithmT } from './topic.utils.js'; /** * Parameters for the create topic command. */ export type CreateTopic = { /** Stream identifier (ID or name) */ streamId: Id; /** Topic name (1-255 bytes) */ name: string; /** Number of partitions to create */ partitionCount: number; /** Compression algorithm (None or Gzip) */ compressionAlgorithm: CompressionAlgorithmT; /** * Message expiry time in microseconds. `0n` is not "unlimited": it omits the * key so the server resolves its own default, reported back as a derived * option on `getTopic`. */ messageExpiry?: bigint; /** * Maximum topic size in bytes. `0n` is not "unlimited": it omits the key so * the server resolves its own default, reported back as a derived option on * `getTopic`. */ maxTopicSize?: bigint; /** Segment size in bytes: 512-byte multiple between 1 MiB and 1 GiB */ segmentSize?: bigint; /** Message completion policy. Defaults to replicated, independently of offsets. */ durability?: Durability; consumerOffsetDurability?: Durability; /** Message count that triggers a save (must be non-zero) */ messagesRequiredToSave?: number; /** Accumulated message bytes that trigger a save */ sizeOfMessagesRequiredToSave?: bigint; /** Preallocate segment files when the topic is created */ preallocateSegments?: boolean; /** * Option keys with no field of their own, for a key the server catalog gained * after this build shipped. A field above wins on collision, since the block * must not carry a key twice. Call `describeOptions` for the keys a server * accepts. */ options?: OptionEntry[]; }; /** * Create topic command definition. * Creates a new topic within a stream. * Layout: `[stream_id][partitions_count:u32_le][name_len:u8][name]` * followed by the options TLV block running to the end of the payload. */ export declare const CREATE_TOPIC: { code: number; serialize: ({ streamId, name, partitionCount, compressionAlgorithm, messageExpiry, maxTopicSize, segmentSize, durability, consumerOffsetDurability, messagesRequiredToSave, sizeOfMessagesRequiredToSave, preallocateSegments, options: extraOptions }: CreateTopic) => Buffer; deserialize: (r: CommandResponse) => Topic; }; /** * Executable create topic command function. */ export declare const createTopic: (getClient: import("../../client/client.type.js").ClientProvider) => (arg: CreateTopic) => Promise; //# sourceMappingURL=create-topic.command.d.ts.map