aboutsummaryrefslogtreecommitdiff
path: root/ext/js/comm/clipboard-reader.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/comm/clipboard-reader.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/comm/clipboard-reader.js')
-rw-r--r--ext/js/comm/clipboard-reader.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/ext/js/comm/clipboard-reader.js b/ext/js/comm/clipboard-reader.js
index 7a4744ca..aaf4dcd8 100644
--- a/ext/js/comm/clipboard-reader.js
+++ b/ext/js/comm/clipboard-reader.js
@@ -25,9 +25,10 @@
class ClipboardReader {
/**
* Creates a new instances of a clipboard reader.
- * @param document The Document object to be used, or null for no support.
- * @param pasteTargetSelector The selector for the paste target element.
- * @param imagePasteTargetSelector The selector for the image paste target element.
+ * @param {object} details Details about how to set up the instance.
+ * @param {?Document} details.document The Document object to be used, or null for no support.
+ * @param {?string} details.pasteTargetSelector The selector for the paste target element.
+ * @param {?string} details.imagePasteTargetSelector The selector for the image paste target element.
*/
constructor({document=null, pasteTargetSelector=null, imagePasteTargetSelector=null}) {
this._document = document;
@@ -40,6 +41,7 @@ class ClipboardReader {
/**
* Gets the browser being used.
+ * @type {?string}
*/
get browser() {
return this._browser;
@@ -54,8 +56,8 @@ class ClipboardReader {
/**
* Gets the text in the clipboard.
- * @returns A string containing the clipboard text.
- * @throws Error if not supported.
+ * @returns {string} A string containing the clipboard text.
+ * @throws {Error} Error if not supported.
*/
async getText() {
/*
@@ -103,8 +105,8 @@ class ClipboardReader {
/**
* Gets the first image in the clipboard.
- * @returns A string containing a data URL of the image file, or null if no image was found.
- * @throws Error if not supported.
+ * @returns {string} A string containing a data URL of the image file, or null if no image was found.
+ * @throws {Error} Error if not supported.
*/
async getImage() {
// See browser-specific notes in getText