aboutsummaryrefslogtreecommitdiff
path: root/ext/js/language/dictionary-importer-media-loader.js
diff options
context:
space:
mode:
authorDarius Jahandarie <djahandarie@gmail.com>2023-12-06 03:53:16 +0000
committerGitHub <noreply@github.com>2023-12-06 03:53:16 +0000
commitbd5bc1a5db29903bc098995cd9262c4576bf76af (patch)
treec9214189e0214480fcf6539ad1c6327aef6cbd1c /ext/js/language/dictionary-importer-media-loader.js
parentfd6bba8a2a869eaf2b2c1fa49001f933fce3c618 (diff)
parent23e6fb76319c9ed7c9bcdc3efba39bc5dd38f288 (diff)
Merge pull request #339 from toasted-nutbread/type-annotations
Type annotations
Diffstat (limited to 'ext/js/language/dictionary-importer-media-loader.js')
-rw-r--r--ext/js/language/dictionary-importer-media-loader.js10
1 files changed, 1 insertions, 9 deletions
diff --git a/ext/js/language/dictionary-importer-media-loader.js b/ext/js/language/dictionary-importer-media-loader.js
index 7d4f798c..a5857dce 100644
--- a/ext/js/language/dictionary-importer-media-loader.js
+++ b/ext/js/language/dictionary-importer-media-loader.js
@@ -22,15 +22,7 @@ import {EventListenerCollection} from '../core.js';
* Class used for loading and validating media during the dictionary import process.
*/
export class DictionaryImporterMediaLoader {
- /**
- * Attempts to load an image using an ArrayBuffer and a media type to return details about it.
- * @param {ArrayBuffer} content The binary content for the image, encoded as an ArrayBuffer.
- * @param {string} mediaType The media type for the image content.
- * @param {Transferable[]} [transfer] An optional array of data that should be transferred in `postMessage` calls.
- * When the resulting promise resolves, this array will contain the `content` object.
- * @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.
- */
+ /** @type {import('dictionary-importer-media-loader').GetImageDetailsFunction} */
getImageDetails(content, mediaType, transfer) {
return new Promise((resolve, reject) => {
const image = new Image();