"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractSetUnitIdEventData = extractSetUnitIdEventData;
exports.stringifySetUnitIdEventData = stringifySetUnitIdEventData;
exports.watchGraphSetUnitIdEvent = watchGraphSetUnitIdEvent;
function extractSetUnitIdEventData(...[unitId, newUnitId, name, specId, path]) {
    return {
        unitId,
        newUnitId,
        name,
        specId,
        path,
    };
}
function stringifySetUnitIdEventData(data) {
    return data;
}
function watchGraphSetUnitIdEvent(event, graph, callback) {
    const listener = (...args) => {
        const data = stringifySetUnitIdEventData(extractSetUnitIdEventData(...args));
        callback({
            type: 'graph',
            event,
            data,
        });
    };
    graph.prependListener(event, listener);
    return () => {
        graph.removeListener(event, listener);
    };
}
//# sourceMappingURL=watchGraphSetUnitIdEvent.js.map