"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TempService = void 0;
const temp = require("temp");
const yok_1 = require("../common/yok");
class TempService {
    constructor($cleanupService) {
        this.$cleanupService = $cleanupService;
        temp.track();
    }
    async mkdirSync(affixes) {
        const pathToDir = temp.mkdirSync(affixes);
        await this.$cleanupService.addCleanupDeleteAction(pathToDir);
        return pathToDir;
    }
    async path(options) {
        const pathToFile = temp.path(options);
        await this.$cleanupService.addCleanupDeleteAction(pathToFile);
        return pathToFile;
    }
}
exports.TempService = TempService;
yok_1.injector.register("tempService", TempService);
