@kemu-io/edge-runtime 1.0.3 → 1.2.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kemu-io/edge-runtime",
3
3
  "type": "module",
4
- "version": "1.0.3",
4
+ "version": "1.2.0",
5
5
  "description": "Kemu Edge runtime for running Kemu recipes",
6
6
  "author": "Kemu Pty Ltd",
7
7
  "main": "runner.js",
package/runner.d.ts CHANGED
@@ -114,7 +114,8 @@ declare enum WidgetType {
114
114
  note = "note",
115
115
  stringify = "stringify",
116
116
  templateString = "templateString",
117
- expressionEval = "expressionEval"
117
+ expressionEval = "expressionEval",
118
+ rescue = "rescue"
118
119
  }
119
120
  export type VariableDefinition = {
120
121
  /**
@@ -133,13 +134,15 @@ export type VariableDefinition = {
133
134
  storeValueInRecipe: boolean;
134
135
  /** the id of the widget that registered the variable */
135
136
  createdByWidgetId: string;
136
- /** indicates if the variable is a reference to a widget's custom field */
137
- isCustomFieldVar: boolean;
137
+ /** indicates if the variable is a reference to a widget's UI element */
138
+ isUIElement: boolean;
138
139
  /** the current value of the variable */
139
140
  value?: SupportedTypes;
140
141
  };
141
- export type VarValueChangeEvt = Readonly<Pick<VariableDefinition, "type" | "value"> & {
142
+ export type VarValueChangeEvt = Readonly<Pick<VariableDefinition, "type" | "value" | "isUIElement"> & {
142
143
  varName: string;
144
+ setByWidgetType: WidgetType;
145
+ setByWidgetId: string;
143
146
  }>;
144
147
  export type SendToInputWidgetFn = (inputName: string, data: PartialData | number | string | boolean | Array<any>) => Promise<void>;
145
148
  export declare const utils: {
@@ -202,7 +205,7 @@ declare const _default: {
202
205
  * @param cb the callback function to be invoked.
203
206
  * @returns a function to remove the listener.
204
207
  */
205
- onVariableChange: (varName: string, cb: (evt: VarValueChangeEvt) => void | Promise<void>) => () => void;
208
+ onVariableChange: (varName: string, cb: (evt: Omit<VarValueChangeEvt, "isUIElement">) => void | Promise<void>) => import("emittery").UnsubscribeFunction;
206
209
  };
207
210
 
208
211
  export {