@rkmodules/rules 0.0.98 → 0.0.100

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.
@@ -40,8 +40,10 @@ export declare function broadCast<T>(value: T | T[] | Tree<T>): Tree<T>;
40
40
  export declare function getBranch<T>(tree: Tree<T>, path: string): T[] | void;
41
41
  export declare function getBranches<T>(tree: Tree<T>): T[][];
42
42
  export declare function getPaths<T>(tree: Tree<T>): string[];
43
+ export declare function getItem<T>(tree: Tree<T>, path: string, index: number): T | void;
43
44
  export declare function forEachBranch<T>(tree: Tree<T>, fn: (branch: T[], path: string, index: number) => void): void;
44
45
  export declare function forEachItem<T>(tree: Tree<T>, fn: (item: T, path: string, pathIndex: number, index: number) => void): void;
46
+ export declare function pushItem<T>(tree: Tree<T>, path: string, item: T): void;
45
47
  /**
46
48
  * maps a tree, the tree branches are flatmapped, so if an array is returned for each item in the list, a flat list is returned
47
49
  * @param tree
@@ -12,12 +12,12 @@ export interface Ref {
12
12
  export declare function normalizeVarDef(varDef: VarDef): NormalizedVarDef;
13
13
  export declare function getReferences(inputs: VarRef): Ref[];
14
14
  export declare function topSort(fn: GraphedFunction): GraphedFunction;
15
- interface ExecutionContext {
15
+ export interface ExecutionContext {
16
16
  scope: Record<string, Record<string, Tree<any>>>;
17
17
  timings: Record<string, number>;
18
18
  activations: Record<string, boolean>;
19
19
  }
20
- interface EngineStartEvent {
20
+ export interface EngineStartEvent {
21
21
  name: string;
22
22
  inputs: Record<string, Tree<any>>;
23
23
  params: Record<string, any>;
@@ -25,11 +25,13 @@ interface EngineStartEvent {
25
25
  context: ExecutionContext;
26
26
  startTime: number;
27
27
  }
28
- interface EngineEndEvent extends EngineStartEvent {
28
+ export interface EngineEndEvent extends EngineStartEvent {
29
29
  result: RecOfTrees;
30
30
  endTime: number;
31
31
  duration: number;
32
32
  }
33
+ export type EngineEvent = EngineStartEvent | EngineEndEvent;
34
+ export type EngineEventName = "result" | "functionCall" | "functionResult";
33
35
  export declare class Engine {
34
36
  private fnIndex;
35
37
  private listeners;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rkmodules/rules",
3
- "version": "0.0.98",
3
+ "version": "0.0.100",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",