import WarpError from "../errors/WarpError.js";
import { IndexShard } from "./IndexShard.js";
/** Forward or reverse edge bitmaps for a shard. */
export class EdgeShard extends IndexShard {
    direction;
    buckets;
    constructor({ shardKey, schemaVersion = 1, direction, buckets }) {
        super({ shardKey, schemaVersion });
        if (direction !== 'fwd' && direction !== 'rev') {
            throw new WarpError(`EdgeShard direction must be 'fwd' or 'rev', got ${JSON.stringify(direction)}`, // nosemgrep: ts-no-json-stringify-in-core -- 0025B
            'E_INVALID_SHARD');
        }
        this.direction = direction;
        this.buckets = buckets;
        Object.freeze(this);
    }
}
