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