1 import {updateViewLanguage} from './views';
3 export class SimpleEditorInterface {
6 * @param {EditorView} editorView
8 constructor(editorView) {
13 * Get the contents of an editor instance.
17 return this.ev.state.doc.toString();
21 * Set the contents of an editor instance.
25 const {doc} = this.ev.state;
27 changes: {from: 0, to: doc.length, insert: content},
32 * Return focus to the editor instance.
39 * Set the language mode of the editor instance.
40 * @param {String} mode
41 * @param {String} content
43 setMode(mode, content = '') {
44 updateViewLanguage(this.ev, mode, content);