"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.watchGraphPlugEvent = void 0;
function watchGraphPlugEvent(event, graph, callback) {
    const listener = (type, pinId, subPinId, subPinSpec, path) => {
        callback({
            type: 'graph',
            event,
            data: {
                type,
                pinId,
                subPinId,
                subPinSpec,
                path,
            },
        });
    };
    graph.prependListener(event, listener);
    return () => {
        graph.removeListener(event, listener);
    };
}
exports.watchGraphPlugEvent = watchGraphPlugEvent;
//# sourceMappingURL=watchGraphPlugEvent.js.map