export class Layers {
    mask = 1;
    set(channel) {
        this.mask = 1 << validateChannel(channel);
    }
    enable(channel) {
        this.mask |= 1 << validateChannel(channel);
    }
    disable(channel) {
        this.mask &= ~(1 << validateChannel(channel));
    }
    test(other) {
        return (this.mask & other.mask) !== 0;
    }
}
function validateChannel(channel) {
    if (!Number.isInteger(channel) || channel < 0 || channel > 31)
        throw new Error("Layer channel must be an integer in [0, 31].");
    return channel;
}
//# sourceMappingURL=Layers.js.map