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