triangle-types 1.0.111 → 1.0.112

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.
@@ -53,7 +53,6 @@ export * from "./types/legistar/LegistarAgency.js";
53
53
  export * from "./types/legistar/LegistarDocument.js";
54
54
  export * from "./types/prism/Prism.js";
55
55
  export * from "./types/prism/PrismFeature.js";
56
- export * from "./types/prism/PrismMetric.js";
57
56
  export * from "./types/prism/PrismSubPrism.js";
58
57
  export * from "./types/prism/PrismSegment.js";
59
58
  export * from "./types/prism/PrismTarget.js";
package/dist/src/index.js CHANGED
@@ -53,7 +53,6 @@ export * from "./types/legistar/LegistarAgency.js";
53
53
  export * from "./types/legistar/LegistarDocument.js";
54
54
  export * from "./types/prism/Prism.js";
55
55
  export * from "./types/prism/PrismFeature.js";
56
- export * from "./types/prism/PrismMetric.js";
57
56
  export * from "./types/prism/PrismSubPrism.js";
58
57
  export * from "./types/prism/PrismSegment.js";
59
58
  export * from "./types/prism/PrismTarget.js";
@@ -9,6 +9,8 @@ export declare class Prism {
9
9
  readonly federal_congress_district_id?: string;
10
10
  readonly state_legislature_house_district_id?: string;
11
11
  readonly state_legislature_senate_district_id?: string;
12
+ readonly county_id?: string;
13
+ readonly school_district_id?: string;
12
14
  readonly party_type_id: VoterPartyTypeID;
13
15
  readonly [x: string]: any;
14
16
  constructor(prism: any);
@@ -9,6 +9,8 @@ export class Prism {
9
9
  federal_congress_district_id;
10
10
  state_legislature_house_district_id;
11
11
  state_legislature_senate_district_id;
12
+ county_id;
13
+ school_district_id;
12
14
  party_type_id;
13
15
  constructor(prism) {
14
16
  if (!Prism.is(prism)) {
@@ -20,6 +22,8 @@ export class Prism {
20
22
  this.federal_congress_district_id = prism.federal_congress_district_id;
21
23
  this.state_legislature_house_district_id = prism.state_legislature_house_district_id;
22
24
  this.state_legislature_senate_district_id = prism.state_legislature_senate_district_id;
25
+ this.county_id = prism.county_id;
26
+ this.school_district_id = prism.school_district_id;
23
27
  this.party_type_id = prism.party_type_id;
24
28
  }
25
29
  static is(prism) {
@@ -30,6 +34,8 @@ export class Prism {
30
34
  (prism.federal_congress_district_id === undefined || typeof prism.federal_congress_district_id === "string") &&
31
35
  (prism.state_legislature_house_district_id === undefined || typeof prism.state_legislature_house_district_id === "string") &&
32
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") &&
33
39
  is_voter_party_type_id(prism.party_type_id));
34
40
  }
35
41
  }
@@ -30,6 +30,8 @@ export declare class Voter {
30
30
  readonly federal_congress_district_id?: string;
31
31
  readonly state_legislature_house_district_id?: string;
32
32
  readonly state_legislature_senate_district_id?: string;
33
+ readonly county_id?: string;
34
+ readonly school_district_id?: string;
33
35
  readonly party_description?: string;
34
36
  readonly party_type_id: VoterPartyTypeID;
35
37
  readonly occupation_group?: string;
@@ -31,6 +31,8 @@ export class Voter {
31
31
  federal_congress_district_id;
32
32
  state_legislature_house_district_id;
33
33
  state_legislature_senate_district_id;
34
+ county_id;
35
+ school_district_id;
34
36
  party_description;
35
37
  party_type_id;
36
38
  occupation_group;
@@ -73,6 +75,8 @@ export class Voter {
73
75
  this.federal_congress_district_id = voter.federal_congress_district_id;
74
76
  this.state_legislature_house_district_id = voter.state_legislature_house_district_id;
75
77
  this.state_legislature_senate_district_id = voter.state_legislature_senate_district_id;
78
+ this.county_id = voter.county_id;
79
+ this.school_district_id = voter.school_district_id;
76
80
  this.party_description = voter.party_description;
77
81
  this.party_type_id = voter.party_type_id;
78
82
  this.occupation_group = voter.occupation_group;
@@ -114,6 +118,8 @@ export class Voter {
114
118
  (voter.federal_congress_district_id === undefined || typeof voter.federal_congress_district_id === "string") &&
115
119
  (voter.state_legislature_house_district_id === undefined || typeof voter.state_legislature_house_district_id === "string") &&
116
120
  (voter.state_legislature_senate_district_id === undefined || typeof voter.state_legislature_senate_district_id === "string") &&
121
+ (voter.county_id === undefined || typeof voter.county_id === "string") &&
122
+ (voter.school_district_id === undefined || typeof voter.school_district_id === "string") &&
117
123
  (voter.party_description === undefined || typeof voter.party_description === "string") &&
118
124
  is_voter_party_type_id(voter.party_type_id) &&
119
125
  (voter.occupation_group === undefined || typeof voter.occupation_group === "string") &&
@@ -9,6 +9,8 @@ export declare class VoterTarget {
9
9
  readonly federal_congress_district_id?: string;
10
10
  readonly state_legislature_house_district_id?: string;
11
11
  readonly state_legislature_senate_district_id?: string;
12
+ readonly county_id?: string;
13
+ readonly school_district_id?: string;
12
14
  readonly party_type_id: VoterPartyTypeID;
13
15
  constructor(voter_target: any);
14
16
  static is(voter_target: any): voter_target is VoterTarget;
@@ -9,6 +9,8 @@ export class VoterTarget {
9
9
  federal_congress_district_id;
10
10
  state_legislature_house_district_id;
11
11
  state_legislature_senate_district_id;
12
+ county_id;
13
+ school_district_id;
12
14
  party_type_id;
13
15
  constructor(voter_target) {
14
16
  if (!VoterTarget.is(voter_target)) {
@@ -22,6 +24,8 @@ export class VoterTarget {
22
24
  this.federal_congress_district_id = voter_target.federal_congress_district_id;
23
25
  this.state_legislature_house_district_id = voter_target.state_legislature_house_district_id;
24
26
  this.state_legislature_senate_district_id = voter_target.state_legislature_senate_district_id;
27
+ this.county_id = voter_target.county_id;
28
+ this.school_district_id = voter_target.school_district_id;
25
29
  this.party_type_id = voter_target.party_type_id;
26
30
  }
27
31
  static is(voter_target) {
@@ -34,6 +38,8 @@ export class VoterTarget {
34
38
  (voter_target.federal_congress_district_id === undefined || typeof voter_target.federal_congress_district_id === "string") &&
35
39
  (voter_target.state_legislature_house_district_id === undefined || typeof voter_target.state_legislature_house_district_id === "string") &&
36
40
  (voter_target.state_legislature_senate_district_id === undefined || typeof voter_target.state_legislature_senate_district_id === "string") &&
41
+ (voter_target.county_id === undefined || typeof voter_target.county_id === "string") &&
42
+ (voter_target.school_district_id === undefined || typeof voter_target.school_district_id === "string") &&
37
43
  is_voter_party_type_id(voter_target.party_type_id));
38
44
  }
39
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.111",
3
+ "version": "1.0.112",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -64,7 +64,6 @@ export * from "./types/legistar/LegistarDocument"
64
64
 
65
65
  export * from "./types/prism/Prism"
66
66
  export * from "./types/prism/PrismFeature"
67
- export * from "./types/prism/PrismMetric"
68
67
  export * from "./types/prism/PrismSubPrism"
69
68
  export * from "./types/prism/PrismSegment"
70
69
  export * from "./types/prism/PrismTarget"
@@ -10,6 +10,8 @@ export class Prism {
10
10
  readonly federal_congress_district_id? : string
11
11
  readonly state_legislature_house_district_id? : string
12
12
  readonly state_legislature_senate_district_id? : string
13
+ readonly county_id? : string
14
+ readonly school_district_id? : string
13
15
  readonly party_type_id : VoterPartyTypeID
14
16
  readonly [x : string] : any
15
17
 
@@ -23,6 +25,8 @@ export class Prism {
23
25
  this.federal_congress_district_id = prism.federal_congress_district_id
24
26
  this.state_legislature_house_district_id = prism.state_legislature_house_district_id
25
27
  this.state_legislature_senate_district_id = prism.state_legislature_senate_district_id
28
+ this.county_id = prism.county_id
29
+ this.school_district_id = prism.school_district_id
26
30
  this.party_type_id = prism.party_type_id
27
31
  }
28
32
 
@@ -35,6 +39,8 @@ export class Prism {
35
39
  (prism.federal_congress_district_id === undefined || typeof prism.federal_congress_district_id === "string") &&
36
40
  (prism.state_legislature_house_district_id === undefined || typeof prism.state_legislature_house_district_id === "string") &&
37
41
  (prism.state_legislature_senate_district_id === undefined || typeof prism.state_legislature_senate_district_id === "string") &&
42
+ (prism.county_id === undefined || typeof prism.county_id === "string") &&
43
+ (prism.school_district_id === undefined || typeof prism.school_district_id === "string") &&
38
44
  is_voter_party_type_id(prism.party_type_id)
39
45
  )
40
46
  }
@@ -36,6 +36,8 @@ export class Voter {
36
36
  readonly federal_congress_district_id? : string
37
37
  readonly state_legislature_house_district_id? : string
38
38
  readonly state_legislature_senate_district_id? : string
39
+ readonly county_id? : string
40
+ readonly school_district_id? : string
39
41
  readonly party_description? : string
40
42
  readonly party_type_id : VoterPartyTypeID
41
43
  readonly occupation_group? : string
@@ -80,6 +82,8 @@ export class Voter {
80
82
  this.federal_congress_district_id = voter.federal_congress_district_id
81
83
  this.state_legislature_house_district_id = voter.state_legislature_house_district_id
82
84
  this.state_legislature_senate_district_id = voter.state_legislature_senate_district_id
85
+ this.county_id = voter.county_id
86
+ this.school_district_id = voter.school_district_id
83
87
  this.party_description = voter.party_description
84
88
  this.party_type_id = voter.party_type_id
85
89
  this.occupation_group = voter.occupation_group
@@ -123,6 +127,8 @@ export class Voter {
123
127
  (voter.federal_congress_district_id === undefined || typeof voter.federal_congress_district_id === "string") &&
124
128
  (voter.state_legislature_house_district_id === undefined || typeof voter.state_legislature_house_district_id === "string") &&
125
129
  (voter.state_legislature_senate_district_id === undefined || typeof voter.state_legislature_senate_district_id === "string") &&
130
+ (voter.county_id === undefined || typeof voter.county_id === "string") &&
131
+ (voter.school_district_id === undefined || typeof voter.school_district_id === "string") &&
126
132
  (voter.party_description === undefined || typeof voter.party_description === "string") &&
127
133
  is_voter_party_type_id(voter.party_type_id) &&
128
134
  (voter.occupation_group === undefined || typeof voter.occupation_group === "string") &&
@@ -10,6 +10,8 @@ export class VoterTarget {
10
10
  readonly federal_congress_district_id? : string
11
11
  readonly state_legislature_house_district_id? : string
12
12
  readonly state_legislature_senate_district_id? : string
13
+ readonly county_id? : string
14
+ readonly school_district_id? : string
13
15
  readonly party_type_id : VoterPartyTypeID
14
16
 
15
17
  constructor(voter_target : any) {
@@ -24,6 +26,8 @@ export class VoterTarget {
24
26
  this.federal_congress_district_id = voter_target.federal_congress_district_id
25
27
  this.state_legislature_house_district_id = voter_target.state_legislature_house_district_id
26
28
  this.state_legislature_senate_district_id = voter_target.state_legislature_senate_district_id
29
+ this.county_id = voter_target.county_id
30
+ this.school_district_id = voter_target.school_district_id
27
31
  this.party_type_id = voter_target.party_type_id
28
32
  }
29
33
 
@@ -38,6 +42,8 @@ export class VoterTarget {
38
42
  (voter_target.federal_congress_district_id === undefined || typeof voter_target.federal_congress_district_id === "string") &&
39
43
  (voter_target.state_legislature_house_district_id === undefined || typeof voter_target.state_legislature_house_district_id === "string") &&
40
44
  (voter_target.state_legislature_senate_district_id === undefined || typeof voter_target.state_legislature_senate_district_id === "string") &&
45
+ (voter_target.county_id === undefined || typeof voter_target.county_id === "string") &&
46
+ (voter_target.school_district_id === undefined || typeof voter_target.school_district_id === "string") &&
41
47
  is_voter_party_type_id(voter_target.party_type_id)
42
48
  )
43
49
  }
@@ -1,29 +0,0 @@
1
- export class PrismMetric {
2
- readonly prism_metric_id : string
3
- readonly prism_id : string
4
- readonly metric_id : string
5
- readonly state_id : string
6
- readonly value : number
7
-
8
- constructor(prism_metric : any) {
9
- if (!PrismMetric.is(prism_metric)) {
10
- throw Error("Invalid input.")
11
- }
12
- this.prism_metric_id = prism_metric.prism_metric_id
13
- this.prism_id = prism_metric.prism_id
14
- this.metric_id = prism_metric.metric_id
15
- this.state_id = prism_metric.state_id
16
- this.value = prism_metric.value
17
- }
18
-
19
- static is(prism_metric : any) : prism_metric is PrismMetric {
20
- return (
21
- prism_metric !== undefined &&
22
- typeof prism_metric.prism_metric_id === "string" &&
23
- typeof prism_metric.prism_id === "string" &&
24
- typeof prism_metric.metric_id === "string" &&
25
- typeof prism_metric.state_id === "string" &&
26
- typeof prism_metric.value === "number"
27
- )
28
- }
29
- }
@@ -1,47 +0,0 @@
1
- // import { is_state_id, StateID } from "../State"
2
-
3
- // export class VoterTurnout {
4
- // readonly voter_turnout_id : string
5
- // readonly voter_id : string
6
- // readonly turnout_id : string
7
- // readonly year : number
8
- // readonly turnout_type_id : string
9
- // readonly value : boolean
10
- // readonly state_id : StateID
11
- // readonly federal_congress_district_id : string
12
- // readonly state_legislature_house_district_id : string
13
- // readonly state_legislature_senate_district_id : string
14
-
15
- // constructor(voter_turnout : any) {
16
- // if (!VoterTurnout.is(voter_turnout)) {
17
- // throw Error("Invalid input.")
18
- // }
19
- // this.voter_turnout_id = voter_turnout.voter_turnout_id
20
- // this.voter_id = voter_turnout.voter_id
21
- // this.turnout_id = voter_turnout.turnout_id
22
- // this.year = voter_turnout.year
23
- // this.turnout_type_id = voter_turnout.turnout_type_id
24
- // this.value = voter_turnout.value
25
- // this.state_id = voter_turnout.state_id
26
- // this.state_id = voter_turnout.state_id
27
- // this.federal_congress_district_id = voter_turnout.federal_congress_district_id
28
- // this.state_legislature_house_district_id = voter_turnout.state_legislature_house_district_id
29
- // this.state_legislature_senate_district_id = voter_turnout.state_legislature_senate_district_id
30
- // }
31
-
32
- // static is(voter_turnout : any) : voter_turnout is VoterTurnout {
33
- // return (
34
- // voter_turnout !== undefined &&
35
- // typeof voter_turnout.voter_turnout_id === "string" &&
36
- // typeof voter_turnout.voter_id === "string" &&
37
- // typeof voter_turnout.turnout_id === "string" &&
38
- // typeof voter_turnout.year === "number"&&
39
- // typeof voter_turnout.turnout_type_id === "string" &&
40
- // typeof voter_turnout.value === "boolean" &&
41
- // is_state_id(voter_turnout.state_id) &&
42
- // typeof voter_turnout.federal_congress_district_id === "string" &&
43
- // typeof voter_turnout.state_legislature_house_district_id === "string" &&
44
- // typeof voter_turnout.state_legislature_senate_district_id === "string"
45
- // )
46
- // }
47
- // }