Delta-Pack - v0.2.9
    Preparing search index...

    Function IntType

    • Create a signed integer type with optional min/max bounds.

      When bounds are specified, values are encoded more efficiently using only the bits needed for the range. Without bounds, values use variable-length encoding (varint) which is compact for small values.

      Parameters

      • Optionaloptions: { min?: string | number; max?: string | number }

        Optional bounds for the integer

        • Optionalmin?: string | number

          Minimum allowed value (inclusive)

        • Optionalmax?: string | number

          Maximum allowed value (inclusive)

      Returns UnifiedType<IntType>

      const GameState = ObjectType("GameState", {
      score: IntType(), // Unbounded, varint encoding
      level: IntType({ min: 1, max: 100 }), // Bounded, uses 7 bits
      temperature: IntType({ min: -50, max: 50 }),
      });