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