elections-types 1.0.75 → 1.0.77

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,7 @@
1
+ import { Candidate } from "./Candidate.js";
1
2
  import { Committee } from "./Committee.js";
2
3
  import { ElectionID } from "./Election.js";
4
+ import { FECF24File } from "./FECF24File.js";
3
5
  export declare class Expenditure {
4
6
  readonly fec_file_id: number;
5
7
  readonly expenditure_id: string;
@@ -18,7 +20,9 @@ export declare class Expenditure {
18
20
  static is(expenditure: any): expenditure is Expenditure;
19
21
  }
20
22
  export declare class ExpenditureAux extends Expenditure {
21
- readonly committee: Committee[];
23
+ readonly candidate: Candidate;
24
+ readonly committee: Committee;
25
+ readonly fec_f24_file: FECF24File;
22
26
  constructor(expenditure: any);
23
27
  static is(expenditure: any): expenditure is ExpenditureAux;
24
28
  }
@@ -1,5 +1,7 @@
1
+ import { Candidate } from "./Candidate.js";
1
2
  import { Committee } from "./Committee.js";
2
3
  import { is_election_id } from "./Election.js";
4
+ import { FECF24File } from "./FECF24File.js";
3
5
  export class Expenditure {
4
6
  fec_file_id;
5
7
  expenditure_id;
@@ -47,16 +49,22 @@ export class Expenditure {
47
49
  }
48
50
  }
49
51
  export class ExpenditureAux extends Expenditure {
52
+ candidate;
50
53
  committee;
54
+ fec_f24_file;
51
55
  constructor(expenditure) {
52
56
  if (!ExpenditureAux.is(expenditure)) {
53
57
  throw Error("Invalid input.");
54
58
  }
55
59
  super(expenditure);
56
- this.committee = expenditure.committee;
60
+ this.candidate = new Candidate(expenditure.candidate);
61
+ this.committee = new Committee(expenditure.committee);
62
+ this.fec_f24_file = new FECF24File(expenditure.fec_f24_file);
57
63
  }
58
64
  static is(expenditure) {
59
65
  return (Expenditure.is(expenditure) &&
60
- Committee.is(expenditure.committee));
66
+ Candidate.is(expenditure.candidate) &&
67
+ Committee.is(expenditure.committee) &&
68
+ FECF24File.is(expenditure.fec_f24_file));
61
69
  }
62
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elections-types",
3
- "version": "1.0.75",
3
+ "version": "1.0.77",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -1,5 +1,7 @@
1
+ import { Candidate } from "./Candidate"
1
2
  import { Committee } from "./Committee"
2
3
  import { ElectionID, is_election_id } from "./Election"
4
+ import { FECF24File } from "./FECF24File"
3
5
 
4
6
  export class Expenditure {
5
7
  readonly fec_file_id : number
@@ -55,20 +57,26 @@ export class Expenditure {
55
57
  }
56
58
 
57
59
  export class ExpenditureAux extends Expenditure {
58
- readonly committee : Committee[]
60
+ readonly candidate : Candidate
61
+ readonly committee : Committee
62
+ readonly fec_f24_file : FECF24File
59
63
 
60
64
  constructor(expenditure : any) {
61
65
  if (!ExpenditureAux.is(expenditure)) {
62
66
  throw Error("Invalid input.")
63
67
  }
64
68
  super(expenditure)
65
- this.committee = expenditure.committee
69
+ this.candidate = new Candidate(expenditure.candidate)
70
+ this.committee = new Committee(expenditure.committee)
71
+ this.fec_f24_file = new FECF24File(expenditure.fec_f24_file)
66
72
  }
67
73
 
68
74
  static is(expenditure : any) : expenditure is ExpenditureAux {
69
75
  return (
70
76
  Expenditure.is(expenditure) &&
71
- Committee.is(expenditure.committee)
77
+ Candidate.is(expenditure.candidate) &&
78
+ Committee.is(expenditure.committee) &&
79
+ FECF24File.is(expenditure.fec_f24_file)
72
80
  )
73
81
  }
74
82
  }