export class TraversalOpticCursor {
    frontier;
    visitedNodeIds;
    constructor(options) {
        this.frontier = freezeFrontier(options.frontier);
        this.visitedNodeIds = Object.freeze([...options.visitedNodeIds].sort());
        Object.freeze(this);
    }
}
export default class TraversalOpticReadResult {
    startNodeId;
    strategy;
    direction;
    maxDepth;
    maxNodes;
    maxEdges;
    goalNodeId;
    edges;
    visitedNodeIds;
    frontier;
    completeness;
    cursor;
    readIdentities;
    constructor(options) {
        this.startNodeId = options.startNodeId;
        this.strategy = options.strategy;
        this.direction = options.direction;
        this.maxDepth = options.maxDepth;
        this.maxNodes = options.maxNodes;
        this.maxEdges = options.maxEdges;
        this.goalNodeId = options.goalNodeId;
        this.edges = freezeEdges(options.edges);
        this.visitedNodeIds = Object.freeze([...options.visitedNodeIds].sort());
        this.frontier = freezeFrontier(options.frontier);
        this.completeness = options.completeness;
        this.cursor = options.cursor;
        this.readIdentities = Object.freeze([...options.readIdentities]);
        Object.freeze(this);
    }
}
function freezeFrontier(frontier) {
    return Object.freeze(frontier.map((entry) => Object.freeze({
        nodeId: entry.nodeId,
        depth: entry.depth,
        edgeCursor: entry.edgeCursor,
    })));
}
function freezeEdges(edges) {
    return Object.freeze(edges.map((edge) => Object.freeze({
        fromNodeId: edge.fromNodeId,
        toNodeId: edge.toNodeId,
        label: edge.label,
        depth: edge.depth,
        expansionDirection: edge.expansionDirection,
    })));
}
