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