triangle-types 1.0.56 → 1.0.58

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.
@@ -48,7 +48,6 @@ export * from "./types/prism/Prism.js";
48
48
  export * from "./types/prism/PrismMetric.js";
49
49
  export * from "./types/prism/PrismSubPrism.js";
50
50
  export * from "./types/prism/PrismTarget.js";
51
- export * from "./types/prism/PrismVoter.js";
52
51
  export * from "./types/prism/UserPrism.js";
53
52
  export * from "./types/prism/Voter.js";
54
53
  export * from "./types/prism/VoterTarget.js";
package/dist/src/index.js CHANGED
@@ -48,7 +48,6 @@ export * from "./types/prism/Prism.js";
48
48
  export * from "./types/prism/PrismMetric.js";
49
49
  export * from "./types/prism/PrismSubPrism.js";
50
50
  export * from "./types/prism/PrismTarget.js";
51
- export * from "./types/prism/PrismVoter.js";
52
51
  export * from "./types/prism/UserPrism.js";
53
52
  export * from "./types/prism/Voter.js";
54
53
  export * from "./types/prism/VoterTarget.js";
@@ -1,8 +1,8 @@
1
1
  import { StateID } from "../State.js";
2
2
  export declare class StateLegislatureDistrict {
3
3
  readonly state_legislature_district_id: string;
4
- readonly legislature_id: number;
5
4
  readonly state_id: StateID;
5
+ readonly legislature_id: number;
6
6
  readonly chamber_id: string;
7
7
  readonly district_id: number;
8
8
  constructor(state_legislature_district: any);
@@ -1,8 +1,8 @@
1
1
  import { is_state_id } from "../State.js";
2
2
  export class StateLegislatureDistrict {
3
3
  state_legislature_district_id;
4
- legislature_id;
5
4
  state_id;
5
+ legislature_id;
6
6
  chamber_id;
7
7
  district_id;
8
8
  constructor(state_legislature_district) {
@@ -10,16 +10,16 @@ export class StateLegislatureDistrict {
10
10
  throw Error("Invalid input.");
11
11
  }
12
12
  this.state_legislature_district_id = state_legislature_district.state_legislature_district_id;
13
- this.legislature_id = state_legislature_district.legislature_id;
14
13
  this.state_id = state_legislature_district.state_id;
14
+ this.legislature_id = state_legislature_district.legislature_id;
15
15
  this.chamber_id = state_legislature_district.chamber_id;
16
16
  this.district_id = state_legislature_district.district_id;
17
17
  }
18
18
  static is(state_legislature_district) {
19
19
  return (state_legislature_district !== undefined &&
20
20
  typeof state_legislature_district.state_legislature_district_id === "string" &&
21
- typeof state_legislature_district.legislature_id === "number" &&
22
21
  is_state_id(state_legislature_district.state_id) &&
22
+ typeof state_legislature_district.legislature_id === "number" &&
23
23
  typeof state_legislature_district.chamber_id === "string" &&
24
24
  typeof state_legislature_district.district_id === "number");
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.56",
3
+ "version": "1.0.58",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -58,7 +58,6 @@ export * from "./types/prism/Prism"
58
58
  export * from "./types/prism/PrismMetric"
59
59
  export * from "./types/prism/PrismSubPrism"
60
60
  export * from "./types/prism/PrismTarget"
61
- export * from "./types/prism/PrismVoter"
62
61
  export * from "./types/prism/UserPrism"
63
62
  export * from "./types/prism/Voter"
64
63
  export * from "./types/prism/VoterTarget"
@@ -2,8 +2,8 @@ import { is_state_id, StateID } from "../State"
2
2
 
3
3
  export class StateLegislatureDistrict {
4
4
  readonly state_legislature_district_id : string
5
- readonly legislature_id : number
6
5
  readonly state_id : StateID
6
+ readonly legislature_id : number
7
7
  readonly chamber_id : string
8
8
  readonly district_id : number
9
9
 
@@ -13,8 +13,8 @@ export class StateLegislatureDistrict {
13
13
  throw Error("Invalid input.")
14
14
  }
15
15
  this.state_legislature_district_id = state_legislature_district.state_legislature_district_id
16
- this.legislature_id = state_legislature_district.legislature_id
17
16
  this.state_id = state_legislature_district.state_id
17
+ this.legislature_id = state_legislature_district.legislature_id
18
18
  this.chamber_id = state_legislature_district.chamber_id
19
19
  this.district_id = state_legislature_district.district_id
20
20
  }
@@ -23,8 +23,8 @@ export class StateLegislatureDistrict {
23
23
  return (
24
24
  state_legislature_district !== undefined &&
25
25
  typeof state_legislature_district.state_legislature_district_id === "string" &&
26
- typeof state_legislature_district.legislature_id === "number" &&
27
26
  is_state_id(state_legislature_district.state_id) &&
27
+ typeof state_legislature_district.legislature_id === "number" &&
28
28
  typeof state_legislature_district.chamber_id === "string" &&
29
29
  typeof state_legislature_district.district_id === "number"
30
30
  )
@@ -1,29 +0,0 @@
1
- export class PrismVoter {
2
- readonly prism_voter_id : string
3
- readonly prism_id : string
4
- readonly voter_id : string
5
- readonly state_id : string
6
- readonly value : number
7
-
8
- constructor(prism_voter : any) {
9
- if (!PrismVoter.is(prism_voter)) {
10
- throw Error("Invalid input.")
11
- }
12
- this.prism_voter_id = prism_voter.prism_voter_id
13
- this.prism_id = prism_voter.prism_id
14
- this.voter_id = prism_voter.voter_id
15
- this.state_id = prism_voter.state_id
16
- this.value = prism_voter.value
17
- }
18
-
19
- static is(prism_voter : any) : prism_voter is PrismVoter {
20
- return (
21
- prism_voter !== undefined &&
22
- typeof prism_voter.prism_voter_id === "string" &&
23
- typeof prism_voter.prism_id === "string" &&
24
- typeof prism_voter.voter_id === "string" &&
25
- typeof prism_voter.state_id === "string" &&
26
- typeof prism_voter.value === "number"
27
- )
28
- }
29
- }