@openframe-org/criteria-set-protocol 1.0.8 → 1.0.10
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/v1/types/criteria.d.ts +31 -6
- package/dist/v1/utils.d.ts +5 -0
- package/dist/v1/utils.js +11 -0
- package/package.json +1 -1
|
@@ -6,37 +6,60 @@ export type Metadata = {
|
|
|
6
6
|
description: string;
|
|
7
7
|
documentation?: string;
|
|
8
8
|
};
|
|
9
|
+
export type PdfDocumentationItem = {
|
|
10
|
+
type: 'pdf';
|
|
11
|
+
label: string;
|
|
12
|
+
url: string;
|
|
13
|
+
};
|
|
14
|
+
export type InlineDocumentationItem = {
|
|
15
|
+
type: 'text';
|
|
16
|
+
label?: string;
|
|
17
|
+
text: string;
|
|
18
|
+
};
|
|
19
|
+
export type LinkDocumentationItem = {
|
|
20
|
+
type: 'link';
|
|
21
|
+
label: string;
|
|
22
|
+
url: string;
|
|
23
|
+
};
|
|
24
|
+
export type DocumentationItem = PdfDocumentationItem | InlineDocumentationItem | LinkDocumentationItem;
|
|
9
25
|
export type CriteriaTree = Criterion[];
|
|
10
26
|
export type Criterion = {
|
|
27
|
+
type: 'criterion';
|
|
28
|
+
id?: string;
|
|
11
29
|
quality: string;
|
|
12
30
|
title: string;
|
|
13
31
|
label?: string;
|
|
14
32
|
tags?: string[];
|
|
15
33
|
items: (Task | TaskGroup)[];
|
|
16
|
-
documentation?:
|
|
34
|
+
documentation?: DocumentationItem[];
|
|
17
35
|
};
|
|
18
36
|
export type TaskGroup = {
|
|
37
|
+
type: 'task-group';
|
|
38
|
+
id?: string;
|
|
19
39
|
title: string;
|
|
20
40
|
label?: string;
|
|
21
41
|
tags?: string[];
|
|
22
42
|
items: (Task | TaskGroup)[];
|
|
23
|
-
documentation?:
|
|
43
|
+
documentation?: DocumentationItem[];
|
|
24
44
|
};
|
|
25
45
|
export type Task = {
|
|
46
|
+
type: 'task';
|
|
47
|
+
id?: string;
|
|
26
48
|
title: string;
|
|
27
49
|
label?: string;
|
|
50
|
+
description?: string;
|
|
28
51
|
tags?: string[];
|
|
29
52
|
items: TaskItem[];
|
|
30
|
-
documentation?:
|
|
53
|
+
documentation?: DocumentationItem[];
|
|
31
54
|
};
|
|
32
55
|
export type TaskItem = {
|
|
56
|
+
type: 'task-item';
|
|
33
57
|
id: string;
|
|
34
|
-
text?: string;
|
|
35
58
|
description?: string;
|
|
36
59
|
label?: string;
|
|
37
60
|
tags?: string[];
|
|
38
61
|
definition: SelectSingleType | SelectMultipleType | NumberType | BooleanType;
|
|
39
|
-
documentation?:
|
|
62
|
+
documentation?: DocumentationItem[];
|
|
40
63
|
providedData?: Record<string, TaskItemValue>;
|
|
41
64
|
calculatedData?: Record<string, any>;
|
|
42
65
|
};
|
|
@@ -60,7 +83,9 @@ export type BooleanType = {
|
|
|
60
83
|
export type PointOption = {
|
|
61
84
|
id?: string;
|
|
62
85
|
label: string;
|
|
63
|
-
value: number;
|
|
86
|
+
value: string | number | boolean | null;
|
|
64
87
|
annotation?: string;
|
|
65
88
|
};
|
|
66
89
|
export type TaskItemValue = string | number | boolean | null | Array<string | number | boolean | null>;
|
|
90
|
+
export type CriteriaTreeElement = Criterion | TaskGroup | Task | TaskItem;
|
|
91
|
+
export type CriteriaTreeElementType = 'criterion' | 'task-group' | 'task' | 'task-item';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CriteriaTreeElement, Criterion } from './types';
|
|
2
|
+
export declare const isCriterion: (element: CriteriaTreeElement) => element is Criterion;
|
|
3
|
+
export declare const isTaskGroup: (element: CriteriaTreeElement) => element is Criterion;
|
|
4
|
+
export declare const isTask: (element: CriteriaTreeElement) => element is Criterion;
|
|
5
|
+
export declare const isTaskItem: (element: CriteriaTreeElement) => element is Criterion;
|
package/dist/v1/utils.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTaskItem = exports.isTask = exports.isTaskGroup = exports.isCriterion = void 0;
|
|
4
|
+
const isCriterion = (element) => element.type === 'criterion';
|
|
5
|
+
exports.isCriterion = isCriterion;
|
|
6
|
+
const isTaskGroup = (element) => element.type === 'task-group';
|
|
7
|
+
exports.isTaskGroup = isTaskGroup;
|
|
8
|
+
const isTask = (element) => element.type === 'task';
|
|
9
|
+
exports.isTask = isTask;
|
|
10
|
+
const isTaskItem = (element) => element.type === 'task-item';
|
|
11
|
+
exports.isTaskItem = isTaskItem;
|
package/package.json
CHANGED