@logicflow/core 1.2.0-alpha.13 → 1.2.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logicflow/core",
3
- "version": "1.2.0-alpha.13",
3
+ "version": "1.2.0-alpha.14",
4
4
  "description": "LogicFlow core, to quickly build flowchart editor",
5
5
  "main": "dist/entry.js",
6
6
  "unpkg": "dist/logic-flow.min.js",
@@ -0,0 +1,11 @@
1
+ import { Point, Vector2 } from '../type';
2
+ /**
3
+ * 基于两个点创建一个向量
4
+ * https://stackoverflow.com/questions/15823021/when-to-use-float32array-instead-of-array-in-javascript
5
+ * 由于大多数情况下LogicFlow连线是水平和垂直的,因此先不考虑。
6
+ */
7
+ export declare const createVector: (point1: Point, point2: any) => Vector2;
8
+ /**
9
+ * 判断两个向量是否平行
10
+ */
11
+ export declare const isParallel: (vector1: Vector2, vector2: Vector2) => Boolean;
@@ -31,6 +31,7 @@ export declare type Point = {
31
31
  y: number;
32
32
  [key: string]: unknown;
33
33
  };
34
+ export declare type Vector2 = [number, number];
34
35
  /**
35
36
  * 锚点坐标
36
37
  * 为了方便计算