triangle-types 1.0.59 → 1.0.60
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/src/index.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export * from "./types/legistar/LegistarDocument.js";
|
|
|
47
47
|
export * from "./types/prism/Prism.js";
|
|
48
48
|
export * from "./types/prism/PrismMetric.js";
|
|
49
49
|
export * from "./types/prism/PrismSubPrism.js";
|
|
50
|
+
export * from "./types/prism/PrismSegment.js";
|
|
50
51
|
export * from "./types/prism/PrismTarget.js";
|
|
51
52
|
export * from "./types/prism/UserPrism.js";
|
|
52
53
|
export * from "./types/prism/Voter.js";
|
package/dist/src/index.js
CHANGED
|
@@ -47,6 +47,7 @@ export * from "./types/legistar/LegistarDocument.js";
|
|
|
47
47
|
export * from "./types/prism/Prism.js";
|
|
48
48
|
export * from "./types/prism/PrismMetric.js";
|
|
49
49
|
export * from "./types/prism/PrismSubPrism.js";
|
|
50
|
+
export * from "./types/prism/PrismSegment.js";
|
|
50
51
|
export * from "./types/prism/PrismTarget.js";
|
|
51
52
|
export * from "./types/prism/UserPrism.js";
|
|
52
53
|
export * from "./types/prism/Voter.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class PrismSegment {
|
|
2
|
+
readonly prism_segment_id: string;
|
|
3
|
+
readonly prism_id: string;
|
|
4
|
+
readonly segment_id: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly min_value: number;
|
|
7
|
+
readonly max_value: number;
|
|
8
|
+
readonly [x: string]: any;
|
|
9
|
+
constructor(prism_segment: any);
|
|
10
|
+
static is(prism_segment: any): prism_segment is PrismSegment;
|
|
11
|
+
}
|
|
12
|
+
export declare class PrismFeatureSegment {
|
|
13
|
+
readonly feature_id: string;
|
|
14
|
+
readonly [x: string]: any;
|
|
15
|
+
constructor(prism_segment: any);
|
|
16
|
+
static is(prism_segment: any): prism_segment is PrismFeatureSegment;
|
|
17
|
+
}
|
|
18
|
+
export declare class PrismTargetSegment {
|
|
19
|
+
readonly target_id: string;
|
|
20
|
+
readonly [x: string]: any;
|
|
21
|
+
constructor(prism_segment: any);
|
|
22
|
+
static is(prism_segment: any): prism_segment is PrismTargetSegment;
|
|
23
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export class PrismSegment {
|
|
2
|
+
prism_segment_id;
|
|
3
|
+
prism_id;
|
|
4
|
+
segment_id;
|
|
5
|
+
name;
|
|
6
|
+
min_value;
|
|
7
|
+
max_value;
|
|
8
|
+
constructor(prism_segment) {
|
|
9
|
+
if (!PrismSegment.is(prism_segment)) {
|
|
10
|
+
throw Error("Invalid input.");
|
|
11
|
+
}
|
|
12
|
+
this.prism_segment_id = prism_segment.prism_segment_id;
|
|
13
|
+
this.prism_id = prism_segment.prism_id;
|
|
14
|
+
this.segment_id = prism_segment.segment_id;
|
|
15
|
+
this.name = prism_segment.name;
|
|
16
|
+
this.min_value = prism_segment.min_value;
|
|
17
|
+
this.max_value = prism_segment.max_value;
|
|
18
|
+
}
|
|
19
|
+
static is(prism_segment) {
|
|
20
|
+
return (prism_segment !== undefined &&
|
|
21
|
+
typeof prism_segment.prism_segment_id === "string" &&
|
|
22
|
+
typeof prism_segment.prism_id === "string" &&
|
|
23
|
+
typeof prism_segment.segment_id === "string" &&
|
|
24
|
+
typeof prism_segment.name === "string" &&
|
|
25
|
+
typeof prism_segment.min_value === "number" &&
|
|
26
|
+
typeof prism_segment.max_value === "number");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export class PrismFeatureSegment {
|
|
30
|
+
feature_id;
|
|
31
|
+
constructor(prism_segment) {
|
|
32
|
+
if (!PrismFeatureSegment.is(prism_segment)) {
|
|
33
|
+
throw Error("Invalid input.");
|
|
34
|
+
}
|
|
35
|
+
this.feature_id = prism_segment.feature_id;
|
|
36
|
+
}
|
|
37
|
+
static is(prism_segment) {
|
|
38
|
+
return (PrismFeatureSegment.is(prism_segment) &&
|
|
39
|
+
typeof prism_segment.feature_id === "string");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export class PrismTargetSegment {
|
|
43
|
+
target_id;
|
|
44
|
+
constructor(prism_segment) {
|
|
45
|
+
if (!PrismTargetSegment.is(prism_segment)) {
|
|
46
|
+
throw Error("Invalid input.");
|
|
47
|
+
}
|
|
48
|
+
this.target_id = prism_segment.target_id;
|
|
49
|
+
}
|
|
50
|
+
static is(prism_segment) {
|
|
51
|
+
return (PrismTargetSegment.is(prism_segment) &&
|
|
52
|
+
typeof prism_segment.target_id === "string");
|
|
53
|
+
}
|
|
54
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -57,6 +57,7 @@ export * from "./types/legistar/LegistarDocument"
|
|
|
57
57
|
export * from "./types/prism/Prism"
|
|
58
58
|
export * from "./types/prism/PrismMetric"
|
|
59
59
|
export * from "./types/prism/PrismSubPrism"
|
|
60
|
+
export * from "./types/prism/PrismSegment"
|
|
60
61
|
export * from "./types/prism/PrismTarget"
|
|
61
62
|
export * from "./types/prism/UserPrism"
|
|
62
63
|
export * from "./types/prism/Voter"
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export class PrismSegment {
|
|
2
|
+
readonly prism_segment_id : string
|
|
3
|
+
readonly prism_id : string
|
|
4
|
+
readonly segment_id : string
|
|
5
|
+
readonly name : string
|
|
6
|
+
readonly min_value : number
|
|
7
|
+
readonly max_value : number
|
|
8
|
+
readonly [x : string] : any
|
|
9
|
+
|
|
10
|
+
constructor(prism_segment : any) {
|
|
11
|
+
if (!PrismSegment.is(prism_segment)) {
|
|
12
|
+
throw Error("Invalid input.")
|
|
13
|
+
}
|
|
14
|
+
this.prism_segment_id = prism_segment.prism_segment_id
|
|
15
|
+
this.prism_id = prism_segment.prism_id
|
|
16
|
+
this.segment_id = prism_segment.segment_id
|
|
17
|
+
this.name = prism_segment.name
|
|
18
|
+
this.min_value = prism_segment.min_value
|
|
19
|
+
this.max_value = prism_segment.max_value
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static is(prism_segment : any) : prism_segment is PrismSegment {
|
|
23
|
+
return (
|
|
24
|
+
prism_segment !== undefined &&
|
|
25
|
+
typeof prism_segment.prism_segment_id === "string" &&
|
|
26
|
+
typeof prism_segment.prism_id === "string" &&
|
|
27
|
+
typeof prism_segment.segment_id === "string" &&
|
|
28
|
+
typeof prism_segment.name === "string" &&
|
|
29
|
+
typeof prism_segment.min_value === "number" &&
|
|
30
|
+
typeof prism_segment.max_value === "number"
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export class PrismFeatureSegment {
|
|
36
|
+
readonly feature_id : string
|
|
37
|
+
readonly [x : string] : any
|
|
38
|
+
|
|
39
|
+
constructor(prism_segment : any) {
|
|
40
|
+
if (!PrismFeatureSegment.is(prism_segment)) {
|
|
41
|
+
throw Error("Invalid input.")
|
|
42
|
+
}
|
|
43
|
+
this.feature_id = prism_segment.feature_id
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static is(prism_segment : any) : prism_segment is PrismFeatureSegment {
|
|
47
|
+
return (
|
|
48
|
+
PrismFeatureSegment.is(prism_segment) &&
|
|
49
|
+
typeof prism_segment.feature_id === "string"
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export class PrismTargetSegment {
|
|
55
|
+
readonly target_id : string
|
|
56
|
+
readonly [x : string] : any
|
|
57
|
+
|
|
58
|
+
constructor(prism_segment : any) {
|
|
59
|
+
if (!PrismTargetSegment.is(prism_segment)) {
|
|
60
|
+
throw Error("Invalid input.")
|
|
61
|
+
}
|
|
62
|
+
this.target_id = prism_segment.target_id
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static is(prism_segment : any) : prism_segment is PrismTargetSegment {
|
|
66
|
+
return (
|
|
67
|
+
PrismTargetSegment.is(prism_segment) &&
|
|
68
|
+
typeof prism_segment.target_id === "string"
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
}
|