"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Editor_1 = require("./Editor");
var StickyNote = /** @class */ (function () {
    function StickyNote(id) {
        this._id = id;
    }
    Object.defineProperty(StickyNote.prototype, "id", {
        get: function () {
            return this._id;
        },
        enumerable: true,
        configurable: true
    });
    StickyNote.prototype.createEditor = function (ele, lang, code) {
        this._language = lang;
        this._editor = new Editor_1.Editor(ele, lang, code);
    };
    StickyNote.prototype.removeEditor = function () {
        if (this._editor) {
            this._editor.eliminate();
        }
        this._editor = null;
    };
    StickyNote.prototype.openEditor = function (ele) {
        this._editor = new Editor_1.Editor(ele, this._language, this._contents);
    };
    StickyNote.prototype.closeEditor = function () {
        var _a;
        this._contents = ((_a = this._editor) === null || _a === void 0 ? void 0 : _a.getValue()) || '';
        this.removeEditor();
    };
    StickyNote.prototype.saveCode = function () {
        var _a;
        // 나중에 세이브 기능
        var contents = ((_a = this._editor) === null || _a === void 0 ? void 0 : _a.getValue()) || '';
        this._contents = contents;
        return this._contents;
    };
    StickyNote.prototype.getCode = function () {
        return this._contents;
    };
    return StickyNote;
}());
exports.StickyNote = StickyNote;
