Annotate doodle parameters to please eslint (#2321)

This commit is contained in:
Claire 2023-07-23 14:31:05 +02:00 committed by GitHub
parent 52500965cc
commit dd09535bda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -129,12 +129,12 @@ const mapStateToProps = state => ({
const mapDispatchToProps = dispatch => ({ const mapDispatchToProps = dispatch => ({
/** /**
* Set options in the redux store * Set options in the redux store
* @param opts * @param {Object} opts
*/ */
setOpt: (opts) => dispatch(doodleSet(opts)), setOpt: (opts) => dispatch(doodleSet(opts)),
/** /**
* Submit doodle for upload * Submit doodle for upload
* @param file * @param {File} file
*/ */
submit: (file) => dispatch(uploadCompose([file])), submit: (file) => dispatch(uploadCompose([file])),
}); });
@ -240,7 +240,7 @@ class DoodleModal extends ImmutablePureComponent {
/** /**
* Key up handler * Key up handler
* @param e * @param {KeyboardEvent} e
*/ */
handleKeyUp = (e) => { handleKeyUp = (e) => {
if (e.target.nodeName === 'INPUT') return; if (e.target.nodeName === 'INPUT') return;
@ -269,7 +269,7 @@ class DoodleModal extends ImmutablePureComponent {
/** /**
* Key down handler * Key down handler
* @param e * @param {KeyboardEvent} e
*/ */
handleKeyDown = (e) => { handleKeyDown = (e) => {
if (e.key === 'Control' || e.key === 'Meta') { if (e.key === 'Control' || e.key === 'Meta') {
@ -306,7 +306,7 @@ class DoodleModal extends ImmutablePureComponent {
/** /**
* Set reference to the canvas element. * Set reference to the canvas element.
* This is called during component init * This is called during component init
* @param elem - canvas element * @param {HTMLCanvasElement} elem - canvas element
*/ */
setCanvasRef = (elem) => { setCanvasRef = (elem) => {
this.canvas = elem; this.canvas = elem;
@ -347,7 +347,7 @@ class DoodleModal extends ImmutablePureComponent {
/** /**
* Set up the sketcher instance * 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) { initSketcher (canvas = null) {
const sizepreset = DOODLE_SIZES[this.size]; const sizepreset = DOODLE_SIZES[this.size];
@ -445,7 +445,7 @@ class DoodleModal extends ImmutablePureComponent {
/** /**
* Palette left click. * Palette left click.
* Selects Fg color (or Bg, if Control/Meta is held) * Selects Fg color (or Bg, if Control/Meta is held)
* @param e - event * @param {MouseEvent<HTMLButtonElement>} e - event
*/ */
onPaletteClick = (e) => { onPaletteClick = (e) => {
const c = e.target.dataset.color; const c = e.target.dataset.color;
@ -463,7 +463,7 @@ class DoodleModal extends ImmutablePureComponent {
/** /**
* Palette right click. * Palette right click.
* Selects Bg color * Selects Bg color
* @param e - event * @param {MouseEvent<HTMLButtonElement>} e - event
*/ */
onPaletteRClick = (e) => { onPaletteRClick = (e) => {
this.bg = e.target.dataset.color; this.bg = e.target.dataset.color;
@ -473,7 +473,7 @@ class DoodleModal extends ImmutablePureComponent {
/** /**
* Handle click on the Draw mode button * Handle click on the Draw mode button
* @param e - event * @param {MouseEvent<HTMLButtonElement>} e - event
*/ */
setModeDraw = (e) => { setModeDraw = (e) => {
this.mode = 'draw'; this.mode = 'draw';
@ -482,7 +482,7 @@ class DoodleModal extends ImmutablePureComponent {
/** /**
* Handle click on the Fill mode button * Handle click on the Fill mode button
* @param e - event * @param {MouseEvent<HTMLButtonElement>} e - event
*/ */
setModeFill = (e) => { setModeFill = (e) => {
this.mode = 'fill'; this.mode = 'fill';
@ -491,7 +491,7 @@ class DoodleModal extends ImmutablePureComponent {
/** /**
* Handle click on Smooth checkbox * Handle click on Smooth checkbox
* @param e - event * @param {ChangeEvent<HTMLInputElement>} e - event
*/ */
tglSmooth = (e) => { tglSmooth = (e) => {
this.smoothing = !this.smoothing; this.smoothing = !this.smoothing;
@ -500,7 +500,7 @@ class DoodleModal extends ImmutablePureComponent {
/** /**
* Handle click on Adaptive checkbox * Handle click on Adaptive checkbox
* @param e - event * @param {ChangeEvent<HTMLInputElement>} e - event
*/ */
tglAdaptive = (e) => { tglAdaptive = (e) => {
this.adaptiveStroke = !this.adaptiveStroke; this.adaptiveStroke = !this.adaptiveStroke;
@ -509,7 +509,7 @@ class DoodleModal extends ImmutablePureComponent {
/** /**
* Handle change of the Weight input field * Handle change of the Weight input field
* @param e - event * @param {ChangeEvent<HTMLInputElement>} e - event
*/ */
setWeight = (e) => { setWeight = (e) => {
this.weight = +e.target.value || 1; this.weight = +e.target.value || 1;
@ -517,7 +517,7 @@ class DoodleModal extends ImmutablePureComponent {
/** /**
* Set size - clalback from the select box * Set size - clalback from the select box
* @param e - event * @param {ChangeEvent<HTMLSelectElement>} e - event
*/ */
changeSize = (e) => { changeSize = (e) => {
let newSize = e.target.value; let newSize = e.target.value;