From dd09535bda183ef604b16f06c9912dadcebf8dd2 Mon Sep 17 00:00:00 2001 From: Claire Date: Sun, 23 Jul 2023 14:31:05 +0200 Subject: [PATCH] Annotate doodle parameters to please eslint (#2321) --- .../features/ui/components/doodle_modal.jsx | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/javascript/flavours/glitch/features/ui/components/doodle_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/doodle_modal.jsx index b594353589..b790eaebab 100644 --- a/app/javascript/flavours/glitch/features/ui/components/doodle_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/doodle_modal.jsx @@ -129,12 +129,12 @@ const mapStateToProps = state => ({ const mapDispatchToProps = dispatch => ({ /** * Set options in the redux store - * @param opts + * @param {Object} opts */ setOpt: (opts) => dispatch(doodleSet(opts)), /** * Submit doodle for upload - * @param file + * @param {File} file */ submit: (file) => dispatch(uploadCompose([file])), }); @@ -240,7 +240,7 @@ class DoodleModal extends ImmutablePureComponent { /** * Key up handler - * @param e + * @param {KeyboardEvent} e */ handleKeyUp = (e) => { if (e.target.nodeName === 'INPUT') return; @@ -269,7 +269,7 @@ class DoodleModal extends ImmutablePureComponent { /** * Key down handler - * @param e + * @param {KeyboardEvent} e */ handleKeyDown = (e) => { if (e.key === 'Control' || e.key === 'Meta') { @@ -306,7 +306,7 @@ class DoodleModal extends ImmutablePureComponent { /** * Set reference to the canvas element. * This is called during component init - * @param elem - canvas element + * @param {HTMLCanvasElement} elem - canvas element */ setCanvasRef = (elem) => { this.canvas = elem; @@ -347,7 +347,7 @@ class DoodleModal extends ImmutablePureComponent { /** * Set up the sketcher instance - * @param canvas - canvas element. Null if we're just resizing + * @param {HTMLCanvasElement | null} canvas - canvas element. Null if we're just resizing */ initSketcher (canvas = null) { const sizepreset = DOODLE_SIZES[this.size]; @@ -445,7 +445,7 @@ class DoodleModal extends ImmutablePureComponent { /** * Palette left click. * Selects Fg color (or Bg, if Control/Meta is held) - * @param e - event + * @param {MouseEvent} e - event */ onPaletteClick = (e) => { const c = e.target.dataset.color; @@ -463,7 +463,7 @@ class DoodleModal extends ImmutablePureComponent { /** * Palette right click. * Selects Bg color - * @param e - event + * @param {MouseEvent} e - event */ onPaletteRClick = (e) => { this.bg = e.target.dataset.color; @@ -473,7 +473,7 @@ class DoodleModal extends ImmutablePureComponent { /** * Handle click on the Draw mode button - * @param e - event + * @param {MouseEvent} e - event */ setModeDraw = (e) => { this.mode = 'draw'; @@ -482,7 +482,7 @@ class DoodleModal extends ImmutablePureComponent { /** * Handle click on the Fill mode button - * @param e - event + * @param {MouseEvent} e - event */ setModeFill = (e) => { this.mode = 'fill'; @@ -491,7 +491,7 @@ class DoodleModal extends ImmutablePureComponent { /** * Handle click on Smooth checkbox - * @param e - event + * @param {ChangeEvent} e - event */ tglSmooth = (e) => { this.smoothing = !this.smoothing; @@ -500,7 +500,7 @@ class DoodleModal extends ImmutablePureComponent { /** * Handle click on Adaptive checkbox - * @param e - event + * @param {ChangeEvent} e - event */ tglAdaptive = (e) => { this.adaptiveStroke = !this.adaptiveStroke; @@ -509,7 +509,7 @@ class DoodleModal extends ImmutablePureComponent { /** * Handle change of the Weight input field - * @param e - event + * @param {ChangeEvent} e - event */ setWeight = (e) => { this.weight = +e.target.value || 1; @@ -517,7 +517,7 @@ class DoodleModal extends ImmutablePureComponent { /** * Set size - clalback from the select box - * @param e - event + * @param {ChangeEvent} e - event */ changeSize = (e) => { let newSize = e.target.value;