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