"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    FILE_EXT_TO_READER: function() {
        return FILE_EXT_TO_READER;
    },
    SimpleDirectoryReader: function() {
        return SimpleDirectoryReader;
    }
});
const _CSVReader = require("./CSVReader.js");
const _DocxReader = require("./DocxReader.js");
const _HTMLReader = require("./HTMLReader.js");
const _ImageReader = require("./ImageReader.js");
const _MarkdownReader = require("./MarkdownReader.js");
const _PDFReader = require("./PDFReader.js");
const _SimpleDirectoryReaderedge = require("./SimpleDirectoryReader.edge.js");
const _TextFileReader = require("./TextFileReader.js");
const FILE_EXT_TO_READER = {
    txt: new _TextFileReader.TextFileReader(),
    pdf: new _PDFReader.PDFReader(),
    csv: new _CSVReader.PapaCSVReader(),
    md: new _MarkdownReader.MarkdownReader(),
    docx: new _DocxReader.DocxReader(),
    htm: new _HTMLReader.HTMLReader(),
    html: new _HTMLReader.HTMLReader(),
    jpg: new _ImageReader.ImageReader(),
    jpeg: new _ImageReader.ImageReader(),
    png: new _ImageReader.ImageReader(),
    gif: new _ImageReader.ImageReader()
};
class SimpleDirectoryReader extends _SimpleDirectoryReaderedge.SimpleDirectoryReader {
    async loadData(params) {
        if (typeof params === "string") {
            params = {
                directoryPath: params
            };
        }
        params.fileExtToReader = params.fileExtToReader ?? FILE_EXT_TO_READER;
        return super.loadData(params);
    }
}
