problem description
when I use deconstruction assignment in the parameters of a function, how should I write the corresponding jsDoc, so that IDE can prompt the content correctly?
Thank you in advance for all the excellent respondents who participated in the answer!
related codes
......
/**
* Avg
*/
class Avg {
/**
*
* @param {Object} [p] < jsDocVSCAvg
* @param {HTMLCanvasElement} [p.target] <
* @param {number} [p.height = 720] canvas <
* @param {number} [p.width = 1280] canvas <
* @param {string} [p.color = con.DEFUALT_COLOR] <
*/
constructor ({
target = undefined, // canvas
width = con.DEFUALT_DRAWING_BOARD_WIDTH, //
height = con.DEFUALT_DRAWING_BOARD_HEIGHT, //
color = con.DEFUALT_COLOR //
} = {}) {
/**
*
* @type {string}
*/
this.color = color
.....
current effect and expected effect
it is useless to talk too much. Please see the figure
the expected effect
50