get changes() {
    let changes = this._changes;

    if (changes === null) {
      const target = this.target;
      const added = set.create();
      const deleted = set.create();
      /**
       * @type {Array<{insert:Array<any>}|{delete:number}|{retain:number}>}
       */

      const delta = [];
      changes = {
        added,
        deleted,
        delta,
        keys: this.keys
      };
      const changed =
      /** @type Set<string|null> */
      this.transaction.changed.get(target);

      if (changed.has(null)) {
        /**
         * @type {any}
         */
        let lastOp = null;

        const packOp = () => {
          if (lastOp) {
            delta.push(lastOp);
          }
        };

        for (let item = target._start; item !== null; item = item.right) {
          if (item.deleted) {
            if (this.deletes(item) && !this.adds(item)) {
              if (lastOp === null || lastOp.delete === undefined) {
                packOp();
                lastOp = {
                  delete: 0
                };
              }

              lastOp.delete += item.length;
              deleted.add(item);
            } // else nop

          } else {
            if (this.adds(item)) {
              if (lastOp === null || lastOp.insert === undefined) {
                packOp();
                lastOp = {
                  insert: []
                };
              }

              lastOp.insert = lastOp.insert.concat(item.content.getContent());
              added.add(item);
            } else {
              if (lastOp === null || lastOp.retain === undefined) {
                packOp();
                lastOp = {
                  retain: 0
                };
              }

              lastOp.retain += item.length;
            }
          }
        }

        if (lastOp !== null && lastOp.retain === undefined) {
          packOp();
        }
      }

      this._changes = changes;
    }

    return (
      /** @type {any} */
      changes
    );
  }
@type {{added:Set<Item>,deleted:Set<Item>,keys:Map<string,{action:'add'|'update'|'delete',oldValue:any}>,delta:Array<{insert?:Array<any>|string, delete?:number, retain?:number}>}}