SetCodecConfig

type SetCodecConfig<TPrefix> = object;

Defines the configuration options for set codecs.

This configuration allows specifying how the size of the set is encoded. The size option can be:

  • A NumberCodec, NumberEncoder, or NumberDecoder to store the size as a prefix.
  • A fixed number of items, enforcing a strict length.
  • The string 'remainder' to infer the set size from the remaining bytes (only for fixed-size items).

Type Parameters

Type ParameterDescription
TPrefix extends | NumberCodec | NumberDecoder | NumberEncoderThe type used for encoding the size of the set.

Properties

size?

optional size: ArrayLikeCodecSize<TPrefix>;

The size encoding strategy for the set.

Default Value

Uses a u32 prefix.

On this page