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