destroy() {
    this.type.unobserve(this._typeObserver);
    this.cm.off('swapDoc', this._blurListeer); // @ts-ignore

    this.cm.off('changes', this._targetObserver);
    this.cm.off('beforeChange', this._beforeChange); // @ts-ignore

    this.cm.off('cursorActivity', this._cursorListener);
    this.cm.off('focus', this._cursorListener);
    this.cm.off('blur', this._blurListeer);

    if (this.awareness) {
      this.awareness.off('change', this._awarenessListener);
    }

    if (this.yUndoManager) {
      this.yUndoManager.off('stack-item-added', this._onStackItemAdded);
      this.yUndoManager.off('stack-item-popped', this._onStackItemPopped);
      this.yUndoManager.trackedOrigins.delete(this);
    }

    this.type = null;
    this.cm = null;
    this.cmDoc = null;
    super.destroy();
  }
@type {{ anchor: Y.RelativePosition, head: Y.RelativePosition } | null}