aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language/dictionary-worker-media-loader.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2022-05-20 10:28:38 -0400
committerGitHub <noreply@github.com>2022-05-20 10:28:38 -0400
commit31e20c889e467aa4ba64b0b5baf602adc1359371 (patch)
treea033db935a817b2d407ec20843176610a87a6e16 /ext/js/language/dictionary-worker-media-loader.js
parentae0ad227c0fd293609a21e5cc1d2a4b85fe7c520 (diff)
ESlint JSdoc (#2148)
* Install eslint-plugin-jsdoc * Initial rules setup * Update lists * Use @returns rather than @return * Remove error throwing code which is never executed * Fix issues relating to @throws * General error fixes * Update Display type documentation * Various doc fixes * Fix invalid tuple syntax * Doc updates * Remove unused * Doc updates * Enable jsdoc/require-returns * Update rules * Update remaining rules
Diffstat (limited to 'ext/js/language/dictionary-worker-media-loader.js')
-rw-r--r--ext/js/language/dictionary-worker-media-loader.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/js/language/dictionary-worker-media-loader.js b/ext/js/language/dictionary-worker-media-loader.js
index fc7ecd17..7e30b333 100644
--- a/ext/js/language/dictionary-worker-media-loader.js
+++ b/ext/js/language/dictionary-worker-media-loader.js
@@ -29,7 +29,7 @@ class DictionaryWorkerMediaLoader {
/**
* Handles a response message posted to the worker thread.
- * @param params Details of the response.
+ * @param {{id: string, error: object|undefined, result: any|undefined}} params Details of the response.
*/
handleMessage(params) {
const {id} = params;
@@ -46,9 +46,10 @@ class DictionaryWorkerMediaLoader {
/**
* Attempts to load an image using an ArrayBuffer and a media type to return details about it.
- * @param content The binary content for the image, encoded as an ArrayBuffer.
- * @param mediaType The media type for the image content.
- * @returns A Promise which resolves with {content, width, height} on success, otherwise an error is thrown.
+ * @param {ArrayBuffer} content The binary content for the image, encoded as an ArrayBuffer.
+ * @param {string} mediaType The media type for the image content.
+ * @returns {Promise<{content: ArrayBuffer, width: number, height: number}>} Details about the requested image content.
+ * @throws {Error} An error can be thrown if the image fails to load.
*/
getImageDetails(content, mediaType) {
return new Promise((resolve, reject) => {