"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Semifunctional_1 = require("../../../../../Class/Semifunctional");
const Async_1 = require("../../../../../types/interface/async/Async");
const _ids_1 = require("../../../../_ids");
class Write extends Semifunctional_1.Semifunctional {
    constructor(system) {
        super({
            fi: ['value', 'data'],
            fo: [],
            i: [],
            o: ['done'],
        }, {
            input: {
                value: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_WRITE);
    }
    async f({ value, data }, done, fail) {
        value = (0, Async_1.Async)(value, ['V'], this.__system.async);
        value.$write({ data }, (_, err) => {
            if (err) {
                fail(err);
                return;
            }
            done();
        });
    }
    b() {
        this._output.done.push(true);
    }
}
exports.default = Write;
//# sourceMappingURL=index.js.map