openRoom = (doc, provider, name, key) => {
  // there must only be one room
  if (rooms.has(name)) {
    throw error.create(`A Yjs Doc connected to room "${name}" already exists!`);
  }
  const room = new Room(doc, provider, name, key);
  rooms.set(name, /** @type {Room} */ (room));
  return room;
}
@param {Y.Doc} doc
@param {WebrtcProvider} provider
@param {string} name
@param {CryptoKey|null} key
@return {Room}