@roqua/quby-frontend 0.10.10 → 0.10.12

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.
@@ -11,6 +11,7 @@ export declare class Calculations {
11
11
  [key: string]: string | number | boolean | null;
12
12
  };
13
13
  constructor(sexpVariables: ISexpVariables, response: Response);
14
+ getResult(key: string): string | number | boolean | null;
14
15
  handleValueChanged(key: string): void;
15
16
  calculate(calculation: ICalculation): string | number | null | boolean;
16
17
  calculateNumber: (calculation: INumberCalculation) => number | null;
@@ -264,6 +264,10 @@ export interface IVisibilityConditionFlagEqual {
264
264
  flagKey: string;
265
265
  triggerOn: boolean;
266
266
  }
267
+ export interface IVisibilitySexpVariableTrue {
268
+ type: "sexp_variable_true";
269
+ sexpKey: string;
270
+ }
267
271
  export interface IVisibilityThenShow {
268
272
  type: "show_question";
269
273
  fieldKey: string;
@@ -272,7 +276,7 @@ export interface IVisibilityThenHide {
272
276
  type: "hide_question";
273
277
  fieldKey: string;
274
278
  }
275
- export type VisibilityIf = IVisibilityIfEqual | IVisibilityNumericCompare | IVisibilityIfContains | IVisibilityConditionAlways | IVisibilityConditionFlagEqual | IVisibilityConditionAnswered;
279
+ export type VisibilityIf = IVisibilityIfEqual | IVisibilityNumericCompare | IVisibilityIfContains | IVisibilityConditionAlways | IVisibilityConditionFlagEqual | IVisibilityConditionAnswered | IVisibilitySexpVariableTrue;
276
280
  export type VisibilityThen = IVisibilityThenShow | IVisibilityThenHide;
277
281
  export interface IVisibilityRule {
278
282
  condition: VisibilityIf;
@@ -320,6 +324,7 @@ export type IBooleanCalculation = ICalcComparer | ICalcBooleanReducer;
320
324
  export type ICalculation = INumberCalculation | IBooleanCalculation | ICalcStringValue;
321
325
  export type ISexpVariables = {
322
326
  [key: string]: {
327
+ type: "number" | "boolean" | "string";
323
328
  calculation: ICalculation;
324
329
  };
325
330
  };
@@ -64,6 +64,7 @@ export declare class Response {
64
64
  activeQuestionKey: string | null;
65
65
  calculations: Calculations;
66
66
  constructor(questionnaire: Questionnaire, answer: IAnswerFromServer);
67
+ cleanValue(key: string): IValue;
67
68
  cleanValues(): IValues;
68
69
  onChange(callback: IChangeCallback): void;
69
70
  offChange(callback: IChangeCallback): void;
@@ -9,7 +9,8 @@ interface IAction {
9
9
  export declare class VisibilityRule {
10
10
  private condition;
11
11
  private action;
12
- constructor(condition: ICondition, action: IAction);
12
+ readonly questionKey: string;
13
+ constructor(condition: ICondition, action: IAction, questionKey: string);
13
14
  runAgainst(response: Response): void;
14
15
  }
15
16
  export declare function buildVisibilityRule(rule: IVisibilityRule): VisibilityRule;