set(key, value) {
    if (this.doc !== null) {
      transact(this.doc, transaction => {
        typeMapSet(transaction, this, key, value);
      });
    } else {
      /** @type {Map<string, any>} */
      this._prelimContent.set(key, value);
    }

    return value;
  }
Adds or updates an element with a specified key and value.

@param {string} key The key of the element to add to this YMap
@param {MapType} value The value of the element to add