Documentation
    Preparing search index...

    Class BitField<S, N>Abstract

    Data structure that makes it easy to interact with a bitfield.

    Type Parameters

    • S extends string
    • N extends bigint | number

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    bitField: N

    Bitfield of the packed bits

    constructor: BitFieldConstructor<S, N>
    DefaultBit: number | bigint
    Flags: EnumLike<unknown, bigint | number>

    Numeric bitfield flags. Defined in extension classes

    Methods

    • Returns Generator<S, void, unknown>

    • Adds bits to these ones.

      Parameters

      Returns this

      These bits or new BitField if the instance is frozen.

    • Checks whether the bitfield has a bit, or any of multiple bits.

      Parameters

      Returns boolean

    • Checks if this bitfield equals another

      Parameters

      Returns boolean

    • Freezes these bits, making them immutable.

      Returns Readonly<this>

    • Checks whether the bitfield has a bit, or multiple bits.

      Parameters

      Returns boolean

    • Gets all given bits that are missing from the bitfield.

      Parameters

      Returns S[]

    • Removes bits from these.

      Parameters

      Returns this

      These bits or new BitField if the instance is frozen.

    • Gets an object mapping field names to a boolean indicating whether the bit is available.

      Returns Record<S, boolean>

    • Replace the bits with these.

      Parameters

      Returns this

      These bits or new BitField if the instance is frozen.

    • Gets an Array of bitfield names based on the bits available.

      Returns S[]

    • Returns N extends number ? N<N> : `${N}`

    • Returns `${N}`

    • Returns N

    • Resolves bitfields to their numeric form.

      Type Parameters

      • S extends string
      • N extends number | bigint

      Parameters

      Returns N