Skip to content

Commit

Permalink
fix(LaneUtil): fix JSDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme committed Apr 6, 2023
1 parent 8280977 commit 6601166
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions lib/features/modeling/util/LaneUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ import {
resizeTRBL
} from 'diagram-js/lib/features/resize/ResizeUtil';

/**
* @typedef {import('../../../model/Types').BpmnShape} BpmnShape
*
* @typedef {import('diagram-js/lib/util/Types').Rect} Rect
*/

var abs = Math.abs;


Expand All @@ -31,12 +37,12 @@ export var LANE_INDENTATION = 30;


/**
* Collect all lane shapes in the given paren
* Return all lanes that are children of the given shape.
*
* @param {djs.model.Shape} shape
* @param {Array<djs.model.Base>} [collectedShapes]
* @param {BpmnShape} shape
* @param {BpmnShape[]} [collectedShapes]
*
* @return {Array<djs.model.Base>}
* @return {BpmnShape[]}
*/
export function collectLanes(shape, collectedShapes) {

Expand All @@ -55,11 +61,11 @@ export function collectLanes(shape, collectedShapes) {


/**
* Return the lane children of the given element.
* Return all lanes that are direct children of the given shape.
*
* @param {djs.model.Shape} shape
* @param {BpmnShape} shape
*
* @return {Array<djs.model.Shape>}
* @return {BpmnShape[]}
*/
export function getChildLanes(shape) {
return shape.children.filter(function(c) {
Expand All @@ -69,11 +75,11 @@ export function getChildLanes(shape) {


/**
* Return the root element containing the given lane shape
* Return the parent shape of the given lane.
*
* @param {djs.model.Shape} shape
* @param {BpmnShape} shape
*
* @return {djs.model.Shape}
* @return {BpmnShape}
*/
export function getLanesRoot(shape) {
return getParent(shape, LANE_PARENTS) || shape;
Expand All @@ -85,10 +91,13 @@ export function getLanesRoot(shape) {
* adjacent to the given shape, assuming it will be
* resized to the given new bounds.
*
* @param {djs.model.Shape} shape
* @param {Bounds} newBounds
* @param {BpmnShape} shape
* @param {Rect} newBounds
*
* @return {Array<Object>}
* @return { {
* shape: BpmnShape;
* newBounds: Rect;
* }[] }
*/
export function computeLanesResize(shape, newBounds) {

Expand Down

0 comments on commit 6601166

Please sign in to comment.