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