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