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