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