Skip to content

Commit

Permalink
fix: fix remaining JSDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Apr 17, 2023
1 parent df1aedd commit ba7ec94
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
17 changes: 14 additions & 3 deletions lib/features/label-editing/cmd/UpdateLabelHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,27 @@ var NULL_DIMENSIONS = {
height: 0
};

/**
* @typedef {import('../../modeling/Modeling').default} Modeling
* @typedef {import('../../../draw/TextRenderer').default} TextRenderer
* @typedef {import('../../modeling/BpmnFactory').default} BpmnFactory
*
* @typedef {import('../../../model/Types').BpmnElement} BpmnElement
*/

/**
* A handler that updates the text of a BPMN element.
*
* @param {Modeling} modeling
* @param {TextRenderer} textRenderer
* @param {BpmnFactory} bpmnFactory
*/
export default function UpdateLabelHandler(modeling, textRenderer, bpmnFactory) {

/**
* Creates an empty `diLabel` attribute for embedded labels.
*
* @param {djs.model.Base} element
* @param {BpmnElement} element
* @param {string} text
*/
function ensureInternalLabelDi(element, text) {
Expand All @@ -54,7 +65,7 @@ export default function UpdateLabelHandler(modeling, textRenderer, bpmnFactory)
*
* Element parameter can be label itself or connection (i.e. sequence flow).
*
* @param {djs.model.Base} element
* @param {BpmnElement} element
* @param {string} text
*/
function setText(element, text) {
Expand Down Expand Up @@ -158,7 +169,7 @@ UpdateLabelHandler.$inject = [
];


// helpers ///////////////////////
// helpers //////////

function isEmptyText(label) {
return !label || !label.trim();
Expand Down
2 changes: 1 addition & 1 deletion lib/features/modeling/ElementFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ ElementFactory.prototype.createParticipantShape = function(attrs) {
*
* @param {Element} element
* @param {Object} attrs (in/out map of attributes)
* @param {Array<string>} attributeNames name of attributes to apply
* @param {string[]} attributeNames name of attributes to apply
*
* @return {Object} changed attrs
*/
Expand Down
2 changes: 1 addition & 1 deletion test/matchers/ConnectionMatchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function(chai, utils) {
*
* expect(connection).to.have.diWaypoints([ { x: 100, y: 100 }, { x: 0, y: 0 } ]);
*
* @param {Connection|Array<Point>} exp
* @param {Connection|Point[]} exp
*/
Assertion.addMethod('diWaypoints', function(exp) {
var obj = this._obj;
Expand Down
8 changes: 6 additions & 2 deletions test/spec/draw/BpmnRendererSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import {
getDi
} from 'lib/draw/BpmnRenderUtil';

/**
* @typedef {import('../../../lib/model/Types').BpmnElement} BpmnElement
*/

function checkErrors(err, warnings) {
expect(warnings).to.be.empty;
expect(err).not.to.exist;
Expand Down Expand Up @@ -495,8 +499,8 @@ describe('draw - bpmn renderer', function() {
/**
* Expect colors depending on element type.
*
* @param {djs.model.base} element - Element.
* @param {SVG} gfx - Graphics of element.
* @param {BpmnElement} element - Element.
* @param {SVGElement} gfx - Graphics of element.
* @param {string} fillColor - Fill color to expect.
* @param {string} strokeColor - Stroke color to expect.
*/
Expand Down
8 changes: 6 additions & 2 deletions test/spec/features/copy-paste/BpmnCopyPasteSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ import {
is
} from 'lib/util/ModelUtil';

/**
* @typedef {import('../../../../lib/model/Types').BpmnElement} BpmnElement
*/


describe('features/copy-paste', function() {

Expand Down Expand Up @@ -968,7 +972,7 @@ describe('features/copy-paste', function() {
/**
* Integration test involving copying, pasting, moving, undoing and redoing.
*
* @param {string|Array<string>} elementIds
* @param {string|string[]} elementIds
*/
function integrationTest(elementIds) {
if (!isArray(elementIds)) {
Expand Down Expand Up @@ -1134,7 +1138,7 @@ function _findDescriptorsInTree(elements, tree, depth) {
/**
* Copy elements.
*
* @param {Array<string|djs.model.Base} elements
* @param {(string|BpmnElement)[]} elements
*
* @returns {Object}
*/
Expand Down

0 comments on commit ba7ec94

Please sign in to comment.