@openframe-org/criteria-set-protocol 1.0.45 → 1.0.47

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.
@@ -72,14 +72,15 @@ export type TaskGroup = BaseElement<'task-group'> & {
72
72
  export type Task = BaseElement<'task'> & {
73
73
  description?: string;
74
74
  items: TaskItem[];
75
+ itemGroups?: string[][];
75
76
  };
76
77
  export type TaskItem = Omit<BaseElement<'task-item'>, 'title'> & {
77
- definitions: TaskItemDefinition[];
78
+ definition: TaskItemDefinition;
79
+ description?: string;
78
80
  providedData?: Record<string, TaskItemValue>;
79
81
  };
80
82
  export type AbstractDefinition<Type extends 'select-single' | 'select-multiple' | 'number' | 'boolean'> = {
81
83
  type: Type;
82
- description?: string;
83
84
  };
84
85
  export type SelectSingleType = AbstractDefinition<'select-single'> & {
85
86
  options: PointOption[];
@@ -101,6 +102,6 @@ export type PointOption = {
101
102
  export type TaskItemScalarValue = string | number | boolean | null;
102
103
  export type TaskItemValue = TaskItemScalarValue | Array<TaskItemScalarValue>;
103
104
  export type TaskItemDefinition = SelectSingleType | SelectMultipleType | NumberType | BooleanType;
104
- export type CriteriaTreeElement = Criterion | TaskGroup | Task | TaskItem;
105
+ export type CriteriaTreeElement = Quality | Criterion | TaskGroup | Task | TaskItem;
105
106
  export type CriteriaTreeElementType = 'quality' | 'criterion' | 'task-group' | 'task' | 'task-item';
106
107
  export {};
@@ -1,4 +1,5 @@
1
- import { CriteriaTreeElement, Criterion, Task, TaskGroup, TaskItem } from './types';
1
+ import { CriteriaTreeElement, Quality, Criterion, Task, TaskGroup, TaskItem } from './types';
2
+ export declare const isQuality: (element: CriteriaTreeElement) => element is Quality;
2
3
  export declare const isCriterion: (element: CriteriaTreeElement) => element is Criterion;
3
4
  export declare const isTaskGroup: (element: CriteriaTreeElement) => element is TaskGroup;
4
5
  export declare const isTask: (element: CriteriaTreeElement) => element is Task;
package/dist/v1/utils.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTaskItem = exports.isTask = exports.isTaskGroup = exports.isCriterion = void 0;
3
+ exports.isTaskItem = exports.isTask = exports.isTaskGroup = exports.isCriterion = exports.isQuality = void 0;
4
+ const isQuality = (element) => element.type === 'quality';
5
+ exports.isQuality = isQuality;
4
6
  const isCriterion = (element) => element.type === 'criterion';
5
7
  exports.isCriterion = isCriterion;
6
8
  const isTaskGroup = (element) => element.type === 'task-group';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openframe-org/criteria-set-protocol",
3
- "version": "1.0.45",
3
+ "version": "1.0.47",
4
4
  "description": "A protocol and tools for defining and working with criteria sets",
5
5
  "private": false,
6
6
  "author": "Andrés Angulo <aa@openframe.org>",