triangle-types 1.0.85 → 1.0.86

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.
@@ -1,5 +1,6 @@
1
1
  import { StateID } from "../State.js";
2
2
  import { PrismTarget } from "./PrismTarget.js";
3
+ import { VoterPartyTypeID } from "./Voter.js";
3
4
  export declare class Prism {
4
5
  readonly prism_id: string;
5
6
  readonly state_id: StateID;
@@ -7,6 +8,7 @@ export declare class Prism {
7
8
  readonly federal_congress_district_id?: string;
8
9
  readonly state_legislature_house_district_id?: string;
9
10
  readonly state_legislature_senate_district_id?: string;
11
+ readonly party_type_id: VoterPartyTypeID;
10
12
  readonly [x: string]: any;
11
13
  constructor(prism: any);
12
14
  static is(prism: any): prism is Prism;
@@ -1,5 +1,6 @@
1
1
  import { is_state_id } from "../State.js";
2
2
  import { PrismTarget } from "./PrismTarget.js";
3
+ import { is_voter_party_type_id } from "./Voter.js";
3
4
  export class Prism {
4
5
  prism_id;
5
6
  state_id;
@@ -7,6 +8,7 @@ export class Prism {
7
8
  federal_congress_district_id;
8
9
  state_legislature_house_district_id;
9
10
  state_legislature_senate_district_id;
11
+ party_type_id;
10
12
  constructor(prism) {
11
13
  if (!Prism.is(prism)) {
12
14
  throw Error("Invalid input.");
@@ -17,6 +19,7 @@ export class Prism {
17
19
  this.federal_congress_district_id = prism.federal_congress_district_id;
18
20
  this.state_legislature_house_district_id = prism.state_legislature_house_district_id;
19
21
  this.state_legislature_senate_district_id = prism.state_legislature_senate_district_id;
22
+ this.party_type_id = prism.party_type_id;
20
23
  }
21
24
  static is(prism) {
22
25
  return (prism !== undefined &&
@@ -25,7 +28,8 @@ export class Prism {
25
28
  typeof prism.name === "string" &&
26
29
  (prism.federal_congress_district_id === undefined || typeof prism.federal_congress_district_id === "string") &&
27
30
  (prism.state_legislature_house_district_id === undefined || typeof prism.state_legislature_house_district_id === "string") &&
28
- (prism.state_legislature_senate_district_id === undefined || typeof prism.state_legislature_senate_district_id === "string"));
31
+ (prism.state_legislature_senate_district_id === undefined || typeof prism.state_legislature_senate_district_id === "string") &&
32
+ is_voter_party_type_id(prism.party_type_id));
29
33
  }
30
34
  }
31
35
  export class PrismAux extends Prism {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.85",
3
+ "version": "1.0.86",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -1,5 +1,6 @@
1
1
  import { is_state_id, StateID } from "../State"
2
2
  import { PrismTarget } from "./PrismTarget"
3
+ import { is_voter_party_type_id, VoterPartyTypeID } from "./Voter"
3
4
 
4
5
  export class Prism {
5
6
  readonly prism_id : string
@@ -8,6 +9,7 @@ export class Prism {
8
9
  readonly federal_congress_district_id? : string
9
10
  readonly state_legislature_house_district_id? : string
10
11
  readonly state_legislature_senate_district_id? : string
12
+ readonly party_type_id : VoterPartyTypeID
11
13
  readonly [x : string] : any
12
14
 
13
15
  constructor(prism : any) {
@@ -20,6 +22,7 @@ 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.party_type_id = prism.party_type_id
23
26
  }
24
27
 
25
28
  static is(prism : any) : prism is Prism {
@@ -30,7 +33,8 @@ export class Prism {
30
33
  typeof prism.name === "string" &&
31
34
  (prism.federal_congress_district_id === undefined || typeof prism.federal_congress_district_id === "string") &&
32
35
  (prism.state_legislature_house_district_id === undefined || typeof prism.state_legislature_house_district_id === "string") &&
33
- (prism.state_legislature_senate_district_id === undefined || typeof prism.state_legislature_senate_district_id === "string")
36
+ (prism.state_legislature_senate_district_id === undefined || typeof prism.state_legislature_senate_district_id === "string") &&
37
+ is_voter_party_type_id(prism.party_type_id)
34
38
  )
35
39
  }
36
40
  }