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