@rkmodules/rules 0.0.90 → 0.0.91

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.
@@ -17,17 +17,18 @@ interface ExecutionContext {
17
17
  timings: Record<string, number>;
18
18
  activations: Record<string, boolean>;
19
19
  }
20
- interface EngineEvent {
20
+ interface EngineStartEvent {
21
21
  name: string;
22
22
  inputs: Record<string, Tree<any>>;
23
23
  params: Record<string, any>;
24
- outputs?: Record<string, Tree<any>>;
25
24
  executionId: string;
26
25
  context: ExecutionContext;
27
- result?: RecOfTrees;
28
26
  startTime: number;
29
- endTime?: number;
30
- duration?: number;
27
+ }
28
+ interface EngineEndEvent extends EngineStartEvent {
29
+ result: RecOfTrees;
30
+ endTime: number;
31
+ duration: number;
31
32
  }
32
33
  export declare class Engine {
33
34
  private fnIndex;
@@ -40,14 +41,20 @@ export declare class Engine {
40
41
  private runGraph;
41
42
  /**
42
43
  * creates an function that can be evaluated by calling its implementation
44
+ * and registers it in the function index
43
45
  * @param node
44
46
  * @returns
45
47
  */
46
48
  build(node: AnyFunction, id?: string): PrimitiveFunction;
47
49
  mount(node: PrimitiveFunction): void | (() => void) | undefined;
48
- subscribe(eventName: string, listener: (event: EngineEvent) => void): () => void;
49
- fireEvent(eventName: string, event: EngineEvent): void;
50
+ subscribe(eventName: "result", listener: (event: EngineEndEvent) => void): () => void;
51
+ subscribe(eventName: "functionCall", listener: (event: EngineStartEvent) => void): () => void;
52
+ subscribe(eventName: "functionResult", listener: (event: EngineEndEvent) => void): () => void;
53
+ fireEvent(eventName: "result", event: EngineEndEvent): void;
54
+ fireEvent(eventName: "functionCall", event: EngineStartEvent): void;
55
+ fireEvent(eventName: "functionResult", event: EngineEndEvent): void;
50
56
  run(node: AnyFunction, inputs?: VarRef): any;
57
+ runDetailed(node: AnyFunction, inputs: VarRef): Promise<EngineEndEvent>;
51
58
  getFunction(name: string): PrimitiveFunction | undefined;
52
59
  applyNodeDelete(oldFn: GraphedFunction, nodeIds: string[]): GraphedFunction;
53
60
  applyEdgeDelete(oldFn: GraphedFunction, fromNode: string, toNode: string, fromField: string, toField: string): GraphedFunction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rkmodules/rules",
3
- "version": "0.0.90",
3
+ "version": "0.0.91",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",