"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var api_1 = require("../../src/api");
var memory_fs_1 = require("../../src/memory-fs");
var implementation_suite_1 = require("../../test/implementation-suite");
var promise_utils_1 = require("../../src/promise-utils");
var SlowFs = /** @class */ (function () {
    function SlowFs(delay) {
        this.delay = delay;
        this.fs = new memory_fs_1.MemoryFileSystem(undefined, [implementation_suite_1.ignoredDir, implementation_suite_1.ignoredFile]);
        this.events = this.fs.events;
    }
    SlowFs.prototype.saveFile = function (fullPath, newContent) {
        var _this = this;
        return promise_utils_1.delayedPromise(this.delay).then(function () { return _this.fs.saveFile(fullPath, newContent); });
    };
    SlowFs.prototype.deleteFile = function (fullPath) {
        var _this = this;
        return promise_utils_1.delayedPromise(this.delay).then(function () { return _this.fs.deleteFile(fullPath); });
    };
    SlowFs.prototype.deleteDirectory = function (fullPath, recursive) {
        var _this = this;
        if (recursive === void 0) { recursive = false; }
        return promise_utils_1.delayedPromise(this.delay).then(function () { return _this.fs.deleteDirectory(fullPath, recursive); });
    };
    SlowFs.prototype.ensureDirectory = function (fullPath) {
        var _this = this;
        return promise_utils_1.delayedPromise(this.delay).then(function () { return _this.fs.ensureDirectory(fullPath); });
    };
    SlowFs.prototype.loadTextFile = function (fullPath) {
        var _this = this;
        return promise_utils_1.delayedPromise(this.delay).then(function () { return _this.fs.loadTextFile(fullPath); });
    };
    SlowFs.prototype.loadDirectoryTree = function (fullPath) {
        var _this = this;
        return promise_utils_1.delayedPromise(this.delay).then(function () { return _this.fs.loadDirectoryTree(fullPath); });
    };
    SlowFs.prototype.loadDirectoryChildren = function (fullPath) {
        var _this = this;
        return promise_utils_1.delayedPromise(this.delay).then(function () { return _this.fs.loadDirectoryChildren(fullPath); });
    };
    SlowFs.prototype.dispose = function () {
        var _this = this;
        setTimeout(function () { return api_1.isDisposable(_this.fs) && _this.fs.dispose(); }, this.delay);
    };
    return SlowFs;
}());
exports.SlowFs = SlowFs;
//# sourceMappingURL=slow-fs.js.map