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