"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractMoveSubgraphIntoEventData = extractMoveSubgraphIntoEventData;
exports.stringifyMoveSubgraphIntoEventData = stringifyMoveSubgraphIntoEventData;
exports.watchGraphMoveSubgraphIntoEvent = watchGraphMoveSubgraphIntoEvent;
function extractMoveSubgraphIntoEventData(...[graphId, spec, selection, mapping, moves, path,]) {
    return {
        graphId,
        spec,
        selection,
        mapping,
        moves,
        path,
    };
}
function stringifyMoveSubgraphIntoEventData(data) {
    return data;
}
function watchGraphMoveSubgraphIntoEvent(event, graph, callback) {
    const listener = (...args) => {
        const data = stringifyMoveSubgraphIntoEventData(extractMoveSubgraphIntoEventData(...args));
        callback({
            type: 'graph',
            event,
            data,
        });
    };
    graph.prependListener(event, listener);
    return () => {
        graph.removeListener(event, listener);
    };
}
//# sourceMappingURL=watchGraphMoveSubgraphIntoEvent.js.map