aboutsummaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-12-19 01:17:22 -0500
committerGitHub <noreply@github.com>2023-12-19 06:17:22 +0000
commite9e504b40dde8691c32c933c7e27e28cfad1c8b5 (patch)
tree1128f311d9e5cb6316fbf237724eb2b87a522446 /ext
parent20dd6112724a77fee16281930e79a2e6822acff7 (diff)
Template type improvements (#380)
* Default templates to unknown * Default typescript templates to unknown * More template type updates
Diffstat (limited to 'ext')
-rw-r--r--ext/js/comm/frame-client.js2
-rw-r--r--ext/js/core.js6
-rw-r--r--ext/js/data/database.js6
-rw-r--r--ext/js/data/json-schema.js2
-rw-r--r--ext/js/display/display-generator.js2
-rw-r--r--ext/js/dom/selector-observer.js2
-rw-r--r--ext/js/general/cache-map.js3
-rw-r--r--ext/js/general/task-accumulator.js3
-rw-r--r--ext/js/language/translator.js2
-rw-r--r--ext/js/pages/settings/keyboard-mouse-input-field.js2
-rw-r--r--ext/js/pages/settings/profile-controller.js2
11 files changed, 17 insertions, 15 deletions
diff --git a/ext/js/comm/frame-client.js b/ext/js/comm/frame-client.js
index b07bb796..5e997622 100644
--- a/ext/js/comm/frame-client.js
+++ b/ext/js/comm/frame-client.js
@@ -56,7 +56,7 @@ export class FrameClient {
}
/**
- * @template T
+ * @template [T=unknown]
* @param {T} data
* @returns {import('frame-client').Message<T>}
* @throws {Error}
diff --git a/ext/js/core.js b/ext/js/core.js
index d16a2099..d2372352 100644
--- a/ext/js/core.js
+++ b/ext/js/core.js
@@ -48,7 +48,7 @@ export function stringReverse(string) {
/**
* Creates a deep clone of an object or value. This is similar to `parseJson(JSON.stringify(value))`.
- * @template T
+ * @template [T=unknown]
* @param {T} value The value to clone.
* @returns {T} A new clone of the value.
* @throws An error if the value is circular and cannot be cloned.
@@ -245,7 +245,7 @@ export function generateId(length) {
/**
* Creates an unresolved promise that can be resolved later, outside the promise's executor function.
- * @template T
+ * @template [T=unknown]
* @returns {import('core').DeferredPromiseDetails<T>} An object `{promise, resolve, reject}`, containing the promise and the resolve/reject functions.
*/
export function deferPromise() {
@@ -514,7 +514,7 @@ export class EventListenerCollection {
/**
* Class representing a generic value with an override stack.
* Changes can be observed by listening to the 'change' event.
- * @template T
+ * @template [T=unknown]
* @augments EventDispatcher<import('dynamic-property').EventType>
*/
export class DynamicProperty extends EventDispatcher {
diff --git a/ext/js/data/database.js b/ext/js/data/database.js
index c8047b41..43ac9e5b 100644
--- a/ext/js/data/database.js
+++ b/ext/js/data/database.js
@@ -153,7 +153,7 @@ export class Database {
}
/**
- * @template TPredicateArg
+ * @template [TPredicateArg=unknown]
* @template [TResult=unknown]
* @template [TResultDefault=unknown]
* @param {TObjectStoreName} objectStoreName
@@ -174,8 +174,8 @@ export class Database {
}
/**
- * @template TData
- * @template TPredicateArg
+ * @template [TData=unknown]
+ * @template [TPredicateArg=unknown]
* @template [TResult=unknown]
* @template [TResultDefault=unknown]
* @param {IDBObjectStore|IDBIndex} objectStoreOrIndex
diff --git a/ext/js/data/json-schema.js b/ext/js/data/json-schema.js
index d63cfd1a..52a55d85 100644
--- a/ext/js/data/json-schema.js
+++ b/ext/js/data/json-schema.js
@@ -249,7 +249,7 @@ export class JsonSchema {
}
/**
- * @template T
+ * @template [T=unknown]
* @param {T} value
* @returns {T}
*/
diff --git a/ext/js/display/display-generator.js b/ext/js/display/display-generator.js
index 7bedfa12..ccdd49cf 100644
--- a/ext/js/display/display-generator.js
+++ b/ext/js/display/display-generator.js
@@ -845,7 +845,7 @@ export class DisplayGenerator {
}
/**
- * @template TItem
+ * @template [TItem=unknown]
* @template [TExtraArg=void]
* @param {HTMLElement} container
* @param {(item: TItem, arg: TExtraArg) => ?Node} createItem
diff --git a/ext/js/dom/selector-observer.js b/ext/js/dom/selector-observer.js
index 8dd18242..cff2985c 100644
--- a/ext/js/dom/selector-observer.js
+++ b/ext/js/dom/selector-observer.js
@@ -18,7 +18,7 @@
/**
* Class which is used to observe elements matching a selector in specific element.
- * @template T
+ * @template [T=unknown]
*/
export class SelectorObserver {
/**
diff --git a/ext/js/general/cache-map.js b/ext/js/general/cache-map.js
index cc706380..a995b8c7 100644
--- a/ext/js/general/cache-map.js
+++ b/ext/js/general/cache-map.js
@@ -18,7 +18,8 @@
/**
- * @template K,V
+ * @template [K=unknown]
+ * @template [V=unknown]
* Class which caches a map of values, keeping the most recently accessed values.
*/
export class CacheMap {
diff --git a/ext/js/general/task-accumulator.js b/ext/js/general/task-accumulator.js
index cb136908..86cb9e3e 100644
--- a/ext/js/general/task-accumulator.js
+++ b/ext/js/general/task-accumulator.js
@@ -19,7 +19,8 @@
import {log} from '../core.js';
/**
- * @template K,V
+ * @template [K=unknown]
+ * @template [V=unknown]
*/
export class TaskAccumulator {
/**
diff --git a/ext/js/language/translator.js b/ext/js/language/translator.js
index e33ea4d4..bf22ee6b 100644
--- a/ext/js/language/translator.js
+++ b/ext/js/language/translator.js
@@ -1887,7 +1887,7 @@ export class Translator {
// Miscellaneous
/**
- * @template T
+ * @template [T=unknown]
* @param {Set<T>} set
* @param {T[]} values
* @returns {boolean}
diff --git a/ext/js/pages/settings/keyboard-mouse-input-field.js b/ext/js/pages/settings/keyboard-mouse-input-field.js
index 99af3941..f50ca112 100644
--- a/ext/js/pages/settings/keyboard-mouse-input-field.js
+++ b/ext/js/pages/settings/keyboard-mouse-input-field.js
@@ -315,7 +315,7 @@ export class KeyboardMouseInputField extends EventDispatcher {
}
/**
- * @template T
+ * @template [T=unknown]
* @param {T[]} array1
* @param {T[]} array2
* @returns {boolean}
diff --git a/ext/js/pages/settings/profile-controller.js b/ext/js/pages/settings/profile-controller.js
index 6e0710a8..c54bfe73 100644
--- a/ext/js/pages/settings/profile-controller.js
+++ b/ext/js/pages/settings/profile-controller.js
@@ -595,7 +595,7 @@ export class ProfileController {
}
/**
- * @template T
+ * @template [T=unknown]
* @param {T} currentValue
* @param {T} value1
* @param {T} value2