triangle-types 1.0.4 → 1.0.6
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/User.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export declare class User {
|
|
|
2
2
|
readonly user_id: string;
|
|
3
3
|
readonly email: string;
|
|
4
4
|
readonly is_admin_elections: boolean;
|
|
5
|
+
readonly is_admin_prism: boolean;
|
|
6
|
+
readonly is_admin_scout: boolean;
|
|
7
|
+
readonly is_admin_triage: boolean;
|
|
5
8
|
constructor(user: User);
|
|
6
9
|
static is(user: any): user is User;
|
|
7
10
|
}
|
package/dist/src/types/User.js
CHANGED
|
@@ -2,6 +2,9 @@ export class User {
|
|
|
2
2
|
user_id;
|
|
3
3
|
email;
|
|
4
4
|
is_admin_elections;
|
|
5
|
+
is_admin_prism;
|
|
6
|
+
is_admin_scout;
|
|
7
|
+
is_admin_triage;
|
|
5
8
|
// readonly [x : string] : any
|
|
6
9
|
constructor(user) {
|
|
7
10
|
if (!User.is(user)) {
|
|
@@ -10,11 +13,17 @@ export class User {
|
|
|
10
13
|
this.user_id = user.user_id;
|
|
11
14
|
this.email = user.email;
|
|
12
15
|
this.is_admin_elections = user.is_admin_elections;
|
|
16
|
+
this.is_admin_prism = user.is_admin_prism;
|
|
17
|
+
this.is_admin_scout = user.is_admin_scout;
|
|
18
|
+
this.is_admin_triage = user.is_admin_triage;
|
|
13
19
|
}
|
|
14
20
|
static is(user) {
|
|
15
21
|
return (user !== undefined &&
|
|
16
22
|
typeof user.user_id === "string" &&
|
|
17
23
|
typeof user.email === "string" &&
|
|
18
|
-
typeof user.is_admin_elections === "boolean"
|
|
24
|
+
typeof user.is_admin_elections === "boolean" &&
|
|
25
|
+
typeof user.is_admin_prism === "boolean" &&
|
|
26
|
+
typeof user.is_admin_scout === "boolean" &&
|
|
27
|
+
typeof user.is_admin_triage === "boolean");
|
|
19
28
|
}
|
|
20
29
|
}
|
|
@@ -22,14 +22,17 @@ export declare class Voter {
|
|
|
22
22
|
readonly address_mail_city: string;
|
|
23
23
|
readonly address_mail_state_id: string;
|
|
24
24
|
readonly address_mail_zip: string;
|
|
25
|
-
readonly
|
|
25
|
+
readonly occupation_group?: string;
|
|
26
26
|
readonly occupation_description?: string;
|
|
27
27
|
readonly phone_home?: string;
|
|
28
28
|
readonly phone_mobile?: string;
|
|
29
|
-
readonly
|
|
29
|
+
readonly ethnic_group?: string;
|
|
30
30
|
readonly ethnic_description?: string;
|
|
31
31
|
readonly religion_description?: string;
|
|
32
32
|
readonly party_description?: string;
|
|
33
|
+
readonly language?: string;
|
|
34
|
+
readonly education_level?: string;
|
|
35
|
+
readonly marital_status?: string;
|
|
33
36
|
readonly [x: string]: any;
|
|
34
37
|
constructor(voter: any);
|
|
35
38
|
static is(voter: any): voter is Voter;
|
|
@@ -22,14 +22,17 @@ export class Voter {
|
|
|
22
22
|
address_mail_city;
|
|
23
23
|
address_mail_state_id;
|
|
24
24
|
address_mail_zip;
|
|
25
|
-
|
|
25
|
+
occupation_group;
|
|
26
26
|
occupation_description;
|
|
27
27
|
phone_home;
|
|
28
28
|
phone_mobile;
|
|
29
|
-
|
|
29
|
+
ethnic_group;
|
|
30
30
|
ethnic_description;
|
|
31
31
|
religion_description;
|
|
32
32
|
party_description;
|
|
33
|
+
language;
|
|
34
|
+
education_level;
|
|
35
|
+
marital_status;
|
|
33
36
|
constructor(voter) {
|
|
34
37
|
if (!Voter.is(voter)) {
|
|
35
38
|
throw Error("Invalid input.");
|
|
@@ -56,14 +59,17 @@ export class Voter {
|
|
|
56
59
|
this.address_mail_city = voter.address_mail_city;
|
|
57
60
|
this.address_mail_state_id = voter.address_mail_state_id;
|
|
58
61
|
this.address_mail_zip = voter.address_mail_zip;
|
|
59
|
-
this.
|
|
62
|
+
this.occupation_group = voter.occupation_group;
|
|
60
63
|
this.occupation_description = voter.occupation_description;
|
|
61
64
|
this.phone_home = voter.phone_home;
|
|
62
65
|
this.phone_mobile = voter.phone_mobile;
|
|
63
|
-
this.
|
|
66
|
+
this.ethnic_group = voter.ethnic_group;
|
|
64
67
|
this.ethnic_description = voter.ethnic_description;
|
|
65
68
|
this.religion_description = voter.religion_description;
|
|
66
69
|
this.party_description = voter.party_description;
|
|
70
|
+
this.language = voter.language;
|
|
71
|
+
this.education_level = voter.education_level;
|
|
72
|
+
this.marital_status = voter.marital_status;
|
|
67
73
|
}
|
|
68
74
|
static is(voter) {
|
|
69
75
|
return (voter !== undefined &&
|
|
@@ -89,14 +95,17 @@ export class Voter {
|
|
|
89
95
|
typeof voter.address_mail_city === "string" &&
|
|
90
96
|
typeof voter.address_mail_state_id === "string" &&
|
|
91
97
|
typeof voter.address_mail_zip === "string" &&
|
|
92
|
-
(voter.
|
|
98
|
+
(voter.occupation_group === undefined || typeof voter.occupation_group === "string") &&
|
|
93
99
|
(voter.occupation_description === undefined || typeof voter.occupation_description === "string") &&
|
|
94
100
|
(voter.phone_home === undefined || typeof voter.phone_home === "string") &&
|
|
95
101
|
(voter.phone_mobile === undefined || typeof voter.phone_mobile === "string") &&
|
|
96
|
-
(voter.
|
|
102
|
+
(voter.ethnic_group === undefined || typeof voter.ethnic_group === "string") &&
|
|
97
103
|
(voter.ethnic_description === undefined || typeof voter.ethnic_description === "string") &&
|
|
98
104
|
(voter.religion_description === undefined || typeof voter.religion_description === "string") &&
|
|
99
|
-
(voter.party_description === undefined || typeof voter.party_description === "string")
|
|
105
|
+
(voter.party_description === undefined || typeof voter.party_description === "string") &&
|
|
106
|
+
(voter.language === undefined || typeof voter.language === "string") &&
|
|
107
|
+
(voter.education_level === undefined || typeof voter.education_level === "string") &&
|
|
108
|
+
(voter.marital_status === undefined || typeof voter.marital_status === "string"));
|
|
100
109
|
}
|
|
101
110
|
}
|
|
102
111
|
export class VoterAux extends Voter {
|
package/package.json
CHANGED
package/src/types/User.ts
CHANGED
|
@@ -2,6 +2,9 @@ export class User {
|
|
|
2
2
|
readonly user_id : string
|
|
3
3
|
readonly email : string
|
|
4
4
|
readonly is_admin_elections : boolean
|
|
5
|
+
readonly is_admin_prism : boolean
|
|
6
|
+
readonly is_admin_scout : boolean
|
|
7
|
+
readonly is_admin_triage : boolean
|
|
5
8
|
// readonly [x : string] : any
|
|
6
9
|
|
|
7
10
|
constructor(user : User) {
|
|
@@ -11,6 +14,9 @@ export class User {
|
|
|
11
14
|
this.user_id = user.user_id
|
|
12
15
|
this.email = user.email
|
|
13
16
|
this.is_admin_elections = user.is_admin_elections
|
|
17
|
+
this.is_admin_prism = user.is_admin_prism
|
|
18
|
+
this.is_admin_scout = user.is_admin_scout
|
|
19
|
+
this.is_admin_triage = user.is_admin_triage
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
static is(user : any) : user is User {
|
|
@@ -18,7 +24,10 @@ export class User {
|
|
|
18
24
|
user !== undefined &&
|
|
19
25
|
typeof user.user_id === "string" &&
|
|
20
26
|
typeof user.email === "string" &&
|
|
21
|
-
typeof user.is_admin_elections === "boolean"
|
|
27
|
+
typeof user.is_admin_elections === "boolean" &&
|
|
28
|
+
typeof user.is_admin_prism === "boolean" &&
|
|
29
|
+
typeof user.is_admin_scout === "boolean" &&
|
|
30
|
+
typeof user.is_admin_triage === "boolean"
|
|
22
31
|
)
|
|
23
32
|
}
|
|
24
33
|
}
|
|
@@ -23,14 +23,17 @@ export class Voter {
|
|
|
23
23
|
readonly address_mail_city : string
|
|
24
24
|
readonly address_mail_state_id : string
|
|
25
25
|
readonly address_mail_zip : string
|
|
26
|
-
readonly
|
|
26
|
+
readonly occupation_group? : string
|
|
27
27
|
readonly occupation_description? : string
|
|
28
28
|
readonly phone_home? : string
|
|
29
29
|
readonly phone_mobile? : string
|
|
30
|
-
readonly
|
|
30
|
+
readonly ethnic_group? : string
|
|
31
31
|
readonly ethnic_description? : string
|
|
32
32
|
readonly religion_description? : string
|
|
33
33
|
readonly party_description? : string
|
|
34
|
+
readonly language? : string
|
|
35
|
+
readonly education_level? : string
|
|
36
|
+
readonly marital_status? : string
|
|
34
37
|
readonly [x : string] : any
|
|
35
38
|
|
|
36
39
|
constructor(voter : any) {
|
|
@@ -59,14 +62,17 @@ export class Voter {
|
|
|
59
62
|
this.address_mail_city = voter.address_mail_city
|
|
60
63
|
this.address_mail_state_id = voter.address_mail_state_id
|
|
61
64
|
this.address_mail_zip = voter.address_mail_zip
|
|
62
|
-
this.
|
|
65
|
+
this.occupation_group = voter.occupation_group
|
|
63
66
|
this.occupation_description = voter.occupation_description
|
|
64
67
|
this.phone_home = voter.phone_home
|
|
65
68
|
this.phone_mobile = voter.phone_mobile
|
|
66
|
-
this.
|
|
69
|
+
this.ethnic_group = voter.ethnic_group
|
|
67
70
|
this.ethnic_description = voter.ethnic_description
|
|
68
71
|
this.religion_description = voter.religion_description
|
|
69
72
|
this.party_description = voter.party_description
|
|
73
|
+
this.language = voter.language
|
|
74
|
+
this.education_level = voter.education_level
|
|
75
|
+
this.marital_status = voter.marital_status
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
static is(voter : any) : voter is Voter {
|
|
@@ -94,14 +100,17 @@ export class Voter {
|
|
|
94
100
|
typeof voter.address_mail_city === "string" &&
|
|
95
101
|
typeof voter.address_mail_state_id === "string" &&
|
|
96
102
|
typeof voter.address_mail_zip === "string" &&
|
|
97
|
-
(voter.
|
|
103
|
+
(voter.occupation_group === undefined || typeof voter.occupation_group === "string") &&
|
|
98
104
|
(voter.occupation_description === undefined || typeof voter.occupation_description === "string") &&
|
|
99
105
|
(voter.phone_home === undefined || typeof voter.phone_home === "string") &&
|
|
100
106
|
(voter.phone_mobile === undefined || typeof voter.phone_mobile === "string") &&
|
|
101
|
-
(voter.
|
|
107
|
+
(voter.ethnic_group === undefined || typeof voter.ethnic_group === "string") &&
|
|
102
108
|
(voter.ethnic_description === undefined || typeof voter.ethnic_description === "string") &&
|
|
103
109
|
(voter.religion_description === undefined || typeof voter.religion_description === "string") &&
|
|
104
|
-
(voter.party_description === undefined || typeof voter.party_description === "string")
|
|
110
|
+
(voter.party_description === undefined || typeof voter.party_description === "string") &&
|
|
111
|
+
(voter.language === undefined || typeof voter.language === "string") &&
|
|
112
|
+
(voter.education_level === undefined || typeof voter.education_level === "string") &&
|
|
113
|
+
(voter.marital_status === undefined || typeof voter.marital_status === "string")
|
|
105
114
|
)
|
|
106
115
|
}
|
|
107
116
|
}
|