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