fix: fix remaining JSDoc and TS errors

This commit is contained in:
Philipp
2023-04-13 16:15:19 +02:00
committed by Philipp Fromme
parent 7c089d0023
commit 07f75f7cd5
30 changed files with 921 additions and 225 deletions

View File

@ -3,7 +3,7 @@ import { getAnchorPointAdjustment } from './LayoutUtil';
/**
* @typedef {import('diagram-js/lib/util/Types').Point} Point
*
* @typedef {import('./LayoutUtil').FindNewLintStartIndexHints} FindNewLintStartIndexHints
* @typedef {import('./LayoutUtil').FindNewLineStartIndexHints} FindNewLineStartIndexHints
*/
/**
@ -12,7 +12,7 @@ import { getAnchorPointAdjustment } from './LayoutUtil';
* @param {Point} position
* @param {Point[]} newWaypoints
* @param {Point[]} oldWaypoints
* @param {FindNewLintStartIndexHints} hints
* @param {FindNewLineStartIndexHints} hints
*
* @return {Point}
*/

View File

@ -5,14 +5,18 @@ import { getMid } from 'diagram-js/lib/layout/LayoutUtil';
/**
* @typedef {import('./LineAttachmentUtil').Attachment} Attachment
*
* @typedef {import('./LayoutUtil').FindNewLintStartIndexHints} FindNewLintStartIndexHints
* @typedef {import('./LayoutUtil').FindNewLineStartIndexHints} FindNewLineStartIndexHints
*
* @typedef {import('../../../../model/Types').BpmnLabel} BpmnLabel
*
* @typedef {import('diagram-js/lib/util/Types').Point} Point
*/
/**
* @param {Point[]} oldWaypoints
* @param {Point[]} newWaypoints
* @param {Attachment} attachment
* @param {FindNewLintStartIndexHints} hints
* @param {FindNewLineStartIndexHints} hints
*
* @return {number}
*/
@ -27,7 +31,7 @@ export function findNewLabelLineStartIndex(oldWaypoints, newWaypoints, attachmen
* @param {BpmnLabel} label
* @param {Point[]} newWaypoints
* @param {Point[]} oldWaypoints
* @param {FindNewLintStartIndexHints} hints
* @param {FindNewLineStartIndexHints} hints
*
* @return {Point}
*/

View File

@ -22,7 +22,7 @@ import {
* delta: Point;
* } } AnchorPointAdjustment
*
* @param { {
* @typedef { {
* segmentMove?: {
* segmentStartIndex: number;
* newSegmentStartIndex: number;
@ -33,14 +33,14 @@ import {
* };
* connectionStart: boolean;
* connectionEnd: boolean;
* } } FindNewLintStartIndexHints
* } } FindNewLineStartIndexHints
*/
/**
* @param {Point[]} oldWaypoints
* @param {Point[]} newWaypoints
* @param {Attachment} attachment
* @param {FindNewLintStartIndexHints} hints
* @param {FindNewLineStartIndexHints} hints
*
* @return {number}
*/
@ -131,7 +131,7 @@ export function findNewLineStartIndex(oldWaypoints, newWaypoints, attachment, hi
* @param {Point} position
* @param {Point[]} newWaypoints
* @param {Point[]} oldWaypoints
* @param {FindNewLintStartIndexHints} hints
* @param {FindNewLineStartIndexHints} hints
*
* @return {AnchorPointAdjustment} result
*/

View File

@ -1,20 +1,20 @@
/**
* @typedef {import('diagram-js/lib/util/Types').Point} Point
*
* @typedef { {
* type: 'bendpoint' | 'segment';
* position: Point;
* segmentIndex: number;
* bendpointIndex?: number;
* relativeLocation?: number;
* } } Attachment
*/
var sqrt = Math.sqrt,
min = Math.min,
max = Math.max,
abs = Math.abs;
/**
* @typedef {import('../../../../util/Types').Point} Point
*
* @typedef { {
* type: 'bendpoint' | 'segment';
* position: Point;
* segmentIndex: number;
* bendpointIndex?: number;
* relativeLocation?: number;
* } } Attachment
*/
/**
* Calculate the square (power to two) of a number.
*

View File

@ -1,3 +1,7 @@
/**
* @typedef {import('diagram-js/lib/util/Types').Point} Point
*/
/**
* Returns the intersection between two line segments a and b.
*

View File

@ -61,6 +61,7 @@ UpdateCanvasRootHandler.prototype.execute = function(context) {
// TODO(nikku): return changed elements?
// return [ newRoot, oldRoot ];
return [];
};
@ -94,4 +95,6 @@ UpdateCanvasRootHandler.prototype.revert = function(context) {
// TODO(nikku): return changed elements?
// return [ newRoot, oldRoot ];
return [];
};

View File

@ -184,6 +184,8 @@ UpdateFlowNodeRefsHandler.prototype.execute = function(context) {
// TODO(nikku): return changed elements
// return [ ... ];
return [];
};
@ -211,4 +213,6 @@ UpdateFlowNodeRefsHandler.prototype.revert = function(context) {
// TODO(nikku): return changed elements
// return [ ... ];
return [];
};

View File

@ -30,6 +30,8 @@ UpdateSemanticParentHandler.prototype.execute = function(context) {
// update DI parent
this._bpmnUpdater.updateDiParent(dataStoreDi, newDiParent);
return [];
};
UpdateSemanticParentHandler.prototype.revert = function(context) {
@ -43,5 +45,7 @@ UpdateSemanticParentHandler.prototype.revert = function(context) {
// update DI parent
this._bpmnUpdater.updateDiParent(dataStoreDi, oldDiParent);
return [];
};