From ff57de47c8a81d4c75f7a0a46e689c51579531eb Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@mailbox.org>
Date: Fri, 20 May 2022 21:52:43 +0200
Subject: [PATCH] Fix typing for SpacedTextAccumulator.js

---
 src/js/SpacedTextAccumulator.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/js/SpacedTextAccumulator.js b/src/js/SpacedTextAccumulator.js
index c86bd406dea..d24ab68d2b5 100644
--- a/src/js/SpacedTextAccumulator.js
+++ b/src/js/SpacedTextAccumulator.js
@@ -1,8 +1,11 @@
-/** @template {HTMLElement|DocumentFragment} [ContainerT=DocumentFragment] */
+/**
+ * @typedef {HTMLElement|DocumentFragment} ContainerT
+ */
 globalThis.SpacedTextAccumulator = class SpacedTextAccumulator {
 	/** @param {ContainerT} [container] */
 	constructor(container) {
-		this._container = container || /** @type {ContainerT} */(new DocumentFragment());
+		/** @type {ContainerT} */
+		this._container = container || new DocumentFragment();
 		/** @type {(string|HTMLElement|DocumentFragment)[]} */
 		this._accumulator = [];
 		this._checked = false;
@@ -23,7 +26,6 @@ globalThis.SpacedTextAccumulator = class SpacedTextAccumulator {
 		}
 	}
 
-	/** get a reference the underlying container */
 	container() {
 		this._checkScope();
 		return this._container;
@@ -55,7 +57,7 @@ globalThis.SpacedTextAccumulator = class SpacedTextAccumulator {
 	/** assemble an element from the accumulated sentences or sentence fragments, separated by spaces
 	 * @template {keyof HTMLElementTagNameMap} K
 	 * @param {K} element
-	 * @param {string|Array<string>} [classNames]
+	 * @param {Array<string>} [classNames]
 	 */
 	toNode(element, classNames) {
 		const el = App.UI.DOM.makeElement(element, null, classNames);
-- 
GitLab