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