"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractAddPinToMergeEventData = extractAddPinToMergeEventData;
exports.stringifyAddPinToMergeEventData = stringifyAddPinToMergeEventData;
exports.watchGraphAddPinToMergeEvent = watchGraphAddPinToMergeEvent;
function extractAddPinToMergeEventData(...[mergeId, unitId, type, pinId, path]) {
    return {
        mergeId,
        unitId,
        type,
        pinId,
        path,
    };
}
function stringifyAddPinToMergeEventData(data) {
    return data;
}
function watchGraphAddPinToMergeEvent(event, graph, callback) {
    const listener = (...args) => {
        const data = stringifyAddPinToMergeEventData(extractAddPinToMergeEventData(...args));
        callback({
            type: 'graph',
            event,
            data,
        });
    };
    graph.prependListener(event, listener);
    return () => {
        graph.removeListener(event, listener);
    };
}
//# sourceMappingURL=watchGraphAddPinToMergeEvent.js.map