"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractMoveSubComponentRootEventData = extractMoveSubComponentRootEventData;
exports.stringifyMoveSubComponentRootEventData = stringifyMoveSubComponentRootEventData;
exports.watchGraphMoveSubComponentRoot = watchGraphMoveSubComponentRoot;
function extractMoveSubComponentRootEventData(...[{ parentId, prevParentIdMap, children, index, slotMap, prevSlotMap }, path,]) {
    return {
        parentId,
        prevParentIdMap,
        children,
        index,
        slotMap,
        prevSlotMap,
        path,
    };
}
function stringifyMoveSubComponentRootEventData(data) {
    return data;
}
function watchGraphMoveSubComponentRoot(event, graph, callback) {
    const listener = (...args) => {
        const data = stringifyMoveSubComponentRootEventData(extractMoveSubComponentRootEventData(...args));
        callback({
            type: 'graph',
            event,
            data,
        });
    };
    graph.prependListener(event, listener);
    return () => {
        graph.removeListener(event, listener);
    };
}
//# sourceMappingURL=watchGraphMoveSubComponentRoot.js.map