"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.watchUnitIOSpec = void 0;
const GRAPH_DEFAULT_EVENTS_1 = require("../constant/GRAPH_DEFAULT_EVENTS");
const callAll_1 = require("../util/call/callAll");
const watchUnitSpecEvent_1 = require("./watchUnitSpecEvent");
function watchUnitIOSpec(unit, callback, events = GRAPH_DEFAULT_EVENTS_1.GRAPH_DEFAULT_EVENTS) {
    const all = [];
    if (events.includes('set_input')) {
        all.push((0, watchUnitSpecEvent_1.watchUnitSpecEvent)('set_input', unit, callback));
    }
    if (events.includes('set_output')) {
        all.push((0, watchUnitSpecEvent_1.watchUnitSpecEvent)('set_output', unit, callback));
    }
    if (events.includes('remove_input')) {
        all.push((0, watchUnitSpecEvent_1.watchUnitSpecEvent)('remove_input', unit, callback));
    }
    if (events.includes('remove_output')) {
        all.push((0, watchUnitSpecEvent_1.watchUnitSpecEvent)('remove_output', unit, callback));
    }
    const unlisten = (0, callAll_1.callAll)(all);
    return unlisten;
}
exports.watchUnitIOSpec = watchUnitIOSpec;
//# sourceMappingURL=watchUnitIOSpec.js.map