"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Holder_1 = require("../../../../../Class/Holder");
const APINotImplementedError_1 = require("../../../../../exception/APINotImplementedError");
const FileReader_1 = require("../../../../../wrap/FileReader");
const _ids_1 = require("../../../../_ids");
class FileReader extends Holder_1.Holder {
    constructor(system) {
        super({
            fi: ['opt'],
            fo: ['reader'],
            i: [],
            o: [],
        }, {
            output: {
                reader: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_FILE_READER);
    }
    async f({ opt }, done) {
        const { api: { file: { FileReader }, }, } = this.__system;
        if (!FileReader) {
            done(undefined, (0, APINotImplementedError_1.apiNotSupportedError)('FileReader'));
            return;
        }
        const reader_ = new FileReader();
        const reader = (0, FileReader_1.wrapFileReader)(reader_, this.__system);
        done({ reader });
    }
}
exports.default = FileReader;
//# sourceMappingURL=index.js.map