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