triangle-types 1.0.190 → 1.0.192
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/federal_census/FederalCensusBlock.d.ts +14 -1
- package/dist/src/types/federal_census/FederalCensusBlock.js +38 -44
- package/dist/src/types/federal_census/FederalCensusTract.d.ts +12 -1
- package/dist/src/types/federal_census/FederalCensusTract.js +32 -38
- package/dist/src/types/lal/LALFileVoter.d.ts +1 -1
- package/dist/src/types/lal/LALFileVoter.js +1 -1
- package/package.json +1 -1
- package/src/types/federal_census/FederalCensusBlock.ts +40 -43
- package/src/types/federal_census/FederalCensusTract.ts +34 -37
- package/src/types/lal/LALFileVoter.ts +2 -2
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { StateID } from "../regions/State.js";
|
|
2
|
+
export declare class FederalCensusBlock {
|
|
3
|
+
readonly federal_census_block_id: string;
|
|
4
|
+
readonly federal_census_tract_id: string;
|
|
5
|
+
readonly federal_census_county_id: string;
|
|
6
|
+
readonly federal_census_id: number;
|
|
7
|
+
readonly county_id: string;
|
|
8
|
+
readonly tract_id: string;
|
|
9
|
+
readonly block_id: string;
|
|
10
|
+
readonly state_id: StateID;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
constructor(federal_census_block: any);
|
|
13
|
+
static is(federal_census_block: any): federal_census_block is FederalCensusBlock;
|
|
14
|
+
}
|
|
@@ -1,44 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// is_state_id(federal_census_block.state_id) &&
|
|
40
|
-
// typeof federal_census_block.name === "string" &&
|
|
41
|
-
// typeof federal_census_block.s3_id === "string"
|
|
42
|
-
// )
|
|
43
|
-
// }
|
|
44
|
-
// }
|
|
1
|
+
import { is_state_id } from "../regions/State.js";
|
|
2
|
+
export class FederalCensusBlock {
|
|
3
|
+
federal_census_block_id;
|
|
4
|
+
federal_census_tract_id;
|
|
5
|
+
federal_census_county_id;
|
|
6
|
+
federal_census_id;
|
|
7
|
+
county_id;
|
|
8
|
+
tract_id;
|
|
9
|
+
block_id;
|
|
10
|
+
state_id;
|
|
11
|
+
name;
|
|
12
|
+
constructor(federal_census_block) {
|
|
13
|
+
if (!FederalCensusBlock.is(federal_census_block)) {
|
|
14
|
+
throw Error("Invalid input.");
|
|
15
|
+
}
|
|
16
|
+
this.federal_census_block_id = federal_census_block.federal_census_block_id;
|
|
17
|
+
this.federal_census_tract_id = federal_census_block.federal_census_tract_id;
|
|
18
|
+
this.federal_census_county_id = federal_census_block.federal_census_county_id;
|
|
19
|
+
this.federal_census_id = federal_census_block.federal_census_id;
|
|
20
|
+
this.county_id = federal_census_block.county_id;
|
|
21
|
+
this.tract_id = federal_census_block.tract_id;
|
|
22
|
+
this.block_id = federal_census_block.block_id;
|
|
23
|
+
this.state_id = federal_census_block.state_id;
|
|
24
|
+
this.name = federal_census_block.name;
|
|
25
|
+
}
|
|
26
|
+
static is(federal_census_block) {
|
|
27
|
+
return (federal_census_block !== undefined &&
|
|
28
|
+
typeof federal_census_block.federal_census_block_id === "string" &&
|
|
29
|
+
typeof federal_census_block.federal_census_tract_id === "string" &&
|
|
30
|
+
typeof federal_census_block.federal_census_county_id === "string" &&
|
|
31
|
+
typeof federal_census_block.federal_census_id === "number" &&
|
|
32
|
+
typeof federal_census_block.county_id === "string" &&
|
|
33
|
+
typeof federal_census_block.tract_id === "string" &&
|
|
34
|
+
typeof federal_census_block.block_id === "string" &&
|
|
35
|
+
is_state_id(federal_census_block.state_id) &&
|
|
36
|
+
typeof federal_census_block.name === "string");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { StateID } from "../regions/State.js";
|
|
2
|
+
export declare class FederalCensusTract {
|
|
3
|
+
readonly federal_census_tract_id: string;
|
|
4
|
+
readonly federal_census_county_id: string;
|
|
5
|
+
readonly federal_census_id: number;
|
|
6
|
+
readonly county_id: string;
|
|
7
|
+
readonly tract_id: string;
|
|
8
|
+
readonly state_id: StateID;
|
|
9
|
+
readonly name: string;
|
|
10
|
+
constructor(federal_census_tract: any);
|
|
11
|
+
static is(federal_census_tract: any): federal_census_tract is FederalCensusTract;
|
|
12
|
+
}
|
|
@@ -1,38 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// is_state_id(federal_census_tract.state_id) &&
|
|
34
|
-
// typeof federal_census_tract.name === "string" &&
|
|
35
|
-
// typeof federal_census_tract.s3_id === "string"
|
|
36
|
-
// )
|
|
37
|
-
// }
|
|
38
|
-
// }
|
|
1
|
+
import { is_state_id } from "../regions/State.js";
|
|
2
|
+
export class FederalCensusTract {
|
|
3
|
+
federal_census_tract_id;
|
|
4
|
+
federal_census_county_id;
|
|
5
|
+
federal_census_id;
|
|
6
|
+
county_id;
|
|
7
|
+
tract_id;
|
|
8
|
+
state_id;
|
|
9
|
+
name;
|
|
10
|
+
constructor(federal_census_tract) {
|
|
11
|
+
if (!FederalCensusTract.is(federal_census_tract)) {
|
|
12
|
+
throw Error("Invalid input.");
|
|
13
|
+
}
|
|
14
|
+
this.federal_census_tract_id = federal_census_tract.federal_census_tract_id;
|
|
15
|
+
this.federal_census_county_id = federal_census_tract.federal_census_county_id;
|
|
16
|
+
this.federal_census_id = federal_census_tract.federal_census_id;
|
|
17
|
+
this.county_id = federal_census_tract.county_id;
|
|
18
|
+
this.tract_id = federal_census_tract.tract_id;
|
|
19
|
+
this.state_id = federal_census_tract.state_id;
|
|
20
|
+
this.name = federal_census_tract.name;
|
|
21
|
+
}
|
|
22
|
+
static is(federal_census_tract) {
|
|
23
|
+
return (federal_census_tract !== undefined &&
|
|
24
|
+
typeof federal_census_tract.federal_census_tract_id === "string" &&
|
|
25
|
+
typeof federal_census_tract.federal_census_county_id === "string" &&
|
|
26
|
+
typeof federal_census_tract.federal_census_id === "number" &&
|
|
27
|
+
typeof federal_census_tract.county_id === "string" &&
|
|
28
|
+
typeof federal_census_tract.tract_id === "string" &&
|
|
29
|
+
is_state_id(federal_census_tract.state_id) &&
|
|
30
|
+
typeof federal_census_tract.name === "string");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -27,7 +27,7 @@ export declare class LALFileVoter {
|
|
|
27
27
|
readonly address_mail_city?: string;
|
|
28
28
|
readonly address_mail_state_id: string;
|
|
29
29
|
readonly address_mail_zip_id?: string;
|
|
30
|
-
readonly party_id
|
|
30
|
+
readonly party_id?: string;
|
|
31
31
|
readonly party_type_id: VoterPartyTypeID;
|
|
32
32
|
readonly lal_occupation_group_id?: string;
|
|
33
33
|
readonly lal_occupation_id?: string;
|
|
@@ -114,7 +114,7 @@ export class LALFileVoter {
|
|
|
114
114
|
(lal_file_voter.address_mail_city === undefined || typeof lal_file_voter.address_mail_city === "string") &&
|
|
115
115
|
typeof lal_file_voter.address_mail_state_id === "string" &&
|
|
116
116
|
(lal_file_voter.address_mail_zip_id === undefined || typeof lal_file_voter.address_mail_zip_id === "string") &&
|
|
117
|
-
typeof lal_file_voter.party_id === "string" &&
|
|
117
|
+
(lal_file_voter.party === undefined || typeof lal_file_voter.party_id === "string") &&
|
|
118
118
|
is_voter_party_type_id(lal_file_voter.party_type_id) &&
|
|
119
119
|
(lal_file_voter.lal_occupation_group_id === undefined || typeof lal_file_voter.lal_occupation_group_id === "string") &&
|
|
120
120
|
(lal_file_voter.lal_occupation_id === undefined || typeof lal_file_voter.lal_occupation_id === "string") &&
|
package/package.json
CHANGED
|
@@ -1,47 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
import { is_state_id, StateID } from "../regions/State"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// readonly s3_id : string
|
|
3
|
+
export class FederalCensusBlock {
|
|
4
|
+
readonly federal_census_block_id : string
|
|
5
|
+
readonly federal_census_tract_id : string
|
|
6
|
+
readonly federal_census_county_id : string
|
|
7
|
+
readonly federal_census_id : number
|
|
8
|
+
readonly county_id : string
|
|
9
|
+
readonly tract_id : string
|
|
10
|
+
readonly block_id : string
|
|
11
|
+
readonly state_id : StateID
|
|
12
|
+
readonly name : string
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// }
|
|
14
|
+
constructor(federal_census_block : any) {
|
|
15
|
+
if (!FederalCensusBlock.is(federal_census_block)) {
|
|
16
|
+
throw Error("Invalid input.")
|
|
17
|
+
}
|
|
18
|
+
this.federal_census_block_id = federal_census_block.federal_census_block_id
|
|
19
|
+
this.federal_census_tract_id = federal_census_block.federal_census_tract_id
|
|
20
|
+
this.federal_census_county_id = federal_census_block.federal_census_county_id
|
|
21
|
+
this.federal_census_id = federal_census_block.federal_census_id
|
|
22
|
+
this.county_id = federal_census_block.county_id
|
|
23
|
+
this.tract_id = federal_census_block.tract_id
|
|
24
|
+
this.block_id = federal_census_block.block_id
|
|
25
|
+
this.state_id = federal_census_block.state_id
|
|
26
|
+
this.name = federal_census_block.name
|
|
27
|
+
}
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// }
|
|
29
|
+
static is(federal_census_block : any) : federal_census_block is FederalCensusBlock {
|
|
30
|
+
return (
|
|
31
|
+
federal_census_block !== undefined &&
|
|
32
|
+
typeof federal_census_block.federal_census_block_id === "string" &&
|
|
33
|
+
typeof federal_census_block.federal_census_tract_id === "string" &&
|
|
34
|
+
typeof federal_census_block.federal_census_county_id === "string" &&
|
|
35
|
+
typeof federal_census_block.federal_census_id === "number" &&
|
|
36
|
+
typeof federal_census_block.county_id === "string" &&
|
|
37
|
+
typeof federal_census_block.tract_id === "string" &&
|
|
38
|
+
typeof federal_census_block.block_id === "string" &&
|
|
39
|
+
is_state_id(federal_census_block.state_id) &&
|
|
40
|
+
typeof federal_census_block.name === "string"
|
|
41
|
+
)
|
|
42
|
+
}
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
}
|
|
@@ -1,41 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
import { is_state_id, StateID } from "../regions/State"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// readonly s3_id : string
|
|
3
|
+
export class FederalCensusTract {
|
|
4
|
+
readonly federal_census_tract_id : string
|
|
5
|
+
readonly federal_census_county_id : string
|
|
6
|
+
readonly federal_census_id : number
|
|
7
|
+
readonly county_id : string
|
|
8
|
+
readonly tract_id : string
|
|
9
|
+
readonly state_id : StateID
|
|
10
|
+
readonly name : string
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// }
|
|
12
|
+
constructor(federal_census_tract : any) {
|
|
13
|
+
if (!FederalCensusTract.is(federal_census_tract)) {
|
|
14
|
+
throw Error("Invalid input.")
|
|
15
|
+
}
|
|
16
|
+
this.federal_census_tract_id = federal_census_tract.federal_census_tract_id
|
|
17
|
+
this.federal_census_county_id = federal_census_tract.federal_census_county_id
|
|
18
|
+
this.federal_census_id = federal_census_tract.federal_census_id
|
|
19
|
+
this.county_id = federal_census_tract.county_id
|
|
20
|
+
this.tract_id = federal_census_tract.tract_id
|
|
21
|
+
this.state_id = federal_census_tract.state_id
|
|
22
|
+
this.name = federal_census_tract.name
|
|
23
|
+
}
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// }
|
|
25
|
+
static is(federal_census_tract : any) : federal_census_tract is FederalCensusTract {
|
|
26
|
+
return (
|
|
27
|
+
federal_census_tract !== undefined &&
|
|
28
|
+
typeof federal_census_tract.federal_census_tract_id === "string" &&
|
|
29
|
+
typeof federal_census_tract.federal_census_county_id === "string" &&
|
|
30
|
+
typeof federal_census_tract.federal_census_id === "number" &&
|
|
31
|
+
typeof federal_census_tract.county_id === "string" &&
|
|
32
|
+
typeof federal_census_tract.tract_id === "string" &&
|
|
33
|
+
is_state_id(federal_census_tract.state_id) &&
|
|
34
|
+
typeof federal_census_tract.name === "string"
|
|
35
|
+
)
|
|
36
|
+
}
|
|
40
37
|
|
|
41
|
-
|
|
38
|
+
}
|
|
@@ -28,7 +28,7 @@ export class LALFileVoter {
|
|
|
28
28
|
readonly address_mail_city? : string
|
|
29
29
|
readonly address_mail_state_id : string
|
|
30
30
|
readonly address_mail_zip_id? : string
|
|
31
|
-
readonly party_id : string
|
|
31
|
+
readonly party_id? : string
|
|
32
32
|
readonly party_type_id : VoterPartyTypeID
|
|
33
33
|
readonly lal_occupation_group_id? : string
|
|
34
34
|
readonly lal_occupation_id? : string
|
|
@@ -119,7 +119,7 @@ export class LALFileVoter {
|
|
|
119
119
|
(lal_file_voter.address_mail_city === undefined || typeof lal_file_voter.address_mail_city === "string") &&
|
|
120
120
|
typeof lal_file_voter.address_mail_state_id === "string" &&
|
|
121
121
|
(lal_file_voter.address_mail_zip_id === undefined || typeof lal_file_voter.address_mail_zip_id === "string") &&
|
|
122
|
-
typeof lal_file_voter.party_id === "string" &&
|
|
122
|
+
(lal_file_voter.party === undefined || typeof lal_file_voter.party_id === "string") &&
|
|
123
123
|
is_voter_party_type_id(lal_file_voter.party_type_id) &&
|
|
124
124
|
(lal_file_voter.lal_occupation_group_id === undefined || typeof lal_file_voter.lal_occupation_group_id === "string") &&
|
|
125
125
|
(lal_file_voter.lal_occupation_id === undefined || typeof lal_file_voter.lal_occupation_id === "string") &&
|