"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PeritextApi = void 0;
const nodes_1 = require("../../json-crdt/model/api/nodes");
const Peritext_1 = require("./Peritext");
const printTree_1 = require("tree-dump/lib/printTree");
class PeritextApi extends nodes_1.NodeApi {
    constructor(node, api) {
        super(node, api);
        this.node = node;
        this.api = api;
        this.txt = new Peritext_1.Peritext(api.model, node.text(), node.slices());
        this.editor = this.txt.editor;
    }
    text() {
        return this.api.wrap(this.node.text());
    }
    slices() {
        return this.api.wrap(this.node.slices());
    }
    toString(tab) {
        return ('PeritextApi' + (0, printTree_1.printTree)(tab, [(tab) => this.node.toString(tab), () => '', (tab) => this.txt.toString(tab)]));
    }
}
exports.PeritextApi = PeritextApi;
//# sourceMappingURL=PeritextApi.js.map