From d8f41642de5f6b4e728068eccefc965b70350e51 Mon Sep 17 00:00:00 2001 From: Josh Kelley Date: Wed, 13 Oct 2021 23:44:25 -0400 Subject: [PATCH] Update JSDoc This may help developers, and it helps WebStorm's code analysis. (Previously, WebStorm was warning that Chart.js's calls to acquireTests were missing a required parameter.) --- src/index.js | 14 +++++++------- src/utils.js | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/index.js b/src/index.js index 9e748d5..d3f8ae8 100644 --- a/src/index.js +++ b/src/index.js @@ -11,13 +11,13 @@ var charts = {}; /** * Injects a new canvas (and div wrapper) and creates the associated Chart instance * using the given config. Additional options allow tweaking elements generation. - * @param {object} config - Chart config. - * @param {object} options - Chart acquisition options. - * @param {object} options.canvas - Canvas attributes. - * @param {object} options.wrapper - Canvas wrapper attributes. - * @param {boolean} options.useOffscreenCanvas - use an OffscreenCanvas instead of the normal HTMLCanvasElement. - * @param {boolean} options.useShadowDOM - use shadowDom - * @param {boolean} options.persistent - If true, the chart will not be released after the spec. + * @param {object} [config] - Chart config. + * @param {object} [options] - Chart acquisition options. + * @param {object} [options.canvas] - Canvas attributes. + * @param {object} [options.wrapper] - Canvas wrapper attributes. + * @param {boolean} [options.useOffscreenCanvas] - use an OffscreenCanvas instead of the normal HTMLCanvasElement. + * @param {boolean} [options.useShadowDOM] - use shadowDom + * @param {boolean} [options.persistent] - If true, the chart will not be released after the spec. */ export function acquireChart(config, options) { var chart = _acquireChart(config, options); diff --git a/src/utils.js b/src/utils.js index 678d205..64118a5 100644 --- a/src/utils.js +++ b/src/utils.js @@ -25,13 +25,13 @@ export function readImageData(url, callback) { /** * Injects a new canvas (and div wrapper) and creates the associated Chart instance * using the given config. Additional options allow tweaking elements generation. - * @param {object} config - Chart config. - * @param {object} options - Chart acquisition options. - * @param {object} options.canvas - Canvas attributes. - * @param {object} options.wrapper - Canvas wrapper attributes. - * @param {boolean} options.useOffscreenCanvas - use an OffscreenCanvas instead of the normal HTMLCanvasElement. - * @param {boolean} options.useShadowDOM - use shadowDom - * @param {boolean} options.persistent - If true, the chart will not be released after the spec. + * @param {object} [config] - Chart config. + * @param {object} [options] - Chart acquisition options. + * @param {object} [options.canvas] - Canvas attributes. + * @param {object} [options.wrapper] - Canvas wrapper attributes. + * @param {boolean} [options.useOffscreenCanvas] - use an OffscreenCanvas instead of the normal HTMLCanvasElement. + * @param {boolean} [options.useShadowDOM] - use shadowDom + * @param {boolean} [options.persistent] - If true, the chart will not be released after the spec. */ export function _acquireChart(config, options) { var wrapper = document.createElement('div');