chartmind 1.0.3 → 1.0.4

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/README.md CHANGED
@@ -68,7 +68,7 @@ Now, implement your classes and register them in the registry. Then you can star
68
68
  import { ChartContext, Executable } from 'chartmind';
69
69
 
70
70
  export class IncrementCounter implements Executable {
71
- async execute(chartContext: ChartContext): Promise<void> {
71
+ execute(chartContext: ChartContext): void {
72
72
  const counter = chartContext.getVariable('counter') as number;
73
73
  chartContext.setVariable('counter', counter + 1);
74
74
  }
@@ -10,9 +10,13 @@ class ProcessAction extends base_action_1.BaseAction {
10
10
  const Executable = executable_registry_1.ExecutableRegistry.instance.getExecutableByName(executableName);
11
11
  if (Executable) {
12
12
  const instance = new Executable();
13
- return instance.execute(chartContext);
13
+ const result = instance.execute(chartContext);
14
+ if (result instanceof Promise) {
15
+ await result;
16
+ }
14
17
  }
15
18
  // console.log(`SymbolProcess ${this.symbol.label} executed.`);
19
+ return;
16
20
  }
17
21
  getNext() {
18
22
  const connection = this.chart.getConnectionBySourceId(this.symbol.id);
@@ -1 +1 @@
1
- {"version":3,"file":"process-action.js","sourceRoot":"","sources":["../../../../src/engine/actions/process-action.ts"],"names":[],"mappings":";;;AACA,+CAAyC;AAEzC,yEAAmE;AAGnE,MAAa,aAAc,SAAQ,wBAAU;IACpC,KAAK,CAAC,OAAO,CAAC,YAA0B;QAC7C,MAAM,aAAa,GAAG,IAAI,CAAC,MAAuB,CAAC;QACnD,MAAM,cAAc,GAAG,aAAa,CAAC,UAAU,CAAC;QAChD,MAAM,UAAU,GACd,wCAAkB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAElE,IAAI,UAAU,EAAE;YACd,MAAM,QAAQ,GAAG,IAAI,UAAU,EAAE,CAAC;YAClC,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;SACvC;QAED,+DAA+D;IACjE,CAAC;IAEM,OAAO;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CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;CACF;AA7BD,sCA6BC"}
@@ -0,0 +1,16 @@
1
+ import { ChartContext } from '../engine/chart/context/chart-context';
2
+ /**
3
+ * Represents an async executable action that can be performed within a chart context.
4
+ *
5
+ * @interface ExecutableAsync
6
+ * @remarks
7
+ * Implement this interface to define custom actions that operate on a given {@link ChartContext}.
8
+ *
9
+ * @method execute
10
+ * Executes the action using the provided chart context.
11
+ * @param chartContext - The context in which the action should be executed.
12
+ * @returns A promise that resolves when the execution is complete.
13
+ */
14
+ export interface ExecutableAsync {
15
+ execute(chartContext: ChartContext): Promise<void>;
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=executable-async.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executable-async.interface.js","sourceRoot":"","sources":["../../../src/interfaces/executable-async.interface.ts"],"names":[],"mappings":""}
@@ -9,8 +9,8 @@ import { ChartContext } from '../engine/chart/context/chart-context';
9
9
  * @method execute
10
10
  * Executes the action using the provided chart context.
11
11
  * @param chartContext - The context in which the action should be executed.
12
- * @returns A promise that resolves when the execution is complete.
12
+ * @returns Returns nothing or a Promise that resolves when the action is complete.
13
13
  */
14
14
  export interface Executable {
15
- execute(chartContext: ChartContext): Promise<void>;
15
+ execute(chartContext: ChartContext): void | Promise<void>;
16
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chartmind",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Flowchart execution engine for drawio charts",
5
5
  "main": "build/src/index.js",
6
6
  "module": "build/src/index.js",