constructor (id, document, initialEditorState = {}) {
    super()

    this._id = id
    this._document = document
    this._history = this._createChangeHistory()

    this._tx = document.createEditingInterface()
    this._txOps = []

    const editorState = new EditorState(this._createEditorState(document, initialEditorState))
    this.editorState = editorState
  }
An EditorSession provides access to the state of an editor
for a single document, and provides means to manipulate the underlying document.

The EditorSession may be part of a complex application bound to a scope
containing only state variables for a single editor.