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