@rkmodules/rules 0.0.90 → 0.0.92
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.cjs.js +35 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +35 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/Engine/index.d.ts +14 -7
- package/package.json +1 -1
|
@@ -17,17 +17,18 @@ interface ExecutionContext {
|
|
|
17
17
|
timings: Record<string, number>;
|
|
18
18
|
activations: Record<string, boolean>;
|
|
19
19
|
}
|
|
20
|
-
interface
|
|
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
|
-
|
|
30
|
-
|
|
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:
|
|
49
|
-
|
|
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;
|