Skip to content

Commit

Permalink
Default templates to unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
toasted-nutbread committed Dec 19, 2023
1 parent 1ced9aa commit 7896ca5
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions dev/manifest-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {parseJson} from './json.js';
const dirname = path.dirname(fileURLToPath(import.meta.url));

/**
* @template T
* @template [T=unknown]
* @param {T} value
* @returns {T}
*/
Expand Down Expand Up @@ -240,7 +240,7 @@ export class ManifestUtil {
}

/**
* @template T
* @template [T=unknown]
* @param {T[]} array1
* @param {T[]} array2
* @param {number} lengthOffset
Expand Down
2 changes: 1 addition & 1 deletion ext/js/comm/frame-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class FrameClient {
}

/**
* @template T
* @template [T=unknown]
* @param {T} data
* @returns {import('frame-client').Message<T>}
* @throws {Error}
Expand Down
6 changes: 3 additions & 3 deletions ext/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions ext/js/data/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class Database {
}

/**
* @template TPredicateArg
* @template [TPredicateArg=unknown]
* @template [TResult=unknown]
* @template [TResultDefault=unknown]
* @param {TObjectStoreName} objectStoreName
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ext/js/data/json-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class JsonSchema {
}

/**
* @template T
* @template [T=unknown]
* @param {T} value
* @returns {T}
*/
Expand Down
2 changes: 1 addition & 1 deletion ext/js/display/display-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ext/js/dom/selector-observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down
3 changes: 2 additions & 1 deletion ext/js/general/cache-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion ext/js/general/task-accumulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import {log} from '../core.js';

/**
* @template K,V
* @template [K=unknown]
* @template [V=unknown]
*/
export class TaskAccumulator {
/**
Expand Down
2 changes: 1 addition & 1 deletion ext/js/language/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,7 @@ export class Translator {
// Miscellaneous

/**
* @template T
* @template [T=unknown]
* @param {Set<T>} set
* @param {T[]} values
* @returns {boolean}
Expand Down
2 changes: 1 addition & 1 deletion ext/js/pages/settings/keyboard-mouse-input-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class KeyboardMouseInputField extends EventDispatcher {
}

/**
* @template T
* @template [T=unknown]
* @param {T[]} array1
* @param {T[]} array2
* @returns {boolean}
Expand Down
2 changes: 1 addition & 1 deletion ext/js/pages/settings/profile-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ export class ProfileController {
}

/**
* @template T
* @template [T=unknown]
* @param {T} currentValue
* @param {T} value1
* @param {T} value2
Expand Down
2 changes: 1 addition & 1 deletion test/json-schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function createProxy(schema, value) {
}

/**
* @template T
* @template [T=unknown]
* @param {T} value
* @returns {T}
*/
Expand Down

0 comments on commit 7896ca5

Please sign in to comment.