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