triangle-types 1.0.48 → 1.0.49
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
|
@@ -46,6 +46,7 @@ export * from "./types/legistar/LegistarDocument.js";
|
|
|
46
46
|
export * from "./types/prism/Prism.js";
|
|
47
47
|
export * from "./types/prism/PrismMetric.js";
|
|
48
48
|
export * from "./types/prism/PrismVoter.js";
|
|
49
|
+
export * from "./types/prism/PrismSubPrism.js";
|
|
49
50
|
export * from "./types/prism/UserPrism.js";
|
|
50
51
|
export * from "./types/prism/Voter.js";
|
|
51
52
|
export * from "./types/prism/VoterTurnout.js";
|
package/dist/src/index.js
CHANGED
|
@@ -46,6 +46,7 @@ export * from "./types/legistar/LegistarDocument.js";
|
|
|
46
46
|
export * from "./types/prism/Prism.js";
|
|
47
47
|
export * from "./types/prism/PrismMetric.js";
|
|
48
48
|
export * from "./types/prism/PrismVoter.js";
|
|
49
|
+
export * from "./types/prism/PrismSubPrism.js";
|
|
49
50
|
export * from "./types/prism/UserPrism.js";
|
|
50
51
|
export * from "./types/prism/Voter.js";
|
|
51
52
|
export * from "./types/prism/VoterTurnout.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class PrismSubPrism {
|
|
2
|
+
prism_id;
|
|
3
|
+
sub_prism_id;
|
|
4
|
+
constructor(prism_sub_prism) {
|
|
5
|
+
if (!PrismSubPrism.is(prism_sub_prism)) {
|
|
6
|
+
throw Error("Invalid input.");
|
|
7
|
+
}
|
|
8
|
+
this.prism_id = prism_sub_prism.prism_id;
|
|
9
|
+
this.sub_prism_id = prism_sub_prism.sub_prism_id;
|
|
10
|
+
}
|
|
11
|
+
static is(prism_sub_prism) {
|
|
12
|
+
return (prism_sub_prism !== undefined &&
|
|
13
|
+
typeof prism_sub_prism.prism_id === "string" &&
|
|
14
|
+
typeof prism_sub_prism.sub_prism_id === "string");
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -56,6 +56,7 @@ export * from "./types/legistar/LegistarDocument"
|
|
|
56
56
|
export * from "./types/prism/Prism"
|
|
57
57
|
export * from "./types/prism/PrismMetric"
|
|
58
58
|
export * from "./types/prism/PrismVoter"
|
|
59
|
+
export * from "./types/prism/PrismSubPrism"
|
|
59
60
|
export * from "./types/prism/UserPrism"
|
|
60
61
|
export * from "./types/prism/Voter"
|
|
61
62
|
export * from "./types/prism/VoterTurnout"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class PrismSubPrism {
|
|
2
|
+
readonly prism_id : string
|
|
3
|
+
readonly sub_prism_id : string
|
|
4
|
+
readonly [x : string] : any
|
|
5
|
+
|
|
6
|
+
constructor(prism_sub_prism : PrismSubPrism) {
|
|
7
|
+
if (!PrismSubPrism.is(prism_sub_prism)) {
|
|
8
|
+
throw Error("Invalid input.")
|
|
9
|
+
}
|
|
10
|
+
this.prism_id = prism_sub_prism.prism_id
|
|
11
|
+
this.sub_prism_id = prism_sub_prism.sub_prism_id
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static is(prism_sub_prism : any) : prism_sub_prism is PrismSubPrism {
|
|
15
|
+
return (
|
|
16
|
+
prism_sub_prism !== undefined &&
|
|
17
|
+
typeof prism_sub_prism.prism_id === "string" &&
|
|
18
|
+
typeof prism_sub_prism.sub_prism_id === "string"
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
}
|