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