triangle-types 1.0.271 → 1.0.273
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 +6 -4
- package/dist/src/index.js +6 -4
- package/dist/src/types/ballotpedia/BallotpediaOffice.d.ts +1 -1
- package/dist/src/types/ballotpedia/BallotpediaOffice.js +1 -1
- package/dist/src/types/federal_census/FederalCensusBlock.d.ts +1 -1
- package/dist/src/types/federal_census/FederalCensusBlock.js +1 -1
- package/dist/src/types/federal_census/FederalCensusCounty.d.ts +1 -1
- package/dist/src/types/federal_census/FederalCensusCounty.js +1 -1
- package/dist/src/types/federal_census/FederalCensusMunicipality.d.ts +1 -1
- package/dist/src/types/federal_census/FederalCensusMunicipality.js +1 -1
- package/dist/src/types/federal_census/FederalCensusSchoolDistrict.d.ts +1 -1
- package/dist/src/types/federal_census/FederalCensusSchoolDistrict.js +1 -1
- package/dist/src/types/federal_census/FederalCensusTract.d.ts +1 -1
- package/dist/src/types/federal_census/FederalCensusTract.js +1 -1
- package/dist/src/types/federal_congress/FederalCongress.d.ts +1 -1
- package/dist/src/types/federal_congress/FederalCongress.js +1 -1
- package/dist/src/types/federal_congress/FederalCongressDistrict.d.ts +1 -1
- package/dist/src/types/federal_congress/FederalCongressDistrict.js +1 -1
- package/dist/src/types/federal_congress/FederalCongressMember.d.ts +1 -1
- package/dist/src/types/federal_congress/FederalCongressMember.js +1 -1
- package/dist/src/types/federal_elections/FederalElection.d.ts +1 -1
- package/dist/src/types/federal_elections/FederalElection.js +1 -1
- package/dist/src/types/federal_elections/FederalElectionCandidate.d.ts +1 -1
- package/dist/src/types/federal_elections/FederalElectionCandidate.js +1 -1
- package/dist/src/types/federal_elections/FederalElectionDonation.d.ts +1 -1
- package/dist/src/types/federal_elections/FederalElectionF2File.d.ts +1 -1
- package/dist/src/types/federal_elections/FederalElectionF2File.js +1 -1
- package/dist/src/types/jurisdictions/County.d.ts +18 -0
- package/dist/src/types/jurisdictions/County.js +44 -0
- package/dist/src/types/jurisdictions/JurisdictionMetric.d.ts +10 -0
- package/dist/src/types/jurisdictions/JurisdictionMetric.js +23 -0
- package/dist/src/types/jurisdictions/JurisdictionTypeID.d.ts +3 -0
- package/dist/src/types/jurisdictions/JurisdictionTypeID.js +4 -0
- package/dist/src/types/jurisdictions/Municipality.d.ts +17 -0
- package/dist/src/types/jurisdictions/Municipality.js +41 -0
- package/dist/src/types/jurisdictions/SchoolDistrict.d.ts +16 -0
- package/dist/src/types/jurisdictions/SchoolDistrict.js +38 -0
- package/dist/src/types/jurisdictions/State.d.ts +12 -0
- package/dist/src/types/jurisdictions/State.js +364 -0
- package/dist/src/types/lal/LALFile.d.ts +1 -1
- package/dist/src/types/lal/LALFile.js +1 -1
- package/dist/src/types/lal/LALFileVoter.d.ts +1 -1
- package/dist/src/types/lal/LALFileVoter.js +1 -1
- package/dist/src/types/prism/Prism.d.ts +4 -6
- package/dist/src/types/prism/Prism.js +8 -16
- package/dist/src/types/prism/StateVoter.d.ts +1 -1
- package/dist/src/types/prism/StateVoter.js +1 -1
- package/dist/src/types/prism/StateVoterFeature.d.ts +1 -1
- package/dist/src/types/prism/StateVoterFeature.js +1 -1
- package/dist/src/types/prism/StateVoterTarget.d.ts +1 -1
- package/dist/src/types/prism/StateVoterTarget.js +1 -1
- package/dist/src/types/prism/Voter.d.ts +1 -1
- package/dist/src/types/prism/Voter.js +1 -1
- package/dist/src/types/prism/VoterFeature.d.ts +1 -1
- package/dist/src/types/prism/VoterFeature.js +1 -1
- package/dist/src/types/prism/VoterTarget.d.ts +1 -1
- package/dist/src/types/prism/VoterTarget.js +1 -1
- package/dist/src/types/state_legislature/StateLegislatureDistrict.d.ts +1 -1
- package/dist/src/types/state_legislature/StateLegislatureDistrict.js +1 -1
- package/dist/src/types/state_permits/StateFacility.d.ts +1 -1
- package/dist/src/types/state_permits/StateFacility.js +1 -1
- package/dist/src/types/state_permits/StatePermit.d.ts +1 -1
- package/dist/src/types/state_permits/StatePermit.js +1 -1
- package/dist/src/types/state_permits/StatePermitDocument.d.ts +1 -1
- package/dist/src/types/state_permits/StatePermitDocument.js +1 -1
- package/dist/src/types/state_permits/StatePermitDocumentSource.d.ts +1 -1
- package/dist/src/types/state_permits/StatePermitDocumentSource.js +1 -1
- package/dist/src/types/state_permits/StatePermitDocumentSourcePollutant.d.ts +1 -1
- package/dist/src/types/state_permits/StatePermitDocumentSourcePollutant.js +1 -1
- package/dist/src/types/user/TenantRole.js +1 -1
- package/dist/src/types/user/User.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +7 -5
- package/src/types/ballotpedia/BallotpediaOffice.ts +1 -1
- package/src/types/federal_census/FederalCensusBlock.ts +1 -1
- package/src/types/federal_census/FederalCensusCounty.ts +1 -1
- package/src/types/federal_census/FederalCensusMunicipality.ts +1 -1
- package/src/types/federal_census/FederalCensusSchoolDistrict.ts +1 -1
- package/src/types/federal_census/FederalCensusTract.ts +1 -1
- package/src/types/federal_congress/FederalCongress.ts +1 -1
- package/src/types/federal_congress/FederalCongressDistrict.ts +1 -1
- package/src/types/federal_congress/FederalCongressMember.ts +1 -1
- package/src/types/federal_elections/FederalElection.ts +1 -1
- package/src/types/federal_elections/FederalElectionCandidate.ts +1 -1
- package/src/types/federal_elections/FederalElectionDonation.ts +1 -1
- package/src/types/federal_elections/FederalElectionF2File.ts +1 -1
- package/src/types/jurisdictions/JurisdictionMetric.ts +29 -0
- package/src/types/jurisdictions/JurisdictionTypeID.ts +7 -0
- package/src/types/lal/LALFile.ts +1 -1
- package/src/types/lal/LALFileVoter.ts +1 -1
- package/src/types/prism/Prism.ts +8 -16
- package/src/types/prism/StateVoter.ts +1 -1
- package/src/types/prism/StateVoterFeature.ts +1 -1
- package/src/types/prism/StateVoterTarget.ts +1 -1
- package/src/types/prism/TenantVoterTag.ts +1 -1
- package/src/types/prism/Voter.ts +1 -1
- package/src/types/prism/VoterFeature.ts +1 -1
- package/src/types/prism/VoterTarget.ts +1 -1
- package/src/types/state_legislature/StateLegislatureDistrict.ts +1 -1
- package/src/types/state_permits/KY/KYStateFacility.ts +1 -1
- package/src/types/state_permits/StateFacility.ts +1 -1
- package/src/types/state_permits/StatePermit.ts +1 -1
- package/src/types/state_permits/StatePermitDocument.ts +1 -1
- package/src/types/state_permits/StatePermitDocumentSource.ts +1 -1
- package/src/types/state_permits/StatePermitDocumentSourcePollutant.ts +1 -1
- package/src/types/user/TenantRole.ts +1 -1
- package/src/types/user/User.ts +1 -1
- /package/src/types/{regions → jurisdictions}/County.ts +0 -0
- /package/src/types/{regions → jurisdictions}/Municipality.ts +0 -0
- /package/src/types/{regions → jurisdictions}/SchoolDistrict.ts +0 -0
- /package/src/types/{regions → jurisdictions}/State.ts +0 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
export const state_ids = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "DC", "PR", "AS", "GU", "MP", "VI"];
|
|
2
|
+
export function is_state_id(state_id) {
|
|
3
|
+
return state_ids.includes(state_id);
|
|
4
|
+
}
|
|
5
|
+
export class State {
|
|
6
|
+
state_id;
|
|
7
|
+
name;
|
|
8
|
+
federal_census_state_id;
|
|
9
|
+
is_territory;
|
|
10
|
+
constructor(state) {
|
|
11
|
+
if (!State.is(state)) {
|
|
12
|
+
throw Error("Invalid input.");
|
|
13
|
+
}
|
|
14
|
+
this.state_id = state.state_id;
|
|
15
|
+
this.name = state.name;
|
|
16
|
+
this.federal_census_state_id = state.federal_census_state_id;
|
|
17
|
+
this.is_territory = state.is_territory;
|
|
18
|
+
}
|
|
19
|
+
static is(state) {
|
|
20
|
+
return (state !== undefined &&
|
|
21
|
+
is_state_id(state.state_id) &&
|
|
22
|
+
typeof state.name === "string" &&
|
|
23
|
+
typeof state.federal_census_state_id === "string" &&
|
|
24
|
+
typeof state.is_territory === "boolean");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export const states_by_state_id = {
|
|
28
|
+
AL: {
|
|
29
|
+
state_id: "AL",
|
|
30
|
+
name: "Alabama",
|
|
31
|
+
federal_census_state_id: "01",
|
|
32
|
+
is_territory: false
|
|
33
|
+
},
|
|
34
|
+
AK: {
|
|
35
|
+
state_id: "AK",
|
|
36
|
+
name: "Alaska",
|
|
37
|
+
federal_census_state_id: "02",
|
|
38
|
+
is_territory: false
|
|
39
|
+
},
|
|
40
|
+
AZ: {
|
|
41
|
+
state_id: "AZ",
|
|
42
|
+
name: "Arizona",
|
|
43
|
+
federal_census_state_id: "04",
|
|
44
|
+
is_territory: false
|
|
45
|
+
},
|
|
46
|
+
AR: {
|
|
47
|
+
state_id: "AR",
|
|
48
|
+
name: "Arkansas",
|
|
49
|
+
federal_census_state_id: "05",
|
|
50
|
+
is_territory: false
|
|
51
|
+
},
|
|
52
|
+
CA: {
|
|
53
|
+
state_id: "CA",
|
|
54
|
+
name: "California",
|
|
55
|
+
federal_census_state_id: "06",
|
|
56
|
+
is_territory: false
|
|
57
|
+
},
|
|
58
|
+
CO: {
|
|
59
|
+
state_id: "CO",
|
|
60
|
+
name: "Colorado",
|
|
61
|
+
federal_census_state_id: "08",
|
|
62
|
+
is_territory: false
|
|
63
|
+
},
|
|
64
|
+
CT: {
|
|
65
|
+
state_id: "CT",
|
|
66
|
+
name: "Connecticut",
|
|
67
|
+
federal_census_state_id: "09",
|
|
68
|
+
is_territory: false
|
|
69
|
+
},
|
|
70
|
+
DE: {
|
|
71
|
+
state_id: "DE",
|
|
72
|
+
name: "Delaware",
|
|
73
|
+
federal_census_state_id: "10",
|
|
74
|
+
is_territory: false
|
|
75
|
+
},
|
|
76
|
+
FL: {
|
|
77
|
+
state_id: "FL",
|
|
78
|
+
name: "Florida",
|
|
79
|
+
federal_census_state_id: "12",
|
|
80
|
+
is_territory: false
|
|
81
|
+
},
|
|
82
|
+
GA: {
|
|
83
|
+
state_id: "GA",
|
|
84
|
+
name: "Georgia",
|
|
85
|
+
federal_census_state_id: "13",
|
|
86
|
+
is_territory: false
|
|
87
|
+
},
|
|
88
|
+
HI: {
|
|
89
|
+
state_id: "HI",
|
|
90
|
+
name: "Hawaii",
|
|
91
|
+
federal_census_state_id: "15",
|
|
92
|
+
is_territory: false
|
|
93
|
+
},
|
|
94
|
+
ID: {
|
|
95
|
+
state_id: "ID",
|
|
96
|
+
name: "Idaho",
|
|
97
|
+
federal_census_state_id: "16",
|
|
98
|
+
is_territory: false
|
|
99
|
+
},
|
|
100
|
+
IL: {
|
|
101
|
+
state_id: "IL",
|
|
102
|
+
name: "Illinois",
|
|
103
|
+
federal_census_state_id: "17",
|
|
104
|
+
is_territory: false
|
|
105
|
+
},
|
|
106
|
+
IN: {
|
|
107
|
+
state_id: "IN",
|
|
108
|
+
name: "Indiana",
|
|
109
|
+
federal_census_state_id: "18",
|
|
110
|
+
is_territory: false
|
|
111
|
+
},
|
|
112
|
+
IA: {
|
|
113
|
+
state_id: "IA",
|
|
114
|
+
name: "Iowa",
|
|
115
|
+
federal_census_state_id: "19",
|
|
116
|
+
is_territory: false
|
|
117
|
+
},
|
|
118
|
+
KS: {
|
|
119
|
+
state_id: "KS",
|
|
120
|
+
name: "Kansas",
|
|
121
|
+
federal_census_state_id: "20",
|
|
122
|
+
is_territory: false
|
|
123
|
+
},
|
|
124
|
+
KY: {
|
|
125
|
+
state_id: "KY",
|
|
126
|
+
name: "Kentucky",
|
|
127
|
+
federal_census_state_id: "21",
|
|
128
|
+
is_territory: false
|
|
129
|
+
},
|
|
130
|
+
LA: {
|
|
131
|
+
state_id: "LA",
|
|
132
|
+
name: "Louisiana",
|
|
133
|
+
federal_census_state_id: "22",
|
|
134
|
+
is_territory: false
|
|
135
|
+
},
|
|
136
|
+
ME: {
|
|
137
|
+
state_id: "ME",
|
|
138
|
+
name: "Maine",
|
|
139
|
+
federal_census_state_id: "23",
|
|
140
|
+
is_territory: false
|
|
141
|
+
},
|
|
142
|
+
MD: {
|
|
143
|
+
state_id: "MD",
|
|
144
|
+
name: "Maryland",
|
|
145
|
+
federal_census_state_id: "24",
|
|
146
|
+
is_territory: false
|
|
147
|
+
},
|
|
148
|
+
MA: {
|
|
149
|
+
state_id: "MA",
|
|
150
|
+
name: "Massachusetts",
|
|
151
|
+
federal_census_state_id: "25",
|
|
152
|
+
is_territory: false
|
|
153
|
+
},
|
|
154
|
+
MI: {
|
|
155
|
+
state_id: "MI",
|
|
156
|
+
name: "Michigan",
|
|
157
|
+
federal_census_state_id: "26",
|
|
158
|
+
is_territory: false
|
|
159
|
+
},
|
|
160
|
+
MN: {
|
|
161
|
+
state_id: "MN",
|
|
162
|
+
name: "Minnesota",
|
|
163
|
+
federal_census_state_id: "27",
|
|
164
|
+
is_territory: false
|
|
165
|
+
},
|
|
166
|
+
MS: {
|
|
167
|
+
state_id: "MS",
|
|
168
|
+
name: "Mississippi",
|
|
169
|
+
federal_census_state_id: "28",
|
|
170
|
+
is_territory: false
|
|
171
|
+
},
|
|
172
|
+
MO: {
|
|
173
|
+
state_id: "MO",
|
|
174
|
+
name: "Missouri",
|
|
175
|
+
federal_census_state_id: "29",
|
|
176
|
+
is_territory: false
|
|
177
|
+
},
|
|
178
|
+
MT: {
|
|
179
|
+
state_id: "MT",
|
|
180
|
+
name: "Montana",
|
|
181
|
+
federal_census_state_id: "30",
|
|
182
|
+
is_territory: false
|
|
183
|
+
},
|
|
184
|
+
NE: {
|
|
185
|
+
state_id: "NE",
|
|
186
|
+
name: "Nebraska",
|
|
187
|
+
federal_census_state_id: "31",
|
|
188
|
+
is_territory: false
|
|
189
|
+
},
|
|
190
|
+
NV: {
|
|
191
|
+
state_id: "NV",
|
|
192
|
+
name: "Nevada",
|
|
193
|
+
federal_census_state_id: "32",
|
|
194
|
+
is_territory: false
|
|
195
|
+
},
|
|
196
|
+
NH: {
|
|
197
|
+
state_id: "NH",
|
|
198
|
+
name: "New Hampshire",
|
|
199
|
+
federal_census_state_id: "33",
|
|
200
|
+
is_territory: false
|
|
201
|
+
},
|
|
202
|
+
NJ: {
|
|
203
|
+
state_id: "NJ",
|
|
204
|
+
name: "New Jersey",
|
|
205
|
+
federal_census_state_id: "34",
|
|
206
|
+
is_territory: false
|
|
207
|
+
},
|
|
208
|
+
NM: {
|
|
209
|
+
state_id: "NM",
|
|
210
|
+
name: "New Mexico",
|
|
211
|
+
federal_census_state_id: "35",
|
|
212
|
+
is_territory: false
|
|
213
|
+
},
|
|
214
|
+
NY: {
|
|
215
|
+
state_id: "NY",
|
|
216
|
+
name: "New York",
|
|
217
|
+
federal_census_state_id: "36",
|
|
218
|
+
is_territory: false
|
|
219
|
+
},
|
|
220
|
+
NC: {
|
|
221
|
+
state_id: "NC",
|
|
222
|
+
name: "North Carolina",
|
|
223
|
+
federal_census_state_id: "37",
|
|
224
|
+
is_territory: false
|
|
225
|
+
},
|
|
226
|
+
ND: {
|
|
227
|
+
state_id: "ND",
|
|
228
|
+
name: "North Dakota",
|
|
229
|
+
federal_census_state_id: "38",
|
|
230
|
+
is_territory: false
|
|
231
|
+
},
|
|
232
|
+
OH: {
|
|
233
|
+
state_id: "OH",
|
|
234
|
+
name: "Ohio",
|
|
235
|
+
federal_census_state_id: "39",
|
|
236
|
+
is_territory: false
|
|
237
|
+
},
|
|
238
|
+
OK: {
|
|
239
|
+
state_id: "OK",
|
|
240
|
+
name: "Oklahoma",
|
|
241
|
+
federal_census_state_id: "40",
|
|
242
|
+
is_territory: false
|
|
243
|
+
},
|
|
244
|
+
OR: {
|
|
245
|
+
state_id: "OR",
|
|
246
|
+
name: "Oregon",
|
|
247
|
+
federal_census_state_id: "41",
|
|
248
|
+
is_territory: false
|
|
249
|
+
},
|
|
250
|
+
PA: {
|
|
251
|
+
state_id: "PA",
|
|
252
|
+
name: "Pennsylvania",
|
|
253
|
+
federal_census_state_id: "42",
|
|
254
|
+
is_territory: false
|
|
255
|
+
},
|
|
256
|
+
RI: {
|
|
257
|
+
state_id: "RI",
|
|
258
|
+
name: "Rhode Island",
|
|
259
|
+
federal_census_state_id: "44",
|
|
260
|
+
is_territory: false
|
|
261
|
+
},
|
|
262
|
+
SC: {
|
|
263
|
+
state_id: "SC",
|
|
264
|
+
name: "South Carolina",
|
|
265
|
+
federal_census_state_id: "45",
|
|
266
|
+
is_territory: false
|
|
267
|
+
},
|
|
268
|
+
SD: {
|
|
269
|
+
state_id: "SD",
|
|
270
|
+
name: "South Dakota",
|
|
271
|
+
federal_census_state_id: "46",
|
|
272
|
+
is_territory: false
|
|
273
|
+
},
|
|
274
|
+
TN: {
|
|
275
|
+
state_id: "TN",
|
|
276
|
+
name: "Tennessee",
|
|
277
|
+
federal_census_state_id: "47",
|
|
278
|
+
is_territory: false
|
|
279
|
+
},
|
|
280
|
+
TX: {
|
|
281
|
+
state_id: "TX",
|
|
282
|
+
name: "Texas",
|
|
283
|
+
federal_census_state_id: "48",
|
|
284
|
+
is_territory: false
|
|
285
|
+
},
|
|
286
|
+
UT: {
|
|
287
|
+
state_id: "UT",
|
|
288
|
+
name: "Utah",
|
|
289
|
+
federal_census_state_id: "49",
|
|
290
|
+
is_territory: false
|
|
291
|
+
},
|
|
292
|
+
VT: {
|
|
293
|
+
state_id: "VT",
|
|
294
|
+
name: "Vermont",
|
|
295
|
+
federal_census_state_id: "50",
|
|
296
|
+
is_territory: false
|
|
297
|
+
},
|
|
298
|
+
VA: {
|
|
299
|
+
state_id: "VA",
|
|
300
|
+
name: "Virginia",
|
|
301
|
+
federal_census_state_id: "51",
|
|
302
|
+
is_territory: false
|
|
303
|
+
},
|
|
304
|
+
WA: {
|
|
305
|
+
state_id: "WA",
|
|
306
|
+
name: "Washington",
|
|
307
|
+
federal_census_state_id: "53",
|
|
308
|
+
is_territory: false
|
|
309
|
+
},
|
|
310
|
+
WV: {
|
|
311
|
+
state_id: "WV",
|
|
312
|
+
name: "West Virginia",
|
|
313
|
+
federal_census_state_id: "54",
|
|
314
|
+
is_territory: false
|
|
315
|
+
},
|
|
316
|
+
WI: {
|
|
317
|
+
state_id: "WI",
|
|
318
|
+
name: "Wisconsin",
|
|
319
|
+
federal_census_state_id: "55",
|
|
320
|
+
is_territory: false
|
|
321
|
+
},
|
|
322
|
+
WY: {
|
|
323
|
+
state_id: "WY",
|
|
324
|
+
name: "Wyoming",
|
|
325
|
+
federal_census_state_id: "56",
|
|
326
|
+
is_territory: false
|
|
327
|
+
},
|
|
328
|
+
DC: {
|
|
329
|
+
state_id: "DC",
|
|
330
|
+
name: "Washington D.C.",
|
|
331
|
+
federal_census_state_id: "11",
|
|
332
|
+
is_territory: true
|
|
333
|
+
},
|
|
334
|
+
PR: {
|
|
335
|
+
state_id: "PR",
|
|
336
|
+
name: "Puerto Rico",
|
|
337
|
+
federal_census_state_id: "72",
|
|
338
|
+
is_territory: true
|
|
339
|
+
},
|
|
340
|
+
AS: {
|
|
341
|
+
state_id: "AS",
|
|
342
|
+
name: "American Samoa",
|
|
343
|
+
federal_census_state_id: "60",
|
|
344
|
+
is_territory: true
|
|
345
|
+
},
|
|
346
|
+
GU: {
|
|
347
|
+
state_id: "GU",
|
|
348
|
+
name: "Guam",
|
|
349
|
+
federal_census_state_id: "66",
|
|
350
|
+
is_territory: true
|
|
351
|
+
},
|
|
352
|
+
MP: {
|
|
353
|
+
state_id: "MP",
|
|
354
|
+
name: "Northern Mariana Islands",
|
|
355
|
+
federal_census_state_id: "69",
|
|
356
|
+
is_territory: true
|
|
357
|
+
},
|
|
358
|
+
VI: {
|
|
359
|
+
state_id: "VI",
|
|
360
|
+
name: "Virgin Islands",
|
|
361
|
+
federal_census_state_id: "78",
|
|
362
|
+
is_territory: true
|
|
363
|
+
}
|
|
364
|
+
};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JurisdictionTypeID } from "../jurisdictions/JurisdictionTypeID.js";
|
|
2
|
+
import { StateID } from "../jurisdictions/State.js";
|
|
2
3
|
import { VoterPartyTypeID } from "./Voter.js";
|
|
3
4
|
export declare class Prism {
|
|
4
5
|
readonly prism_id: string;
|
|
5
6
|
readonly state_id: StateID;
|
|
6
7
|
readonly name: string;
|
|
7
|
-
readonly
|
|
8
|
-
readonly
|
|
9
|
-
readonly state_legislature_senate_district_id?: string;
|
|
10
|
-
readonly county_id?: string;
|
|
11
|
-
readonly school_district_id?: string;
|
|
8
|
+
readonly jurisdiction_type_id: JurisdictionTypeID;
|
|
9
|
+
readonly jurisdiction_id: string;
|
|
12
10
|
readonly party_type_ids?: VoterPartyTypeID[];
|
|
13
11
|
readonly target_ids: string[];
|
|
14
12
|
readonly [x: string]: any;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { is_jurisdiction_type_id } from "../jurisdictions/JurisdictionTypeID.js";
|
|
2
|
+
import { is_state_id } from "../jurisdictions/State.js";
|
|
2
3
|
import { is_voter_party_type_id } from "./Voter.js";
|
|
3
4
|
export class Prism {
|
|
4
5
|
prism_id;
|
|
5
6
|
state_id;
|
|
6
7
|
name;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
state_legislature_senate_district_id;
|
|
10
|
-
county_id;
|
|
11
|
-
school_district_id;
|
|
8
|
+
jurisdiction_type_id;
|
|
9
|
+
jurisdiction_id;
|
|
12
10
|
party_type_ids;
|
|
13
11
|
target_ids;
|
|
14
12
|
constructor(prism) {
|
|
@@ -18,11 +16,8 @@ export class Prism {
|
|
|
18
16
|
this.prism_id = prism.prism_id;
|
|
19
17
|
this.state_id = prism.state_id;
|
|
20
18
|
this.name = prism.name;
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.state_legislature_senate_district_id = prism.state_legislature_senate_district_id;
|
|
24
|
-
this.county_id = prism.county_id;
|
|
25
|
-
this.school_district_id = prism.school_district_id;
|
|
19
|
+
this.jurisdiction_type_id = prism.jurisdiction_type_id;
|
|
20
|
+
this.jurisdiction_id = prism.jurisdiction_id;
|
|
26
21
|
this.party_type_ids = prism.party_type_ids;
|
|
27
22
|
this.target_ids = prism.target_ids;
|
|
28
23
|
}
|
|
@@ -31,11 +26,8 @@ export class Prism {
|
|
|
31
26
|
typeof prism.prism_id === "string" &&
|
|
32
27
|
is_state_id(prism.state_id) &&
|
|
33
28
|
typeof prism.name === "string" &&
|
|
34
|
-
(prism.
|
|
35
|
-
|
|
36
|
-
(prism.state_legislature_senate_district_id === undefined || typeof prism.state_legislature_senate_district_id === "string") &&
|
|
37
|
-
(prism.county_id === undefined || typeof prism.county_id === "string") &&
|
|
38
|
-
(prism.school_district_id === undefined || typeof prism.school_district_id === "string") &&
|
|
29
|
+
is_jurisdiction_type_id(prism.jurisdiction_type_id) &&
|
|
30
|
+
typeof prism.jurisdiction_id === "string" &&
|
|
39
31
|
(prism.party_type_ids === undefined || Array.isArray(prism.party_type_ids) && prism.party_type_ids.every(is_voter_party_type_id)) &&
|
|
40
32
|
Array.isArray(prism.target_ids) && prism.target_ids.every((target_id) => typeof target_id === "string"));
|
|
41
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LALFileVoter } from "../lal/LALFileVoter.js";
|
|
2
|
-
import { StateID } from "../
|
|
2
|
+
import { StateID } from "../jurisdictions/State.js";
|
|
3
3
|
import { StateVoterFeature } from "./StateVoterFeature.js";
|
|
4
4
|
import { StateVoterTarget } from "./StateVoterTarget.js";
|
|
5
5
|
import { VoterPartyTypeID } from "./Voter.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LALFileVoter } from "../lal/LALFileVoter.js";
|
|
2
|
-
import { is_state_id } from "../
|
|
2
|
+
import { is_state_id } from "../jurisdictions/State.js";
|
|
3
3
|
import { StateVoterFeature } from "./StateVoterFeature.js";
|
|
4
4
|
import { StateVoterTarget } from "./StateVoterTarget.js";
|
|
5
5
|
import { is_voter_party_type_id } from "./Voter.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StateID } from "../
|
|
1
|
+
import { StateID } from "../jurisdictions/State.js";
|
|
2
2
|
import { VoterFeature } from "./VoterFeature.js";
|
|
3
3
|
import { VoterTarget } from "./VoterTarget.js";
|
|
4
4
|
export declare const voter_party_type_ids: readonly ["D", "R", "I"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StateID } from "../
|
|
1
|
+
import { StateID } from "../jurisdictions/State.js";
|
|
2
2
|
import { StatePermitAux } from "./StatePermit.js";
|
|
3
3
|
import { StatePermitDocument } from "./StatePermitDocument.js";
|
|
4
4
|
import { StatePermitDocumentSourcePollutant } from "./StatePermitDocumentSourcePollutant.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { is_state_id } from "../
|
|
1
|
+
import { is_state_id } from "../jurisdictions/State.js";
|
|
2
2
|
import { StatePermitAux } from "./StatePermit.js";
|
|
3
3
|
import { StatePermitDocument } from "./StatePermitDocument.js";
|
|
4
4
|
import { StatePermitDocumentSourcePollutant } from "./StatePermitDocumentSourcePollutant.js";
|
|
@@ -25,7 +25,7 @@ export class TenantRoleAux extends TenantRole {
|
|
|
25
25
|
this.provisions = tenant_role.provisions;
|
|
26
26
|
}
|
|
27
27
|
static is(tenant_role) {
|
|
28
|
-
return (
|
|
28
|
+
return (TenantRole.is(tenant_role) &&
|
|
29
29
|
Array.isArray(tenant_role.provisions) && tenant_role.provisions.every(TenantRoleProvision.is));
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -30,6 +30,6 @@ export class UserAux extends User {
|
|
|
30
30
|
static is(user) {
|
|
31
31
|
return (User.is(user) &&
|
|
32
32
|
(user.tenant === undefined || TenantAux.is(user.tenant)) &&
|
|
33
|
-
Array.isArray(user.tenant_roles)
|
|
33
|
+
Array.isArray(user.tenant_roles) && user.tenant_roles.every(TenantRoleAux.is));
|
|
34
34
|
}
|
|
35
35
|
}
|