"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DesignThemeFileSystemProvider = void 0;
const tslib_1 = require("tslib");
const di_1 = require("@opensumi/di");
const ide_core_common_1 = require("@opensumi/ide-core-common");
const default_theme_1 = tslib_1.__importDefault(require("./default-theme"));
const light_theme_1 = tslib_1.__importDefault(require("./light-theme"));
let DesignThemeFileSystemProvider = class DesignThemeFileSystemProvider {
    constructor() {
        this.capabilities = 2048 /* FileSystemProviderCapabilities.Readonly */;
        this.onDidChangeCapabilities = ide_core_common_1.Event.None;
        this.onDidChangeFile = ide_core_common_1.Event.None;
    }
    stat(uri) {
        return Promise.resolve({
            type: ide_core_common_1.FileType.File,
            uri: uri.toString(),
            lastModification: Date.now(),
            isDirectory: false,
        });
    }
    async readFile(uri) {
        const { query } = uri;
        if (default_theme_1.default.id === query) {
            return this.toBuffer(JSON.stringify(default_theme_1.default));
        }
        return this.toBuffer(JSON.stringify(light_theme_1.default));
    }
    toBuffer(s) {
        return ide_core_common_1.BinaryBuffer.fromString(s).buffer;
    }
    readDirectory() {
        throw new Error('Not allowed');
    }
    createDirectory() {
        throw new Error('Not allowed');
    }
    rename() {
        throw new Error('Not allowed');
    }
    delete() {
        throw new Error('Not allowed');
    }
    watch() {
        throw new Error('Not allowed');
    }
    writeFile() {
        throw new Error('Not allowed');
    }
};
DesignThemeFileSystemProvider = tslib_1.__decorate([
    (0, di_1.Injectable)()
], DesignThemeFileSystemProvider);
exports.DesignThemeFileSystemProvider = DesignThemeFileSystemProvider;
//# sourceMappingURL=file-system.provider.js.map