function unByKey(key) {
  if (Array.isArray(key)) {
    for (let i = 0, ii = key.length; i < ii; ++i) {
      unlistenByKey(key[i]);
    }
  } else {
    unlistenByKey(/** @type {import("./events.js").EventsKey} */ (key));
  }
}
Removes an event listener using the key returned by `on()` or `once()`.
@param {import("./events.js").EventsKey|Array<import("./events.js").EventsKey>} key The key returned by `on()`
    or `once()` (or an array of keys).
@api