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