triangle-types 1.0.157 → 1.0.159
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/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/types/federal_census/FederalCensusBlock.d.ts +1 -0
- package/dist/src/types/federal_census/FederalCensusBlock.js +4 -1
- package/dist/src/types/federal_census/FederalCensusCity.d.ts +11 -0
- package/dist/src/types/federal_census/FederalCensusCity.js +29 -0
- package/dist/src/types/federal_census/FederalCensusCounty.d.ts +3 -2
- package/dist/src/types/federal_census/FederalCensusCounty.js +15 -12
- package/dist/src/types/federal_census/FederalCensusTract.d.ts +1 -0
- package/dist/src/types/federal_census/FederalCensusTract.js +4 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/types/federal_census/FederalCensusBlock.ts +4 -1
- package/src/types/federal_census/FederalCensusCity.ts +35 -0
- package/src/types/federal_census/FederalCensusCounty.ts +15 -12
- package/src/types/federal_census/FederalCensusTract.ts +4 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./types/youtube/YoutubeVideo.js";
|
|
|
10
10
|
export * from "./types/youtube/YoutubeVideoTag.js";
|
|
11
11
|
export * from "./types/federal_census/FederalCensus.js";
|
|
12
12
|
export * from "./types/federal_census/FederalCensusBlock.js";
|
|
13
|
+
export * from "./types/federal_census/FederalCensusCity.js";
|
|
13
14
|
export * from "./types/federal_census/FederalCensusCounty.js";
|
|
14
15
|
export * from "./types/federal_census/FederalCensusTract.js";
|
|
15
16
|
export * from "./types/federal_elections/FederalElection.js";
|
package/dist/src/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./types/youtube/YoutubeVideo.js";
|
|
|
10
10
|
export * from "./types/youtube/YoutubeVideoTag.js";
|
|
11
11
|
export * from "./types/federal_census/FederalCensus.js";
|
|
12
12
|
export * from "./types/federal_census/FederalCensusBlock.js";
|
|
13
|
+
export * from "./types/federal_census/FederalCensusCity.js";
|
|
13
14
|
export * from "./types/federal_census/FederalCensusCounty.js";
|
|
14
15
|
export * from "./types/federal_census/FederalCensusTract.js";
|
|
15
16
|
export * from "./types/federal_elections/FederalElection.js";
|
|
@@ -8,6 +8,7 @@ export declare class FederalCensusBlock {
|
|
|
8
8
|
readonly tract_id: string;
|
|
9
9
|
readonly block_id: string;
|
|
10
10
|
readonly state_id: StateID;
|
|
11
|
+
readonly name: string;
|
|
11
12
|
constructor(federal_census_block: any);
|
|
12
13
|
static is(federal_census_block: any): federal_census_block is FederalCensusBlock;
|
|
13
14
|
}
|
|
@@ -8,6 +8,7 @@ export class FederalCensusBlock {
|
|
|
8
8
|
tract_id;
|
|
9
9
|
block_id;
|
|
10
10
|
state_id;
|
|
11
|
+
name;
|
|
11
12
|
constructor(federal_census_block) {
|
|
12
13
|
if (!FederalCensusBlock.is(federal_census_block)) {
|
|
13
14
|
throw Error("Invalid input.");
|
|
@@ -20,6 +21,7 @@ export class FederalCensusBlock {
|
|
|
20
21
|
this.tract_id = federal_census_block.tract_id;
|
|
21
22
|
this.block_id = federal_census_block.block_id;
|
|
22
23
|
this.state_id = federal_census_block.state_id;
|
|
24
|
+
this.name = federal_census_block.name;
|
|
23
25
|
}
|
|
24
26
|
static is(federal_census_block) {
|
|
25
27
|
return (federal_census_block !== undefined &&
|
|
@@ -30,6 +32,7 @@ export class FederalCensusBlock {
|
|
|
30
32
|
typeof federal_census_block.county_id === "string" &&
|
|
31
33
|
typeof federal_census_block.tract_id === "string" &&
|
|
32
34
|
typeof federal_census_block.block_id === "string" &&
|
|
33
|
-
is_state_id(federal_census_block.state_id)
|
|
35
|
+
is_state_id(federal_census_block.state_id) &&
|
|
36
|
+
typeof federal_census_block.name === "string");
|
|
34
37
|
}
|
|
35
38
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StateID } from "../regions/State.js";
|
|
2
|
+
export declare class FederalCensusCity {
|
|
3
|
+
readonly federal_census_city_id: string;
|
|
4
|
+
readonly federal_census_id: number;
|
|
5
|
+
readonly city_id: string;
|
|
6
|
+
readonly state_id: StateID;
|
|
7
|
+
readonly city_type_id?: string;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
constructor(federal_census_city: any);
|
|
10
|
+
static is(federal_census_city: any): federal_census_city is FederalCensusCity;
|
|
11
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { is_state_id } from "../regions/State.js";
|
|
2
|
+
export class FederalCensusCity {
|
|
3
|
+
federal_census_city_id;
|
|
4
|
+
federal_census_id;
|
|
5
|
+
city_id;
|
|
6
|
+
state_id;
|
|
7
|
+
city_type_id;
|
|
8
|
+
name;
|
|
9
|
+
constructor(federal_census_city) {
|
|
10
|
+
if (!FederalCensusCity.is(federal_census_city)) {
|
|
11
|
+
throw Error("Invalid input.");
|
|
12
|
+
}
|
|
13
|
+
this.federal_census_city_id = federal_census_city.federal_census_city_id;
|
|
14
|
+
this.federal_census_id = federal_census_city.federal_census_id;
|
|
15
|
+
this.city_id = federal_census_city.city_id;
|
|
16
|
+
this.state_id = federal_census_city.state_id;
|
|
17
|
+
this.city_type_id = federal_census_city.city_type_id;
|
|
18
|
+
this.name = federal_census_city.name;
|
|
19
|
+
}
|
|
20
|
+
static is(federal_census_city) {
|
|
21
|
+
return (federal_census_city !== undefined &&
|
|
22
|
+
typeof federal_census_city.federal_census_city_id === "string" &&
|
|
23
|
+
typeof federal_census_city.federal_census_id === "number" &&
|
|
24
|
+
typeof federal_census_city.city_id === "string" &&
|
|
25
|
+
is_state_id(federal_census_city.state_id) &&
|
|
26
|
+
(federal_census_city.city_type_id === undefined || typeof federal_census_city.city_type_id === "string") &&
|
|
27
|
+
typeof federal_census_city.name === "string");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -4,6 +4,7 @@ export declare class FederalCensusCounty {
|
|
|
4
4
|
readonly federal_census_id: number;
|
|
5
5
|
readonly county_id: string;
|
|
6
6
|
readonly state_id: StateID;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
readonly name: string;
|
|
8
|
+
constructor(federal_census_county: any);
|
|
9
|
+
static is(federal_census_county: any): federal_census_county is FederalCensusCounty;
|
|
9
10
|
}
|
|
@@ -4,20 +4,23 @@ export class FederalCensusCounty {
|
|
|
4
4
|
federal_census_id;
|
|
5
5
|
county_id;
|
|
6
6
|
state_id;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
name;
|
|
8
|
+
constructor(federal_census_county) {
|
|
9
|
+
if (!FederalCensusCounty.is(federal_census_county)) {
|
|
9
10
|
throw Error("Invalid input.");
|
|
10
11
|
}
|
|
11
|
-
this.federal_census_county_id =
|
|
12
|
-
this.federal_census_id =
|
|
13
|
-
this.county_id =
|
|
14
|
-
this.state_id =
|
|
12
|
+
this.federal_census_county_id = federal_census_county.federal_census_county_id;
|
|
13
|
+
this.federal_census_id = federal_census_county.federal_census_id;
|
|
14
|
+
this.county_id = federal_census_county.county_id;
|
|
15
|
+
this.state_id = federal_census_county.state_id;
|
|
16
|
+
this.name = federal_census_county.name;
|
|
15
17
|
}
|
|
16
|
-
static is(
|
|
17
|
-
return (
|
|
18
|
-
typeof
|
|
19
|
-
typeof
|
|
20
|
-
typeof
|
|
21
|
-
is_state_id(
|
|
18
|
+
static is(federal_census_county) {
|
|
19
|
+
return (federal_census_county !== undefined &&
|
|
20
|
+
typeof federal_census_county.federal_census_county_id === "string" &&
|
|
21
|
+
typeof federal_census_county.federal_census_id === "number" &&
|
|
22
|
+
typeof federal_census_county.county_id === "string" &&
|
|
23
|
+
is_state_id(federal_census_county.state_id) &&
|
|
24
|
+
typeof federal_census_county.name === "string");
|
|
22
25
|
}
|
|
23
26
|
}
|
|
@@ -6,6 +6,7 @@ export declare class FederalCensusTract {
|
|
|
6
6
|
readonly county_id: string;
|
|
7
7
|
readonly tract_id: string;
|
|
8
8
|
readonly state_id: StateID;
|
|
9
|
+
readonly name: string;
|
|
9
10
|
constructor(federal_census_tract: any);
|
|
10
11
|
static is(federal_census_tract: any): federal_census_tract is FederalCensusTract;
|
|
11
12
|
}
|
|
@@ -6,6 +6,7 @@ export class FederalCensusTract {
|
|
|
6
6
|
county_id;
|
|
7
7
|
tract_id;
|
|
8
8
|
state_id;
|
|
9
|
+
name;
|
|
9
10
|
constructor(federal_census_tract) {
|
|
10
11
|
if (!FederalCensusTract.is(federal_census_tract)) {
|
|
11
12
|
throw Error("Invalid input.");
|
|
@@ -16,6 +17,7 @@ export class FederalCensusTract {
|
|
|
16
17
|
this.county_id = federal_census_tract.county_id;
|
|
17
18
|
this.tract_id = federal_census_tract.tract_id;
|
|
18
19
|
this.state_id = federal_census_tract.state_id;
|
|
20
|
+
this.name = federal_census_tract.name;
|
|
19
21
|
}
|
|
20
22
|
static is(federal_census_tract) {
|
|
21
23
|
return (federal_census_tract !== undefined &&
|
|
@@ -24,6 +26,7 @@ export class FederalCensusTract {
|
|
|
24
26
|
typeof federal_census_tract.federal_census_id === "number" &&
|
|
25
27
|
typeof federal_census_tract.county_id === "string" &&
|
|
26
28
|
typeof federal_census_tract.tract_id === "string" &&
|
|
27
|
-
is_state_id(federal_census_tract.state_id)
|
|
29
|
+
is_state_id(federal_census_tract.state_id) &&
|
|
30
|
+
typeof federal_census_tract.name === "string");
|
|
28
31
|
}
|
|
29
32
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./types/youtube/YoutubeVideoTag"
|
|
|
13
13
|
|
|
14
14
|
export * from "./types/federal_census/FederalCensus"
|
|
15
15
|
export * from "./types/federal_census/FederalCensusBlock"
|
|
16
|
+
export * from "./types/federal_census/FederalCensusCity"
|
|
16
17
|
export * from "./types/federal_census/FederalCensusCounty"
|
|
17
18
|
export * from "./types/federal_census/FederalCensusTract"
|
|
18
19
|
|
|
@@ -9,6 +9,7 @@ export class FederalCensusBlock {
|
|
|
9
9
|
readonly tract_id : string
|
|
10
10
|
readonly block_id : string
|
|
11
11
|
readonly state_id : StateID
|
|
12
|
+
readonly name : string
|
|
12
13
|
|
|
13
14
|
constructor(federal_census_block : any) {
|
|
14
15
|
if (!FederalCensusBlock.is(federal_census_block)) {
|
|
@@ -22,6 +23,7 @@ export class FederalCensusBlock {
|
|
|
22
23
|
this.tract_id = federal_census_block.tract_id
|
|
23
24
|
this.block_id = federal_census_block.block_id
|
|
24
25
|
this.state_id = federal_census_block.state_id
|
|
26
|
+
this.name = federal_census_block.name
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
static is(federal_census_block : any) : federal_census_block is FederalCensusBlock {
|
|
@@ -34,7 +36,8 @@ export class FederalCensusBlock {
|
|
|
34
36
|
typeof federal_census_block.county_id === "string" &&
|
|
35
37
|
typeof federal_census_block.tract_id === "string" &&
|
|
36
38
|
typeof federal_census_block.block_id === "string" &&
|
|
37
|
-
is_state_id(federal_census_block.state_id)
|
|
39
|
+
is_state_id(federal_census_block.state_id) &&
|
|
40
|
+
typeof federal_census_block.name === "string"
|
|
38
41
|
)
|
|
39
42
|
}
|
|
40
43
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { is_state_id, StateID } from "../regions/State"
|
|
2
|
+
|
|
3
|
+
export class FederalCensusCity {
|
|
4
|
+
readonly federal_census_city_id : string
|
|
5
|
+
readonly federal_census_id : number
|
|
6
|
+
readonly city_id : string
|
|
7
|
+
readonly state_id : StateID
|
|
8
|
+
readonly city_type_id? : string
|
|
9
|
+
readonly name : string
|
|
10
|
+
|
|
11
|
+
constructor(federal_census_city : any) {
|
|
12
|
+
if (!FederalCensusCity.is(federal_census_city)) {
|
|
13
|
+
throw Error("Invalid input.")
|
|
14
|
+
}
|
|
15
|
+
this.federal_census_city_id = federal_census_city.federal_census_city_id
|
|
16
|
+
this.federal_census_id = federal_census_city.federal_census_id
|
|
17
|
+
this.city_id = federal_census_city.city_id
|
|
18
|
+
this.state_id = federal_census_city.state_id
|
|
19
|
+
this.city_type_id = federal_census_city.city_type_id
|
|
20
|
+
this.name = federal_census_city.name
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static is(federal_census_city : any) : federal_census_city is FederalCensusCity {
|
|
24
|
+
return (
|
|
25
|
+
federal_census_city !== undefined &&
|
|
26
|
+
typeof federal_census_city.federal_census_city_id === "string" &&
|
|
27
|
+
typeof federal_census_city.federal_census_id === "number" &&
|
|
28
|
+
typeof federal_census_city.city_id === "string" &&
|
|
29
|
+
is_state_id(federal_census_city.state_id) &&
|
|
30
|
+
(federal_census_city.city_type_id === undefined || typeof federal_census_city.city_type_id === "string") &&
|
|
31
|
+
typeof federal_census_city.name === "string"
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
@@ -5,24 +5,27 @@ export class FederalCensusCounty {
|
|
|
5
5
|
readonly federal_census_id : number
|
|
6
6
|
readonly county_id : string
|
|
7
7
|
readonly state_id : StateID
|
|
8
|
+
readonly name : string
|
|
8
9
|
|
|
9
|
-
constructor(
|
|
10
|
-
if (!FederalCensusCounty.is(
|
|
10
|
+
constructor(federal_census_county : any) {
|
|
11
|
+
if (!FederalCensusCounty.is(federal_census_county)) {
|
|
11
12
|
throw Error("Invalid input.")
|
|
12
13
|
}
|
|
13
|
-
this.federal_census_county_id =
|
|
14
|
-
this.federal_census_id =
|
|
15
|
-
this.county_id =
|
|
16
|
-
this.state_id =
|
|
14
|
+
this.federal_census_county_id = federal_census_county.federal_census_county_id
|
|
15
|
+
this.federal_census_id = federal_census_county.federal_census_id
|
|
16
|
+
this.county_id = federal_census_county.county_id
|
|
17
|
+
this.state_id = federal_census_county.state_id
|
|
18
|
+
this.name = federal_census_county.name
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
static is(
|
|
21
|
+
static is(federal_census_county : any) : federal_census_county is FederalCensusCounty {
|
|
20
22
|
return (
|
|
21
|
-
|
|
22
|
-
typeof
|
|
23
|
-
typeof
|
|
24
|
-
typeof
|
|
25
|
-
is_state_id(
|
|
23
|
+
federal_census_county !== undefined &&
|
|
24
|
+
typeof federal_census_county.federal_census_county_id === "string" &&
|
|
25
|
+
typeof federal_census_county.federal_census_id === "number" &&
|
|
26
|
+
typeof federal_census_county.county_id === "string" &&
|
|
27
|
+
is_state_id(federal_census_county.state_id) &&
|
|
28
|
+
typeof federal_census_county.name === "string"
|
|
26
29
|
)
|
|
27
30
|
}
|
|
28
31
|
|
|
@@ -7,6 +7,7 @@ export class FederalCensusTract {
|
|
|
7
7
|
readonly county_id : string
|
|
8
8
|
readonly tract_id : string
|
|
9
9
|
readonly state_id : StateID
|
|
10
|
+
readonly name : string
|
|
10
11
|
|
|
11
12
|
constructor(federal_census_tract : any) {
|
|
12
13
|
if (!FederalCensusTract.is(federal_census_tract)) {
|
|
@@ -18,6 +19,7 @@ export class FederalCensusTract {
|
|
|
18
19
|
this.county_id = federal_census_tract.county_id
|
|
19
20
|
this.tract_id = federal_census_tract.tract_id
|
|
20
21
|
this.state_id = federal_census_tract.state_id
|
|
22
|
+
this.name = federal_census_tract.name
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
static is(federal_census_tract : any) : federal_census_tract is FederalCensusTract {
|
|
@@ -28,7 +30,8 @@ export class FederalCensusTract {
|
|
|
28
30
|
typeof federal_census_tract.federal_census_id === "number" &&
|
|
29
31
|
typeof federal_census_tract.county_id === "string" &&
|
|
30
32
|
typeof federal_census_tract.tract_id === "string" &&
|
|
31
|
-
is_state_id(federal_census_tract.state_id)
|
|
33
|
+
is_state_id(federal_census_tract.state_id) &&
|
|
34
|
+
typeof federal_census_tract.name === "string"
|
|
32
35
|
)
|
|
33
36
|
}
|
|
34
37
|
|