"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FrontendFileReader = void 0;
require('fetch-polyfill');
var FrontendFileReader = (function () {
    function FrontendFileReader() {
    }
    FrontendFileReader.prototype.setRecordTransformer = function (recordTransformer) {
        this.recordTransformer = recordTransformer;
    };
    FrontendFileReader.prototype.checkFile = function (path) {
        fetch(path, { method: 'HEAD', credentials: 'same-origin', redirect: 'follow' })
            .then(function (response) {
            return Promise.resolve(response);
        });
    };
    FrontendFileReader.prototype.readText = function (filePath, onFileRead, options) {
        fetch(filePath)
            .then(function (response) { return response.text(); })
            .then(function (text) {
            onFileRead(null, text);
        })
            .catch(function (err) {
            onFileRead("".concat(filePath, " read error: ").concat(err));
        });
    };
    return FrontendFileReader;
}());
exports.FrontendFileReader = FrontendFileReader;
//# sourceMappingURL=frontend-file-reader.js.map