From 7a67ff95b2c06669d449f2751233e2aec6c7c61e Mon Sep 17 00:00:00 2001 From: Philipp Fromme Date: Fri, 3 Apr 2020 15:51:45 +0200 Subject: [PATCH] chore(documentation): fix JSDoc string types --- lib/BaseModeler.js | 4 ++-- lib/BaseViewer.js | 22 +++++++++---------- lib/Modeler.js | 4 ++-- lib/Viewer.js | 4 ++-- lib/draw/PathMap.js | 2 +- lib/draw/TextRenderer.js | 6 ++--- .../context-pad/ContextPadProvider.js | 6 ++--- lib/features/keyboard/BpmnKeyboardBindings.js | 2 +- .../label-editing/cmd/UpdateLabelHandler.js | 2 +- lib/features/modeling/ElementFactory.js | 4 ++-- .../AdaptiveLabelPositioningBehavior.js | 6 ++--- lib/features/modeling/util/ModelingUtil.js | 4 ++-- lib/features/search/BpmnSearchProvider.js | 4 ++-- lib/import/BpmnTreeWalker.js | 2 +- lib/util/ModelUtil.js | 2 +- test/helper/index.js | 4 ++-- .../custom-elements/CustomElementFactory.js | 2 +- test/spec/draw/BpmnRendererSpec.js | 4 ++-- .../features/copy-paste/BpmnCopyPasteSpec.js | 4 ++-- test/util/KeyEvents.js | 2 +- 20 files changed, 45 insertions(+), 45 deletions(-) diff --git a/lib/BaseModeler.js b/lib/BaseModeler.js index efa727f6..baf318fe 100644 --- a/lib/BaseModeler.js +++ b/lib/BaseModeler.js @@ -12,8 +12,8 @@ import BaseViewer from './BaseViewer'; * * @param {Object} [options] configuration options to pass to the viewer * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body. - * @param {String|Number} [options.width] the width of the viewer - * @param {String|Number} [options.height] the height of the viewer + * @param {string|Number} [options.width] the width of the viewer + * @param {string|Number} [options.height] the height of the viewer * @param {Object} [options.moddleExtensions] extension packages to provide * @param {Array} [options.modules] a list of modules to override the default modules * @param {Array} [options.additionalModules] a list of modules to use with the default modules diff --git a/lib/BaseViewer.js b/lib/BaseViewer.js index cc0f3385..0fc82c4c 100644 --- a/lib/BaseViewer.js +++ b/lib/BaseViewer.js @@ -40,8 +40,8 @@ import { * * @param {Object} [options] configuration options to pass to the viewer * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body. - * @param {String|Number} [options.width] the width of the viewer - * @param {String|Number} [options.height] the height of the viewer + * @param {string|Number} [options.width] the width of the viewer + * @param {string|Number} [options.height] the height of the viewer * @param {Object} [options.moddleExtensions] extension packages to provide * @param {Array} [options.modules] a list of modules to override the default modules * @param {Array} [options.additionalModules] a list of modules to use with the default modules @@ -84,8 +84,8 @@ inherits(BaseViewer, Diagram); * * You can use these events to hook into the life-cycle. * - * @param {String} xml the BPMN 2.0 xml - * @param {ModdleElement|String} [bpmnDiagram] BPMN diagram or id of diagram to render (if not provided, the first one will be rendered) + * @param {string} xml the BPMN 2.0 xml + * @param {ModdleElement|string} [bpmnDiagram] BPMN diagram or id of diagram to render (if not provided, the first one will be rendered) * @param {Function} [done] invoked with (err, warnings=[]) */ BaseViewer.prototype.importXML = function(xml, bpmnDiagram, done) { @@ -150,7 +150,7 @@ BaseViewer.prototype.importXML = function(xml, bpmnDiagram, done) { * You can use these events to hook into the life-cycle. * * @param {ModdleElement} definitions parsed BPMN 2.0 definitions - * @param {ModdleElement|String} [bpmnDiagram] BPMN diagram or id of diagram to render (if not provided, the first one will be rendered) + * @param {ModdleElement|string} [bpmnDiagram] BPMN diagram or id of diagram to render (if not provided, the first one will be rendered) * @param {Function} [done] invoked with (err, warnings=[]) */ BaseViewer.prototype.importDefinitions = function(definitions, bpmnDiagram, done) { @@ -183,7 +183,7 @@ BaseViewer.prototype.importDefinitions = function(definitions, bpmnDiagram, done * * You can use these events to hook into the life-cycle. * - * @param {String|ModdleElement} [bpmnDiagramOrId] id or the diagram to open + * @param {string|ModdleElement} [bpmnDiagramOrId] id or the diagram to open * @param {Function} [done] invoked with (err, warnings=[]) */ BaseViewer.prototype.open = function(bpmnDiagramOrId, done) { @@ -350,7 +350,7 @@ BaseViewer.prototype.saveSVG = function(options, done) { * var elementRegistry = viewer.get('elementRegistry'); * var startEventShape = elementRegistry.get('StartEvent_1'); * - * @param {String} name + * @param {string} name * * @return {Object} diagram service instance * @@ -432,7 +432,7 @@ BaseViewer.prototype.destroy = function() { * * Remove a previously added listener via {@link #off(event, callback)}. * - * @param {String} event + * @param {string} event * @param {Number} [priority] * @param {Function} callback * @param {Object} [that] @@ -444,7 +444,7 @@ BaseViewer.prototype.on = function(event, priority, callback, target) { /** * De-register an event listener * - * @param {String} event + * @param {string} event * @param {Function} callback */ BaseViewer.prototype.off = function(event, callback) { @@ -524,7 +524,7 @@ BaseViewer.prototype._init = function(container, moddle, options) { /** * Emit an event on the underlying {@link EventBus} * - * @param {String} type + * @param {string} type * @param {Object} event * * @return {Object} event processing result (if any) @@ -593,7 +593,7 @@ function ensureUnit(val) { * Find BPMNDiagram in definitions by ID * * @param {ModdleElement} definitions - * @param {String} diagramId + * @param {string} diagramId * * @return {ModdleElement|null} */ diff --git a/lib/Modeler.js b/lib/Modeler.js index c1b57bd7..4225fc1c 100644 --- a/lib/Modeler.js +++ b/lib/Modeler.js @@ -123,8 +123,8 @@ var initialDiagram = * * @param {Object} [options] configuration options to pass to the viewer * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body. - * @param {String|Number} [options.width] the width of the viewer - * @param {String|Number} [options.height] the height of the viewer + * @param {string|Number} [options.width] the width of the viewer + * @param {string|Number} [options.height] the height of the viewer * @param {Object} [options.moddleExtensions] extension packages to provide * @param {Array} [options.modules] a list of modules to override the default modules * @param {Array} [options.additionalModules] a list of modules to use with the default modules diff --git a/lib/Viewer.js b/lib/Viewer.js index 1f57bac3..505479c8 100644 --- a/lib/Viewer.js +++ b/lib/Viewer.js @@ -49,8 +49,8 @@ import BaseViewer from './BaseViewer'; * * @param {Object} [options] configuration options to pass to the viewer * @param {DOMElement} [options.container] the container to render the viewer in, defaults to body. - * @param {String|Number} [options.width] the width of the viewer - * @param {String|Number} [options.height] the height of the viewer + * @param {string|Number} [options.width] the width of the viewer + * @param {string|Number} [options.height] the height of the viewer * @param {Object} [options.moddleExtensions] extension packages to provide * @param {Array} [options.modules] a list of modules to override the default modules * @param {Array} [options.additionalModules] a list of modules to use with the default modules diff --git a/lib/draw/PathMap.js b/lib/draw/PathMap.js index f5d024b7..cc28a48b 100644 --- a/lib/draw/PathMap.js +++ b/lib/draw/PathMap.js @@ -362,7 +362,7 @@ export default function PathMap() { * Also there are use cases where only some parts of a path should be * scaled.

* - * @param {String} pathId The ID of the path. + * @param {string} pathId The ID of the path. * @param {Object} param

* Example param object scales the path to 60% size of the container (data.width, data.height). *

diff --git a/lib/draw/TextRenderer.js b/lib/draw/TextRenderer.js
index 8d1fe0d3..e70b8096 100644
--- a/lib/draw/TextRenderer.js
+++ b/lib/draw/TextRenderer.js
@@ -32,7 +32,7 @@ export default function TextRenderer(config) {
    * layouted label.
    *
    * @param  {Bounds} bounds
-   * @param  {String} text
+   * @param  {string} text
    *
    * @return {Bounds}
    */
@@ -62,7 +62,7 @@ export default function TextRenderer(config) {
    * Get the new bounds of text annotation.
    *
    * @param  {Bounds} bounds
-   * @param  {String} text
+   * @param  {string} text
    *
    * @return {Bounds}
    */
@@ -86,7 +86,7 @@ export default function TextRenderer(config) {
   /**
    * Create a layouted text element.
    *
-   * @param {String} text
+   * @param {string} text
    * @param {Object} [options]
    *
    * @return {SVGElement} rendered text
diff --git a/lib/features/context-pad/ContextPadProvider.js b/lib/features/context-pad/ContextPadProvider.js
index 564435be..3d7ce3cd 100644
--- a/lib/features/context-pad/ContextPadProvider.js
+++ b/lib/features/context-pad/ContextPadProvider.js
@@ -142,9 +142,9 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
   /**
    * Create an append action
    *
-   * @param {String} type
-   * @param {String} className
-   * @param {String} [title]
+   * @param {string} type
+   * @param {string} className
+   * @param {string} [title]
    * @param {Object} [options]
    *
    * @return {Object} descriptor
diff --git a/lib/features/keyboard/BpmnKeyboardBindings.js b/lib/features/keyboard/BpmnKeyboardBindings.js
index 3531f377..fc940ff7 100644
--- a/lib/features/keyboard/BpmnKeyboardBindings.js
+++ b/lib/features/keyboard/BpmnKeyboardBindings.js
@@ -34,7 +34,7 @@ BpmnKeyboardBindings.prototype.registerBindings = function(keyboard, editorActio
    * Add keyboard binding if respective editor action
    * is registered.
    *
-   * @param {String} action name
+   * @param {string} action name
    * @param {Function} fn that implements the key binding
    */
   function addListener(action, fn) {
diff --git a/lib/features/label-editing/cmd/UpdateLabelHandler.js b/lib/features/label-editing/cmd/UpdateLabelHandler.js
index 63678b93..0c4e44ee 100644
--- a/lib/features/label-editing/cmd/UpdateLabelHandler.js
+++ b/lib/features/label-editing/cmd/UpdateLabelHandler.js
@@ -31,7 +31,7 @@ export default function UpdateLabelHandler(modeling, textRenderer) {
    * Element parameter can be label itself or connection (i.e. sequence flow).
    *
    * @param {djs.model.Base} element
-   * @param {String} text
+   * @param {string} text
    */
   function setText(element, text) {
 
diff --git a/lib/features/modeling/ElementFactory.js b/lib/features/modeling/ElementFactory.js
index d40fcaed..24a8f695 100644
--- a/lib/features/modeling/ElementFactory.js
+++ b/lib/features/modeling/ElementFactory.js
@@ -229,7 +229,7 @@ ElementFactory.prototype.createParticipantShape = function(attrs) {
  *
  * @param {Base} element
  * @param {Object} attrs (in/out map of attributes)
- * @param {Array} attributeNames name of attributes to apply
+ * @param {Array} attributeNames name of attributes to apply
  */
 function applyAttributes(element, attrs, attributeNames) {
 
@@ -246,7 +246,7 @@ function applyAttributes(element, attrs, attributeNames) {
  *
  * @param {Base} element
  * @param {Object} attrs (in/out map of attributes)
- * @param {String} attributeName to apply
+ * @param {string} attributeName to apply
  */
 function applyAttribute(element, attrs, attributeName) {
   element[attributeName] = attrs[attributeName];
diff --git a/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.js b/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.js
index 88df818c..b56820db 100644
--- a/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.js
+++ b/lib/features/modeling/behavior/AdaptiveLabelPositioningBehavior.js
@@ -173,7 +173,7 @@ AdaptiveLabelPositioningBehavior.$inject = [
  *
  * @param {Shape} element
  *
- * @return {Array}
+ * @return {Array}
  */
 function getTakenHostAlignments(element) {
 
@@ -204,7 +204,7 @@ function getTakenHostAlignments(element) {
  *
  * @param {Shape} element
  *
- * @return {Array}
+ * @return {Array}
  */
 function getTakenConnectionAlignments(element) {
 
@@ -230,7 +230,7 @@ function getTakenConnectionAlignments(element) {
  *
  * @param  {Shape} element
  *
- * @return {String} positioning identifier
+ * @return {string} positioning identifier
  */
 function getOptimalPosition(element) {
 
diff --git a/lib/features/modeling/util/ModelingUtil.js b/lib/features/modeling/util/ModelingUtil.js
index 871c777c..27237050 100644
--- a/lib/features/modeling/util/ModelingUtil.js
+++ b/lib/features/modeling/util/ModelingUtil.js
@@ -9,7 +9,7 @@ import { is } from '../../../util/ModelUtil';
  * Return true if element has any of the given types.
  *
  * @param {djs.model.Base} element
- * @param {Array} types
+ * @param {Array} types
  *
  * @return {Boolean}
  */
@@ -24,7 +24,7 @@ export function isAny(element, types) {
  * Return the parent of the element with any of the given types.
  *
  * @param {djs.model.Base} element
- * @param {String|Array} anyType
+ * @param {string|Array} anyType
  *
  * @return {djs.model.Base}
  */
diff --git a/lib/features/search/BpmnSearchProvider.js b/lib/features/search/BpmnSearchProvider.js
index 0f8f351d..d606f1a2 100644
--- a/lib/features/search/BpmnSearchProvider.js
+++ b/lib/features/search/BpmnSearchProvider.js
@@ -39,10 +39,10 @@ BpmnSearchProvider.$inject = [
  *
  *  :
  *  {
- *    normal|matched: 
+ *    normal|matched: 
  *  }
  *
- * @param  {String} pattern
+ * @param  {string} pattern
  * @return {Array}
  */
 BpmnSearchProvider.prototype.find = function(pattern) {
diff --git a/lib/import/BpmnTreeWalker.js b/lib/import/BpmnTreeWalker.js
index eaee6061..e897d9b8 100644
--- a/lib/import/BpmnTreeWalker.js
+++ b/lib/import/BpmnTreeWalker.js
@@ -19,7 +19,7 @@ var diRefs = new Refs(
  * Returns true if an element has the given meta-model type
  *
  * @param  {ModdleElement}  element
- * @param  {String}         type
+ * @param  {string}         type
  *
  * @return {Boolean}
  */
diff --git a/lib/util/ModelUtil.js b/lib/util/ModelUtil.js
index e45af72a..3a0a7773 100644
--- a/lib/util/ModelUtil.js
+++ b/lib/util/ModelUtil.js
@@ -2,7 +2,7 @@
  * Is an element of the given BPMN type?
  *
  * @param  {djs.model.Base|ModdleElement} element
- * @param  {String} type
+ * @param  {string} type
  *
  * @return {Boolean}
  */
diff --git a/test/helper/index.js b/test/helper/index.js
index 58902959..10bfdd8d 100644
--- a/test/helper/index.js
+++ b/test/helper/index.js
@@ -142,7 +142,7 @@ export function bootstrapBpmnJS(BpmnJS, diagram, options, locals) {
  *
  * });
  *
- * @param  {String} xml document to display
+ * @param  {string} xml document to display
  * @param  {Object} (options) optional options to be passed to the diagram upon instantiation
  * @param  {Object|Function} locals  the local overrides to be used by the diagram or a function that produces them
  * @return {Function}         a function to be passed to beforeEach
@@ -170,7 +170,7 @@ export function bootstrapModeler(diagram, options, locals) {
  *
  * });
  *
- * @param  {String} xml document to display
+ * @param  {string} xml document to display
  * @param  {Object} (options) optional options to be passed to the diagram upon instantiation
  * @param  {Object|Function} locals  the local overrides to be used by the diagram or a function that produces them
  * @return {Function}         a function to be passed to beforeEach
diff --git a/test/integration/custom-elements/CustomElementFactory.js b/test/integration/custom-elements/CustomElementFactory.js
index 5d42b9f9..c31ceacf 100644
--- a/test/integration/custom-elements/CustomElementFactory.js
+++ b/test/integration/custom-elements/CustomElementFactory.js
@@ -61,7 +61,7 @@ CustomElementFactory.$inject = [ 'injector' ];
  *   return shapes[type];
  *
  *
- * @param  {String} type
+ * @param  {string} type
  *
  * @return {Bounds} { width, height}
  */
diff --git a/test/spec/draw/BpmnRendererSpec.js b/test/spec/draw/BpmnRendererSpec.js
index 46d50c25..535fb9e9 100644
--- a/test/spec/draw/BpmnRendererSpec.js
+++ b/test/spec/draw/BpmnRendererSpec.js
@@ -416,8 +416,8 @@ describe('draw - bpmn renderer', function() {
        *
        * @param {djs.model.base} element - Element.
        * @param {SVG} gfx - Graphics of element.
-       * @param {String} fillColor - Fill color to expect.
-       * @param {String} strokeColor - Stroke color to expect.
+       * @param {string} fillColor - Fill color to expect.
+       * @param {string} strokeColor - Stroke color to expect.
        */
       function expectColors(element, gfx, fillColor, strokeColor) {
         var djsVisual = domQuery('.djs-visual', gfx);
diff --git a/test/spec/features/copy-paste/BpmnCopyPasteSpec.js b/test/spec/features/copy-paste/BpmnCopyPasteSpec.js
index 0fe2f3fd..2d3e96d1 100644
--- a/test/spec/features/copy-paste/BpmnCopyPasteSpec.js
+++ b/test/spec/features/copy-paste/BpmnCopyPasteSpec.js
@@ -834,7 +834,7 @@ describe('features/copy-paste', function() {
 /**
  * Integration test involving copying, pasting, moving, undoing and redoing.
  *
- * @param {String|Array} elementIds
+ * @param {string|Array} elementIds
  */
 function integrationTest(elementIds) {
   if (!isArray(elementIds)) {
@@ -1000,7 +1000,7 @@ function _findDescriptorsInTree(elements, tree, depth) {
 /**
  * Copy elements.
  *
- * @param {Array