elections-types 1.0.58 → 1.0.59
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/types/Article.d.ts +1 -1
- package/dist/src/types/Candidate.d.ts +1 -1
- package/dist/src/types/CandidateArticle.d.ts +1 -1
- package/dist/src/types/CandidateTweet.d.ts +1 -1
- package/dist/src/types/CandidateVideo.d.ts +1 -1
- package/dist/src/types/Committee.d.ts +1 -1
- package/dist/src/types/Election.d.ts +1 -2
- package/dist/src/types/Election.js +0 -3
- package/dist/src/types/FederalDonation.d.ts +1 -1
- package/dist/src/types/Tweet.d.ts +1 -1
- package/dist/src/types/User.d.ts +1 -1
- package/dist/src/types/UserElection.d.ts +1 -1
- package/dist/src/types/Video.d.ts +1 -1
- package/package.json +1 -1
- package/src/types/Article.ts +1 -1
- package/src/types/Candidate.ts +1 -1
- package/src/types/CandidateArticle.ts +1 -1
- package/src/types/CandidateTweet.ts +1 -1
- package/src/types/CandidateVideo.ts +1 -1
- package/src/types/Committee.ts +1 -1
- package/src/types/Election.ts +1 -4
- package/src/types/FederalDonation.ts +1 -1
- package/src/types/Tweet.ts +1 -1
- package/src/types/User.ts +1 -1
- package/src/types/UserElection.ts +1 -1
- package/src/types/Video.ts +1 -1
|
@@ -30,7 +30,7 @@ export declare class Candidate {
|
|
|
30
30
|
readonly ballotpedia_data?: Record<string, any>;
|
|
31
31
|
readonly activity_index?: ActivityIndex;
|
|
32
32
|
[x: string]: any;
|
|
33
|
-
constructor(candidate:
|
|
33
|
+
constructor(candidate: Candidate);
|
|
34
34
|
static is(candidate: any): candidate is Candidate;
|
|
35
35
|
}
|
|
36
36
|
export declare class CandidateAux extends Candidate {
|
|
@@ -7,7 +7,7 @@ export declare class CandidateArticle {
|
|
|
7
7
|
readonly relevance?: string;
|
|
8
8
|
readonly sentiment?: string;
|
|
9
9
|
[x: string]: any;
|
|
10
|
-
constructor(candidate_article:
|
|
10
|
+
constructor(candidate_article: CandidateArticle);
|
|
11
11
|
static is(candidate_article: any): candidate_article is CandidateArticle;
|
|
12
12
|
}
|
|
13
13
|
export declare class CandidateArticleAux extends CandidateArticle {
|
|
@@ -7,7 +7,7 @@ export declare class CandidateTweet {
|
|
|
7
7
|
readonly relevance?: string;
|
|
8
8
|
readonly sentiment?: string;
|
|
9
9
|
readonly [x: string]: any;
|
|
10
|
-
constructor(candidate_tweet:
|
|
10
|
+
constructor(candidate_tweet: CandidateTweet);
|
|
11
11
|
static is(candidate_tweet: any): candidate_tweet is CandidateTweet;
|
|
12
12
|
}
|
|
13
13
|
export declare class CandidateTweetAux extends CandidateTweet {
|
|
@@ -6,7 +6,7 @@ export declare class CandidateVideo {
|
|
|
6
6
|
readonly fetch_time: string;
|
|
7
7
|
readonly relevance?: string;
|
|
8
8
|
readonly [x: string]: any;
|
|
9
|
-
constructor(candidate_video:
|
|
9
|
+
constructor(candidate_video: CandidateVideo);
|
|
10
10
|
static is(candidate_video: any): candidate_video is CandidateVideo;
|
|
11
11
|
}
|
|
12
12
|
export declare class CandidateVideoAux extends CandidateVideo {
|
|
@@ -18,7 +18,7 @@ export declare class Committee {
|
|
|
18
18
|
readonly candidate_ids?: string[];
|
|
19
19
|
readonly election_ids?: string[];
|
|
20
20
|
readonly [x: string]: any;
|
|
21
|
-
constructor(committee:
|
|
21
|
+
constructor(committee: Committee);
|
|
22
22
|
static is(committee: any): committee is Committee;
|
|
23
23
|
}
|
|
24
24
|
export declare class CommitteeAux extends Committee {
|
|
@@ -12,10 +12,9 @@ export declare class Election {
|
|
|
12
12
|
readonly office_id: OfficeID;
|
|
13
13
|
readonly state_id: StateID;
|
|
14
14
|
readonly district?: number;
|
|
15
|
-
readonly candidate_ids?: string[];
|
|
16
15
|
readonly committee_ids?: string[];
|
|
17
16
|
readonly [x: string]: any;
|
|
18
|
-
constructor(election:
|
|
17
|
+
constructor(election: Election);
|
|
19
18
|
static is(election: any): election is Election;
|
|
20
19
|
}
|
|
21
20
|
export declare class ElectionAux extends Election {
|
|
@@ -25,7 +25,6 @@ export class Election {
|
|
|
25
25
|
office_id;
|
|
26
26
|
state_id;
|
|
27
27
|
district;
|
|
28
|
-
candidate_ids;
|
|
29
28
|
committee_ids;
|
|
30
29
|
constructor(election) {
|
|
31
30
|
if (!Election.is(election)) {
|
|
@@ -36,7 +35,6 @@ export class Election {
|
|
|
36
35
|
this.office_id = election.office_id;
|
|
37
36
|
this.state_id = election.state_id;
|
|
38
37
|
this.district = election.district;
|
|
39
|
-
this.candidate_ids = election.candidate_ids;
|
|
40
38
|
this.committee_ids = election.committee_ids;
|
|
41
39
|
}
|
|
42
40
|
static is(election) {
|
|
@@ -46,7 +44,6 @@ export class Election {
|
|
|
46
44
|
is_office_id(election.office_id) &&
|
|
47
45
|
is_state_id(election.state_id) &&
|
|
48
46
|
(election.district === undefined || typeof election.district === "number") &&
|
|
49
|
-
(election.candidate_ids === undefined || Array.isArray(election.candidate_ids) && election.candidate_ids.every((candidate_id) => typeof candidate_id === "string")) &&
|
|
50
47
|
(election.committee_ids === undefined || Array.isArray(election.committee_ids) && election.committee_ids.every((committee_id) => typeof committee_id === "string")));
|
|
51
48
|
}
|
|
52
49
|
}
|
|
@@ -24,6 +24,6 @@ export declare class FederalDonation {
|
|
|
24
24
|
readonly donor_address_zip: string;
|
|
25
25
|
readonly donor_aggregate_ytd: number;
|
|
26
26
|
readonly memo_text: string;
|
|
27
|
-
constructor(federal_donation:
|
|
27
|
+
constructor(federal_donation: FederalDonation);
|
|
28
28
|
static is(federal_donation: any): federal_donation is FederalDonation;
|
|
29
29
|
}
|
package/dist/src/types/User.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export declare class UserElection {
|
|
|
4
4
|
readonly election_id: ElectionID;
|
|
5
5
|
readonly candidate_display: Record<string, number>;
|
|
6
6
|
readonly notify: boolean;
|
|
7
|
-
constructor(user_election:
|
|
7
|
+
constructor(user_election: UserElection);
|
|
8
8
|
static is(user_election: any): user_election is UserElection;
|
|
9
9
|
}
|
package/package.json
CHANGED
package/src/types/Article.ts
CHANGED
package/src/types/Candidate.ts
CHANGED
|
@@ -9,7 +9,7 @@ export class CandidateArticle {
|
|
|
9
9
|
readonly sentiment? : string
|
|
10
10
|
[x : string] : any
|
|
11
11
|
|
|
12
|
-
constructor(candidate_article :
|
|
12
|
+
constructor(candidate_article : CandidateArticle) {
|
|
13
13
|
if (!CandidateArticle.is(candidate_article)) {
|
|
14
14
|
throw Error("Invalid input.")
|
|
15
15
|
}
|
|
@@ -9,7 +9,7 @@ export class CandidateTweet {
|
|
|
9
9
|
readonly sentiment? : string
|
|
10
10
|
readonly [x : string] : any
|
|
11
11
|
|
|
12
|
-
constructor(candidate_tweet :
|
|
12
|
+
constructor(candidate_tweet : CandidateTweet) {
|
|
13
13
|
if (!CandidateTweet.is(candidate_tweet)) {
|
|
14
14
|
throw Error("Invalid input.")
|
|
15
15
|
}
|
|
@@ -8,7 +8,7 @@ export class CandidateVideo {
|
|
|
8
8
|
readonly relevance? : string
|
|
9
9
|
readonly [x : string] : any
|
|
10
10
|
|
|
11
|
-
constructor(candidate_video :
|
|
11
|
+
constructor(candidate_video : CandidateVideo) {
|
|
12
12
|
if (!CandidateVideo.is(candidate_video)) {
|
|
13
13
|
throw Error("Invalid input.")
|
|
14
14
|
}
|
package/src/types/Committee.ts
CHANGED
package/src/types/Election.ts
CHANGED
|
@@ -36,11 +36,10 @@ export class Election {
|
|
|
36
36
|
readonly office_id : OfficeID
|
|
37
37
|
readonly state_id : StateID
|
|
38
38
|
readonly district? : number
|
|
39
|
-
readonly candidate_ids? : string[]
|
|
40
39
|
readonly committee_ids? : string[]
|
|
41
40
|
readonly [x : string] : any
|
|
42
41
|
|
|
43
|
-
constructor(election :
|
|
42
|
+
constructor(election : Election) {
|
|
44
43
|
if (!Election.is(election)) {
|
|
45
44
|
throw Error("Invalid input.")
|
|
46
45
|
}
|
|
@@ -49,7 +48,6 @@ export class Election {
|
|
|
49
48
|
this.office_id = election.office_id
|
|
50
49
|
this.state_id = election.state_id
|
|
51
50
|
this.district = election.district
|
|
52
|
-
this.candidate_ids = election.candidate_ids
|
|
53
51
|
this.committee_ids = election.committee_ids
|
|
54
52
|
}
|
|
55
53
|
|
|
@@ -61,7 +59,6 @@ export class Election {
|
|
|
61
59
|
is_office_id(election.office_id) &&
|
|
62
60
|
is_state_id(election.state_id) &&
|
|
63
61
|
(election.district === undefined || typeof election.district === "number") &&
|
|
64
|
-
(election.candidate_ids === undefined || Array.isArray(election.candidate_ids) && election.candidate_ids.every((candidate_id : any) => typeof candidate_id === "string")) &&
|
|
65
62
|
(election.committee_ids === undefined || Array.isArray(election.committee_ids) && election.committee_ids.every((committee_id : any) => typeof committee_id === "string"))
|
|
66
63
|
)
|
|
67
64
|
}
|
|
@@ -26,7 +26,7 @@ export class FederalDonation {
|
|
|
26
26
|
readonly donor_aggregate_ytd : number
|
|
27
27
|
readonly memo_text : string
|
|
28
28
|
|
|
29
|
-
constructor(federal_donation :
|
|
29
|
+
constructor(federal_donation : FederalDonation) {
|
|
30
30
|
if (!FederalDonation.is(federal_donation)) {
|
|
31
31
|
throw Error("Invalid input.")
|
|
32
32
|
}
|
package/src/types/Tweet.ts
CHANGED
package/src/types/User.ts
CHANGED