triangle-types 1.0.41 → 1.0.42
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
package/dist/src/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StateID } from "../State.js";
|
|
2
|
+
export declare class UserStateScore {
|
|
3
|
+
readonly user_state_score_id: string;
|
|
4
|
+
readonly user_id: string;
|
|
5
|
+
readonly state_id: StateID;
|
|
6
|
+
readonly score_id: string;
|
|
7
|
+
constructor(user_state_score: any);
|
|
8
|
+
static is(user_state_score: any): user_state_score is UserStateScore;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class UserStateScore {
|
|
2
|
+
user_state_score_id;
|
|
3
|
+
user_id;
|
|
4
|
+
state_id;
|
|
5
|
+
score_id;
|
|
6
|
+
constructor(user_state_score) {
|
|
7
|
+
if (!UserStateScore.is(user_state_score)) {
|
|
8
|
+
throw Error("Invalid input.");
|
|
9
|
+
}
|
|
10
|
+
this.user_state_score_id = user_state_score.user_state_score_id;
|
|
11
|
+
this.user_id = user_state_score.user_id;
|
|
12
|
+
this.state_id = user_state_score.state_id;
|
|
13
|
+
this.score_id = user_state_score.score_id;
|
|
14
|
+
}
|
|
15
|
+
static is(user_state_score) {
|
|
16
|
+
return (user_state_score !== undefined &&
|
|
17
|
+
typeof user_state_score.user_state_score_id === "string" &&
|
|
18
|
+
typeof user_state_score.user_id === "string" &&
|
|
19
|
+
typeof user_state_score.state_id === "string" &&
|
|
20
|
+
typeof user_state_score.score_id === "string");
|
|
21
|
+
}
|
|
22
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -88,4 +88,5 @@ export * from "./types/state_permits/WI/WIStatePermitDocument"
|
|
|
88
88
|
|
|
89
89
|
export * from "./types/voters/Voter"
|
|
90
90
|
export * from "./types/voters/VoterScore"
|
|
91
|
-
export * from "./types/voters/VoterTurnout"
|
|
91
|
+
export * from "./types/voters/VoterTurnout"
|
|
92
|
+
export * from "./types/voters/UserStateScore"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { StateID } from "../State"
|
|
2
|
+
|
|
3
|
+
export class UserStateScore {
|
|
4
|
+
readonly user_state_score_id : string
|
|
5
|
+
readonly user_id : string
|
|
6
|
+
readonly state_id : StateID
|
|
7
|
+
readonly score_id : string
|
|
8
|
+
|
|
9
|
+
constructor(user_state_score : any) {
|
|
10
|
+
if (!UserStateScore.is(user_state_score)) {
|
|
11
|
+
throw Error("Invalid input.")
|
|
12
|
+
}
|
|
13
|
+
this.user_state_score_id = user_state_score.user_state_score_id
|
|
14
|
+
this.user_id = user_state_score.user_id
|
|
15
|
+
this.state_id = user_state_score.state_id
|
|
16
|
+
this.score_id = user_state_score.score_id
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static is(user_state_score : any) : user_state_score is UserStateScore {
|
|
20
|
+
return (
|
|
21
|
+
user_state_score !== undefined &&
|
|
22
|
+
typeof user_state_score.user_state_score_id === "string" &&
|
|
23
|
+
typeof user_state_score.user_id === "string" &&
|
|
24
|
+
typeof user_state_score.state_id === "string" &&
|
|
25
|
+
typeof user_state_score.score_id === "string"
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
}
|