LayoutUtil.d.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * @param oldWaypoints
  3. * @param newWaypoints
  4. * @param attachment
  5. * @param hints
  6. *
  7. * @return
  8. */
  9. export function findNewLineStartIndex(
  10. oldWaypoints: Point[],
  11. newWaypoints: Point[],
  12. attachment: Attachment,
  13. hints: FindNewLineStartIndexHints
  14. ): number;
  15. /**
  16. * Calculate the required adjustment (move delta) for the given point
  17. * after the connection waypoints got updated.
  18. *
  19. * @param position
  20. * @param newWaypoints
  21. * @param oldWaypoints
  22. * @param hints
  23. *
  24. * @return result
  25. */
  26. export function getAnchorPointAdjustment(position: Point, newWaypoints: Point[], oldWaypoints: Point[], hints: FindNewLineStartIndexHints): AnchorPointAdjustment;
  27. type Point = import('diagram-js/lib/util/Types').Point;
  28. type Attachment = import('./LineAttachmentUtil').Attachment;
  29. export type AnchorPointAdjustment = {
  30. point: Point;
  31. delta: Point;
  32. };
  33. export type FindNewLineStartIndexHints = {
  34. segmentMove?: {
  35. segmentStartIndex: number;
  36. newSegmentStartIndex: number;
  37. };
  38. bendpointMove?: {
  39. insert: boolean;
  40. bendpointIndex: number;
  41. };
  42. connectionStart: boolean;
  43. connectionEnd: boolean;
  44. };