The type of flag keys, extending FlagKey (string literals for type safety).
The registry defining the valid flags and their bit positions.
The raw BigInt bitmask representing the combined flags (e.g., 3n for bits 0 and 1 set).
ReadonlyvalueThe raw BigInt bitmask representing the combined flags (e.g., 3n for bits 0 and 1 set).
Adds one or more flag keys to this flag combination, creating a new instance with the updated bitmask.
One or more flag keys to add.
A new Flag instance with the added flags, or the current instance if unchanged.
Tests whether a specific flag key is set in this flag combination.
Performs a bitwise AND between the instance's value and the bitmask of the given flag key.
Returns false if the key is not found in the registry.
The flag key to check (must be a valid key in the registry).
true if the flag is set, false otherwise.
Removes one or more flag keys from this flag combination, creating a new instance with the updated bitmask.
One or more flag keys to remove.
A new Flag instance with the removed flags, or the current instance if unchanged.
Returns a human-readable string representation of this flag instance.
The format is Flag(${alias}: ${value}), where alias is the computed alias (e.g., [READ+WRITE])
and value is the raw BigInt bitmask.
A string like Flag([READ+WRITE]: 3).
Represents a bitwise combination of flags from a registry. This class encapsulates a bitmask value derived from one or more flag keys, enabling efficient storage and manipulation of boolean states (e.g., permissions, features, or configurations) using bitwise operations.
Example