"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Semifunctional_1 = require("../../../../../Class/Semifunctional");
const _ids_1 = require("../../../../_ids");
const globalComponent_1 = require("../../../../globalComponent");
class SetSelectionRange extends Semifunctional_1.Semifunctional {
    constructor(system) {
        super({
            fi: ['component', 'opt'],
            fo: [],
            i: [],
            o: ['done'],
        }, {
            input: {
                component: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_SET_SELECTION_RANGE);
    }
    async f({ component, opt }, done) {
        const globalId = component.getGlobalId();
        const component_ = (await (0, globalComponent_1.firstGlobalComponentPromise)(this.__system, globalId));
        const leaf = component_.getFirstRootLeaf();
        leaf.setSelectionRange(opt.start, opt.end, opt.direction);
        done({});
    }
    b() {
        this._output.done.push(true);
    }
}
exports.default = SetSelectionRange;
//# sourceMappingURL=index.js.map