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