triangle-types 1.0.291 → 1.0.293
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/types/prism/StateVoter.d.ts +2 -2
- package/dist/src/types/prism/StateVoter.js +5 -28
- package/dist/src/types/prism/UserPrismSample.d.ts +1 -1
- package/dist/src/types/prism/UserPrismSample.js +3 -3
- package/package.json +1 -1
- package/src/types/prism/StateVoter.ts +4 -30
- package/src/types/prism/UserPrismSample.ts +3 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LALFileVoter } from "../lal/LALFileVoter.js";
|
|
2
2
|
import { StateID } from "../jurisdictions/State.js";
|
|
3
|
+
import { StateVoterTarget } from "./StateVoterTarget.js";
|
|
3
4
|
import { VoterPartyTypeID } from "./Voter.js";
|
|
4
5
|
import { Geom } from "../jurisdictions/Geom.js";
|
|
5
6
|
export declare class StateVoter {
|
|
@@ -24,11 +25,10 @@ export declare class StateVoter {
|
|
|
24
25
|
readonly [x: string]: any;
|
|
25
26
|
constructor(state_voter: any);
|
|
26
27
|
static is(state_voter: any): state_voter is StateVoter;
|
|
27
|
-
static keys(): string[];
|
|
28
28
|
}
|
|
29
29
|
export declare class StateVoterAux extends StateVoter {
|
|
30
30
|
readonly lal_file_voter: LALFileVoter;
|
|
31
|
+
readonly targets: StateVoterTarget[];
|
|
31
32
|
constructor(state_voter: any);
|
|
32
33
|
static is(state_voter: any): state_voter is StateVoter;
|
|
33
|
-
static keys(): string[];
|
|
34
34
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LALFileVoter } from "../lal/LALFileVoter.js";
|
|
2
2
|
import { is_state_id } from "../jurisdictions/State.js";
|
|
3
|
+
import { StateVoterTarget } from "./StateVoterTarget.js";
|
|
3
4
|
import { is_voter_party_type_id } from "./Voter.js";
|
|
4
5
|
import { Geom } from "../jurisdictions/Geom.js";
|
|
5
6
|
export class StateVoter {
|
|
@@ -65,45 +66,21 @@ export class StateVoter {
|
|
|
65
66
|
typeof state_voter.address_residence_coordinates_type_id === "string" &&
|
|
66
67
|
is_voter_party_type_id(state_voter.party_type_id));
|
|
67
68
|
}
|
|
68
|
-
static keys() {
|
|
69
|
-
return [
|
|
70
|
-
"state_id",
|
|
71
|
-
"voter_id",
|
|
72
|
-
"lal_file_id",
|
|
73
|
-
"lal_voter_id",
|
|
74
|
-
"name_first",
|
|
75
|
-
"name_middle",
|
|
76
|
-
"name_last",
|
|
77
|
-
"name_suffix",
|
|
78
|
-
"address_residence_1",
|
|
79
|
-
"address_residence_2",
|
|
80
|
-
"address_residence_city",
|
|
81
|
-
"address_residence_state_id",
|
|
82
|
-
"address_residence_zip_id",
|
|
83
|
-
"address_residence_latitude",
|
|
84
|
-
"address_residence_longitude",
|
|
85
|
-
"address_residence_coordinates_type_id",
|
|
86
|
-
"party_type_id"
|
|
87
|
-
];
|
|
88
|
-
}
|
|
89
69
|
}
|
|
90
70
|
export class StateVoterAux extends StateVoter {
|
|
91
71
|
lal_file_voter;
|
|
72
|
+
targets;
|
|
92
73
|
constructor(state_voter) {
|
|
93
74
|
if (!StateVoterAux.is(state_voter)) {
|
|
94
75
|
throw Error("Invalid input.");
|
|
95
76
|
}
|
|
96
77
|
super(state_voter);
|
|
97
78
|
this.lal_file_voter = state_voter.lal_file_voter;
|
|
79
|
+
this.targets = state_voter.targets;
|
|
98
80
|
}
|
|
99
81
|
static is(state_voter) {
|
|
100
82
|
return (StateVoter.is(state_voter) &&
|
|
101
|
-
LALFileVoter.is(state_voter.lal_file_voter)
|
|
102
|
-
|
|
103
|
-
static keys() {
|
|
104
|
-
return [
|
|
105
|
-
...StateVoter.keys(),
|
|
106
|
-
"lal_file_voter"
|
|
107
|
-
];
|
|
83
|
+
LALFileVoter.is(state_voter.lal_file_voter) &&
|
|
84
|
+
Array.isArray(state_voter.targets) && state_voter.targets.every(StateVoterTarget.is));
|
|
108
85
|
}
|
|
109
86
|
}
|
|
@@ -3,7 +3,7 @@ export class UserPrismSample {
|
|
|
3
3
|
prism_id;
|
|
4
4
|
sample_id;
|
|
5
5
|
tenant_id;
|
|
6
|
-
|
|
6
|
+
num_units;
|
|
7
7
|
name;
|
|
8
8
|
seed;
|
|
9
9
|
constructor(prism_sample) {
|
|
@@ -14,7 +14,7 @@ export class UserPrismSample {
|
|
|
14
14
|
this.prism_id = prism_sample.prism_id;
|
|
15
15
|
this.sample_id = prism_sample.sample_id;
|
|
16
16
|
this.tenant_id = prism_sample.tenant_id;
|
|
17
|
-
this.
|
|
17
|
+
this.num_units = prism_sample.num_units;
|
|
18
18
|
this.name = prism_sample.name;
|
|
19
19
|
this.seed = prism_sample.seed;
|
|
20
20
|
}
|
|
@@ -24,7 +24,7 @@ export class UserPrismSample {
|
|
|
24
24
|
typeof prism_sample.prism_id === "string" &&
|
|
25
25
|
typeof prism_sample.sample_id === "string" &&
|
|
26
26
|
typeof prism_sample.tenant_id === "string" &&
|
|
27
|
-
typeof prism_sample.
|
|
27
|
+
typeof prism_sample.num_units === "number" &&
|
|
28
28
|
typeof prism_sample.name === "string" &&
|
|
29
29
|
typeof prism_sample.seed === "number");
|
|
30
30
|
}
|
package/package.json
CHANGED
|
@@ -73,32 +73,11 @@ export class StateVoter {
|
|
|
73
73
|
is_voter_party_type_id(state_voter.party_type_id)
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
|
-
|
|
77
|
-
static keys() : string[] {
|
|
78
|
-
return [
|
|
79
|
-
"state_id",
|
|
80
|
-
"voter_id",
|
|
81
|
-
"lal_file_id",
|
|
82
|
-
"lal_voter_id",
|
|
83
|
-
"name_first",
|
|
84
|
-
"name_middle",
|
|
85
|
-
"name_last",
|
|
86
|
-
"name_suffix",
|
|
87
|
-
"address_residence_1",
|
|
88
|
-
"address_residence_2",
|
|
89
|
-
"address_residence_city",
|
|
90
|
-
"address_residence_state_id",
|
|
91
|
-
"address_residence_zip_id",
|
|
92
|
-
"address_residence_latitude",
|
|
93
|
-
"address_residence_longitude",
|
|
94
|
-
"address_residence_coordinates_type_id",
|
|
95
|
-
"party_type_id"
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
76
|
}
|
|
99
77
|
|
|
100
78
|
export class StateVoterAux extends StateVoter {
|
|
101
79
|
readonly lal_file_voter : LALFileVoter
|
|
80
|
+
readonly targets : StateVoterTarget[]
|
|
102
81
|
|
|
103
82
|
constructor(state_voter : any) {
|
|
104
83
|
if (!StateVoterAux.is(state_voter)) {
|
|
@@ -106,19 +85,14 @@ export class StateVoterAux extends StateVoter {
|
|
|
106
85
|
}
|
|
107
86
|
super(state_voter)
|
|
108
87
|
this.lal_file_voter = state_voter.lal_file_voter
|
|
88
|
+
this.targets = state_voter.targets
|
|
109
89
|
}
|
|
110
90
|
|
|
111
91
|
static is(state_voter : any) : state_voter is StateVoter {
|
|
112
92
|
return (
|
|
113
93
|
StateVoter.is(state_voter) &&
|
|
114
|
-
LALFileVoter.is(state_voter.lal_file_voter)
|
|
94
|
+
LALFileVoter.is(state_voter.lal_file_voter) &&
|
|
95
|
+
Array.isArray(state_voter.targets) && state_voter.targets.every(StateVoterTarget.is)
|
|
115
96
|
)
|
|
116
97
|
}
|
|
117
|
-
|
|
118
|
-
static keys() : string[] {
|
|
119
|
-
return [
|
|
120
|
-
...StateVoter.keys(),
|
|
121
|
-
"lal_file_voter"
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
98
|
}
|
|
@@ -3,7 +3,7 @@ export class UserPrismSample {
|
|
|
3
3
|
readonly prism_id : string
|
|
4
4
|
readonly sample_id : string
|
|
5
5
|
readonly tenant_id : string
|
|
6
|
-
readonly
|
|
6
|
+
readonly num_units : number
|
|
7
7
|
readonly name : string
|
|
8
8
|
readonly seed : number
|
|
9
9
|
readonly [x : string] : any
|
|
@@ -16,7 +16,7 @@ export class UserPrismSample {
|
|
|
16
16
|
this.prism_id = prism_sample.prism_id
|
|
17
17
|
this.sample_id = prism_sample.sample_id
|
|
18
18
|
this.tenant_id = prism_sample.tenant_id
|
|
19
|
-
this.
|
|
19
|
+
this.num_units = prism_sample.num_units
|
|
20
20
|
this.name = prism_sample.name
|
|
21
21
|
this.seed = prism_sample.seed
|
|
22
22
|
}
|
|
@@ -28,7 +28,7 @@ export class UserPrismSample {
|
|
|
28
28
|
typeof prism_sample.prism_id === "string" &&
|
|
29
29
|
typeof prism_sample.sample_id === "string" &&
|
|
30
30
|
typeof prism_sample.tenant_id === "string" &&
|
|
31
|
-
typeof prism_sample.
|
|
31
|
+
typeof prism_sample.num_units === "number" &&
|
|
32
32
|
typeof prism_sample.name === "string" &&
|
|
33
33
|
typeof prism_sample.seed === "number"
|
|
34
34
|
)
|