@flowgram.ai/document 0.2.22 → 0.2.24

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/dist/index.d.mts CHANGED
@@ -366,9 +366,15 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
366
366
  /**
367
367
  * Check node extend
368
368
  * @param currentType
369
- * @param parentType
369
+ * @param extendType
370
370
  */
371
- isExtend(currentType: FlowNodeType, parentType: FlowNodeType): boolean;
371
+ isExtend(currentType: FlowNodeType, extendType: FlowNodeType): boolean;
372
+ /**
373
+ * Check node type
374
+ * @param currentType
375
+ * @param extendType
376
+ */
377
+ isTypeOrExtendType(currentType: FlowNodeType, extendType: FlowNodeType): boolean;
372
378
  /**
373
379
  * 导出数据,可以重载
374
380
  */
@@ -770,6 +776,15 @@ declare class FlowNodeEntity extends Entity<FlowNodeEntityConfig> {
770
776
  * 获取节点的位置及大小矩形
771
777
  */
772
778
  get bounds(): Rectangle;
779
+ /**
780
+ * Check node extend type
781
+ */
782
+ isExtend(parentType: FlowNodeType): boolean;
783
+ /**
784
+ * Check node type
785
+ * @param parentType
786
+ */
787
+ isTypeOrExtendType(parentType: FlowNodeType): boolean;
773
788
  }
774
789
  declare namespace FlowNodeEntity {
775
790
  function is(obj: Entity): obj is FlowNodeEntity;
@@ -1242,7 +1257,9 @@ declare enum FlowNodeBaseType {
1242
1257
  MULTI_INPUTS = "multiInputs",
1243
1258
  MULTI_OUTPUTS = "multiOutputs",
1244
1259
  INPUT = "input",
1245
- OUTPUT = "output"
1260
+ OUTPUT = "output",
1261
+ SLOT = "slot",
1262
+ SLOT_BLOCK = "slotBlock"
1246
1263
  }
1247
1264
  declare enum FlowNodeSplitType {
1248
1265
  SIMPLE_SPLIT = "simpleSplit",
package/dist/index.d.ts CHANGED
@@ -366,9 +366,15 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
366
366
  /**
367
367
  * Check node extend
368
368
  * @param currentType
369
- * @param parentType
369
+ * @param extendType
370
370
  */
371
- isExtend(currentType: FlowNodeType, parentType: FlowNodeType): boolean;
371
+ isExtend(currentType: FlowNodeType, extendType: FlowNodeType): boolean;
372
+ /**
373
+ * Check node type
374
+ * @param currentType
375
+ * @param extendType
376
+ */
377
+ isTypeOrExtendType(currentType: FlowNodeType, extendType: FlowNodeType): boolean;
372
378
  /**
373
379
  * 导出数据,可以重载
374
380
  */
@@ -770,6 +776,15 @@ declare class FlowNodeEntity extends Entity<FlowNodeEntityConfig> {
770
776
  * 获取节点的位置及大小矩形
771
777
  */
772
778
  get bounds(): Rectangle;
779
+ /**
780
+ * Check node extend type
781
+ */
782
+ isExtend(parentType: FlowNodeType): boolean;
783
+ /**
784
+ * Check node type
785
+ * @param parentType
786
+ */
787
+ isTypeOrExtendType(parentType: FlowNodeType): boolean;
773
788
  }
774
789
  declare namespace FlowNodeEntity {
775
790
  function is(obj: Entity): obj is FlowNodeEntity;
@@ -1242,7 +1257,9 @@ declare enum FlowNodeBaseType {
1242
1257
  MULTI_INPUTS = "multiInputs",
1243
1258
  MULTI_OUTPUTS = "multiOutputs",
1244
1259
  INPUT = "input",
1245
- OUTPUT = "output"
1260
+ OUTPUT = "output",
1261
+ SLOT = "slot",
1262
+ SLOT_BLOCK = "slotBlock"
1246
1263
  }
1247
1264
  declare enum FlowNodeSplitType {
1248
1265
  SIMPLE_SPLIT = "simpleSplit",
package/dist/index.js CHANGED
@@ -92,6 +92,8 @@ var FlowNodeBaseType = /* @__PURE__ */ ((FlowNodeBaseType2) => {
92
92
  FlowNodeBaseType2["MULTI_OUTPUTS"] = "multiOutputs";
93
93
  FlowNodeBaseType2["INPUT"] = "input";
94
94
  FlowNodeBaseType2["OUTPUT"] = "output";
95
+ FlowNodeBaseType2["SLOT"] = "slot";
96
+ FlowNodeBaseType2["SLOT_BLOCK"] = "slotBlock";
95
97
  return FlowNodeBaseType2;
96
98
  })(FlowNodeBaseType || {});
97
99
  var FlowNodeSplitType = /* @__PURE__ */ ((FlowNodeSplitType2) => {
@@ -1122,6 +1124,19 @@ var FlowNodeEntity = class extends import_core4.Entity {
1122
1124
  get bounds() {
1123
1125
  return this.transform.bounds;
1124
1126
  }
1127
+ /**
1128
+ * Check node extend type
1129
+ */
1130
+ isExtend(parentType) {
1131
+ return this.document.isExtend(this.flowNodeType, parentType);
1132
+ }
1133
+ /**
1134
+ * Check node type
1135
+ * @param parentType
1136
+ */
1137
+ isTypeOrExtendType(parentType) {
1138
+ return this.document.isTypeOrExtendType(this.flowNodeType, parentType);
1139
+ }
1125
1140
  };
1126
1141
  FlowNodeEntity.type = "FlowNodeEntity";
1127
1142
  ((FlowNodeEntity2) => {
@@ -2006,10 +2021,18 @@ var FlowDocument = class {
2006
2021
  /**
2007
2022
  * Check node extend
2008
2023
  * @param currentType
2009
- * @param parentType
2024
+ * @param extendType
2025
+ */
2026
+ isExtend(currentType, extendType) {
2027
+ return (this.getNodeRegistry(currentType).__extends__ || []).includes(extendType);
2028
+ }
2029
+ /**
2030
+ * Check node type
2031
+ * @param currentType
2032
+ * @param extendType
2010
2033
  */
2011
- isExtend(currentType, parentType) {
2012
- return (this.getNodeRegistry(currentType).__extends__ || []).includes(parentType);
2034
+ isTypeOrExtendType(currentType, extendType) {
2035
+ return currentType === extendType || this.isExtend(currentType, extendType);
2013
2036
  }
2014
2037
  /**
2015
2038
  * 导出数据,可以重载