import { generateKeyBetween } from 'fractional-indexing';
export const BLOCK_BATCH = 'a0';
export const FRAME_BATCH = generateKeyBetween(null, BLOCK_BATCH);
export class Batch {
    constructor(name) {
        this.name = name;
        this._elements = new Set();
        this._min = 'a0';
        this._max = 'a0';
    }
    get max() {
        return this._max;
    }
    set max(max) {
        this._max = max;
    }
    get min() {
        return this._min;
    }
    set min(min) {
        this._min = min;
    }
    addElement(element) {
        const index = element.index;
        if (index > this.max) {
            this.max = index;
        }
        else if (index < this.min) {
            this.min = index;
        }
        this._elements.add(element);
    }
    deleteElement(element) {
        this._elements.delete(element);
    }
}
//# sourceMappingURL=batch.js.map