@flowgram.ai/document 0.1.4 → 0.1.6

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
@@ -316,6 +316,11 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
316
316
  * 导出数据,可以重载
317
317
  */
318
318
  toJSON(): T | any;
319
+ /**
320
+ * @deprecated
321
+ * use `getNodeRegistry` instead
322
+ */
323
+ getNodeRegister<T extends FlowNodeRegistry = FlowNodeRegistry>(type: FlowNodeType, originParent?: FlowNodeEntity): T;
319
324
  getNodeRegistry<T extends FlowNodeRegistry = FlowNodeRegistry>(type: FlowNodeType, originParent?: FlowNodeEntity): T;
320
325
  /**
321
326
  * 节点注入数据
@@ -613,6 +618,11 @@ declare class FlowNodeEntity extends Entity<FlowNodeEntityConfig> {
613
618
  get next(): FlowNodeEntity | undefined;
614
619
  get parent(): FlowNodeEntity | undefined;
615
620
  getNodeRegistry<M extends FlowNodeRegistry = FlowNodeRegistry>(): M;
621
+ /**
622
+ * @deprecated
623
+ * use getNodeRegistry instead
624
+ */
625
+ getNodeRegister<M extends FlowNodeRegistry = FlowNodeRegistry>(): M;
616
626
  getNodeMeta<M extends FlowNodeMeta = FlowNodeMeta>(): M & Required<FlowNodeMeta>;
617
627
  /**
618
628
  * 获取所有子节点,包含 child 及其所有兄弟节点
package/dist/index.d.ts CHANGED
@@ -316,6 +316,11 @@ declare class FlowDocument<T = FlowDocumentJSON> implements Disposable {
316
316
  * 导出数据,可以重载
317
317
  */
318
318
  toJSON(): T | any;
319
+ /**
320
+ * @deprecated
321
+ * use `getNodeRegistry` instead
322
+ */
323
+ getNodeRegister<T extends FlowNodeRegistry = FlowNodeRegistry>(type: FlowNodeType, originParent?: FlowNodeEntity): T;
319
324
  getNodeRegistry<T extends FlowNodeRegistry = FlowNodeRegistry>(type: FlowNodeType, originParent?: FlowNodeEntity): T;
320
325
  /**
321
326
  * 节点注入数据
@@ -613,6 +618,11 @@ declare class FlowNodeEntity extends Entity<FlowNodeEntityConfig> {
613
618
  get next(): FlowNodeEntity | undefined;
614
619
  get parent(): FlowNodeEntity | undefined;
615
620
  getNodeRegistry<M extends FlowNodeRegistry = FlowNodeRegistry>(): M;
621
+ /**
622
+ * @deprecated
623
+ * use getNodeRegistry instead
624
+ */
625
+ getNodeRegister<M extends FlowNodeRegistry = FlowNodeRegistry>(): M;
616
626
  getNodeMeta<M extends FlowNodeMeta = FlowNodeMeta>(): M & Required<FlowNodeMeta>;
617
627
  /**
618
628
  * 获取所有子节点,包含 child 及其所有兄弟节点
package/dist/index.js CHANGED
@@ -905,6 +905,13 @@ var FlowNodeEntity = class extends import_core4.Entity {
905
905
  this._registerCache = this.document.getNodeRegistry(this.flowNodeType, this.originParent);
906
906
  return this._registerCache;
907
907
  }
908
+ /**
909
+ * @deprecated
910
+ * use getNodeRegistry instead
911
+ */
912
+ getNodeRegister() {
913
+ return this.getNodeRegistry();
914
+ }
908
915
  getNodeMeta() {
909
916
  if (this._metaCache) return this._metaCache;
910
917
  if (this.metaFromJSON) {
@@ -1972,6 +1979,13 @@ var FlowDocument = class {
1972
1979
  nodes: this.root.toJSON().blocks
1973
1980
  };
1974
1981
  }
1982
+ /**
1983
+ * @deprecated
1984
+ * use `getNodeRegistry` instead
1985
+ */
1986
+ getNodeRegister(type, originParent) {
1987
+ return this.getNodeRegistry(type, originParent);
1988
+ }
1975
1989
  getNodeRegistry(type, originParent) {
1976
1990
  const typeKey = `${type}_${originParent?.flowNodeType || ""}`;
1977
1991
  if (this.nodeRegistryCache.has(typeKey)) {