triangle-types 1.0.270 → 1.0.272

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.
Files changed (109) hide show
  1. package/dist/src/index.d.ts +6 -4
  2. package/dist/src/index.js +6 -4
  3. package/dist/src/types/ballotpedia/BallotpediaOffice.d.ts +1 -1
  4. package/dist/src/types/ballotpedia/BallotpediaOffice.js +1 -1
  5. package/dist/src/types/federal_census/FederalCensusBlock.d.ts +1 -1
  6. package/dist/src/types/federal_census/FederalCensusBlock.js +1 -1
  7. package/dist/src/types/federal_census/FederalCensusCounty.d.ts +1 -1
  8. package/dist/src/types/federal_census/FederalCensusCounty.js +1 -1
  9. package/dist/src/types/federal_census/FederalCensusMunicipality.d.ts +1 -1
  10. package/dist/src/types/federal_census/FederalCensusMunicipality.js +1 -1
  11. package/dist/src/types/federal_census/FederalCensusSchoolDistrict.d.ts +1 -1
  12. package/dist/src/types/federal_census/FederalCensusSchoolDistrict.js +1 -1
  13. package/dist/src/types/federal_census/FederalCensusTract.d.ts +1 -1
  14. package/dist/src/types/federal_census/FederalCensusTract.js +1 -1
  15. package/dist/src/types/federal_congress/FederalCongress.d.ts +1 -1
  16. package/dist/src/types/federal_congress/FederalCongress.js +1 -1
  17. package/dist/src/types/federal_congress/FederalCongressDistrict.d.ts +1 -1
  18. package/dist/src/types/federal_congress/FederalCongressDistrict.js +1 -1
  19. package/dist/src/types/federal_congress/FederalCongressMember.d.ts +1 -1
  20. package/dist/src/types/federal_congress/FederalCongressMember.js +1 -1
  21. package/dist/src/types/federal_elections/FederalElection.d.ts +1 -1
  22. package/dist/src/types/federal_elections/FederalElection.js +1 -1
  23. package/dist/src/types/federal_elections/FederalElectionCandidate.d.ts +1 -1
  24. package/dist/src/types/federal_elections/FederalElectionCandidate.js +1 -1
  25. package/dist/src/types/federal_elections/FederalElectionDonation.d.ts +1 -1
  26. package/dist/src/types/federal_elections/FederalElectionF2File.d.ts +1 -1
  27. package/dist/src/types/federal_elections/FederalElectionF2File.js +1 -1
  28. package/dist/src/types/jurisdictions/County.d.ts +18 -0
  29. package/dist/src/types/jurisdictions/County.js +44 -0
  30. package/dist/src/types/jurisdictions/JurisdictionMetric.d.ts +10 -0
  31. package/dist/src/types/jurisdictions/JurisdictionMetric.js +23 -0
  32. package/dist/src/types/jurisdictions/JurisdictionTypeID.d.ts +3 -0
  33. package/dist/src/types/jurisdictions/JurisdictionTypeID.js +4 -0
  34. package/dist/src/types/jurisdictions/Municipality.d.ts +17 -0
  35. package/dist/src/types/jurisdictions/Municipality.js +41 -0
  36. package/dist/src/types/jurisdictions/SchoolDistrict.d.ts +16 -0
  37. package/dist/src/types/jurisdictions/SchoolDistrict.js +38 -0
  38. package/dist/src/types/jurisdictions/State.d.ts +12 -0
  39. package/dist/src/types/jurisdictions/State.js +364 -0
  40. package/dist/src/types/lal/LALFile.d.ts +1 -1
  41. package/dist/src/types/lal/LALFile.js +1 -1
  42. package/dist/src/types/lal/LALFileVoter.d.ts +1 -1
  43. package/dist/src/types/lal/LALFileVoter.js +1 -1
  44. package/dist/src/types/prism/Prism.d.ts +4 -6
  45. package/dist/src/types/prism/Prism.js +8 -16
  46. package/dist/src/types/prism/StateVoter.d.ts +1 -1
  47. package/dist/src/types/prism/StateVoter.js +1 -1
  48. package/dist/src/types/prism/StateVoterFeature.d.ts +1 -1
  49. package/dist/src/types/prism/StateVoterFeature.js +1 -1
  50. package/dist/src/types/prism/StateVoterTarget.d.ts +1 -1
  51. package/dist/src/types/prism/StateVoterTarget.js +1 -1
  52. package/dist/src/types/prism/Voter.d.ts +1 -1
  53. package/dist/src/types/prism/Voter.js +1 -1
  54. package/dist/src/types/prism/VoterFeature.d.ts +1 -1
  55. package/dist/src/types/prism/VoterFeature.js +1 -1
  56. package/dist/src/types/prism/VoterTarget.d.ts +1 -1
  57. package/dist/src/types/prism/VoterTarget.js +1 -1
  58. package/dist/src/types/regions/SchoolDistrict.d.ts +7 -0
  59. package/dist/src/types/regions/SchoolDistrict.js +15 -0
  60. package/dist/src/types/state_legislature/StateLegislatureDistrict.d.ts +1 -1
  61. package/dist/src/types/state_legislature/StateLegislatureDistrict.js +1 -1
  62. package/dist/src/types/state_permits/StateFacility.d.ts +1 -1
  63. package/dist/src/types/state_permits/StateFacility.js +1 -1
  64. package/dist/src/types/state_permits/StatePermit.d.ts +1 -1
  65. package/dist/src/types/state_permits/StatePermit.js +1 -1
  66. package/dist/src/types/state_permits/StatePermitDocument.d.ts +1 -1
  67. package/dist/src/types/state_permits/StatePermitDocument.js +1 -1
  68. package/dist/src/types/state_permits/StatePermitDocumentSource.d.ts +1 -1
  69. package/dist/src/types/state_permits/StatePermitDocumentSource.js +1 -1
  70. package/dist/src/types/state_permits/StatePermitDocumentSourcePollutant.d.ts +1 -1
  71. package/dist/src/types/state_permits/StatePermitDocumentSourcePollutant.js +1 -1
  72. package/package.json +1 -1
  73. package/src/index.ts +7 -5
  74. package/src/types/ballotpedia/BallotpediaOffice.ts +1 -1
  75. package/src/types/federal_census/FederalCensusBlock.ts +1 -1
  76. package/src/types/federal_census/FederalCensusCounty.ts +1 -1
  77. package/src/types/federal_census/FederalCensusMunicipality.ts +1 -1
  78. package/src/types/federal_census/FederalCensusSchoolDistrict.ts +1 -1
  79. package/src/types/federal_census/FederalCensusTract.ts +1 -1
  80. package/src/types/federal_congress/FederalCongress.ts +1 -1
  81. package/src/types/federal_congress/FederalCongressDistrict.ts +1 -1
  82. package/src/types/federal_congress/FederalCongressMember.ts +1 -1
  83. package/src/types/federal_elections/FederalElection.ts +1 -1
  84. package/src/types/federal_elections/FederalElectionCandidate.ts +1 -1
  85. package/src/types/federal_elections/FederalElectionDonation.ts +1 -1
  86. package/src/types/federal_elections/FederalElectionF2File.ts +1 -1
  87. package/src/types/jurisdictions/JurisdictionMetric.ts +29 -0
  88. package/src/types/jurisdictions/JurisdictionTypeID.ts +7 -0
  89. package/src/types/{regions → jurisdictions}/SchoolDistrict.ts +22 -0
  90. package/src/types/lal/LALFile.ts +1 -1
  91. package/src/types/lal/LALFileVoter.ts +1 -1
  92. package/src/types/prism/Prism.ts +8 -16
  93. package/src/types/prism/StateVoter.ts +1 -1
  94. package/src/types/prism/StateVoterFeature.ts +1 -1
  95. package/src/types/prism/StateVoterTarget.ts +1 -1
  96. package/src/types/prism/TenantVoterTag.ts +1 -1
  97. package/src/types/prism/Voter.ts +1 -1
  98. package/src/types/prism/VoterFeature.ts +1 -1
  99. package/src/types/prism/VoterTarget.ts +1 -1
  100. package/src/types/state_legislature/StateLegislatureDistrict.ts +1 -1
  101. package/src/types/state_permits/KY/KYStateFacility.ts +1 -1
  102. package/src/types/state_permits/StateFacility.ts +1 -1
  103. package/src/types/state_permits/StatePermit.ts +1 -1
  104. package/src/types/state_permits/StatePermitDocument.ts +1 -1
  105. package/src/types/state_permits/StatePermitDocumentSource.ts +1 -1
  106. package/src/types/state_permits/StatePermitDocumentSourcePollutant.ts +1 -1
  107. /package/src/types/{regions → jurisdictions}/County.ts +0 -0
  108. /package/src/types/{regions → jurisdictions}/Municipality.ts +0 -0
  109. /package/src/types/{regions → jurisdictions}/State.ts +0 -0
@@ -55,6 +55,12 @@ export * from "./types/federal_dockets/FederalDocketComment.js";
55
55
  export * from "./types/federal_dockets/FederalDocketCommentAttachment.js";
56
56
  export * from "./types/federal_rules/FederalRuleTitle.js";
57
57
  export * from "./types/federal_rules/FederalRuleSection.js";
58
+ export * from "./types/jurisdictions/County.js";
59
+ export * from "./types/jurisdictions/JurisdictionMetric.js";
60
+ export * from "./types/jurisdictions/JurisdictionTypeID.js";
61
+ export * from "./types/jurisdictions/Municipality.js";
62
+ export * from "./types/jurisdictions/SchoolDistrict.js";
63
+ export * from "./types/jurisdictions/State.js";
58
64
  export * from "./types/label/Label.js";
59
65
  export * from "./types/lal/LALFile.js";
60
66
  export * from "./types/lal/LALFileVoter.js";
@@ -73,10 +79,6 @@ export * from "./types/prism/StateVoterTarget.js";
73
79
  export * from "./types/prism/Voter.js";
74
80
  export * from "./types/prism/VoterFeature.js";
75
81
  export * from "./types/prism/VoterTarget.js";
76
- export * from "./types/regions/County.js";
77
- export * from "./types/regions/Municipality.js";
78
- export * from "./types/regions/SchoolDistrict.js";
79
- export * from "./types/regions/State.js";
80
82
  export * from "./types/scout/Scout.js";
81
83
  export * from "./types/scout/UserScout.js";
82
84
  export * from "./types/scout/UserScoutConversation.js";
package/dist/src/index.js CHANGED
@@ -55,6 +55,12 @@ export * from "./types/federal_dockets/FederalDocketComment.js";
55
55
  export * from "./types/federal_dockets/FederalDocketCommentAttachment.js";
56
56
  export * from "./types/federal_rules/FederalRuleTitle.js";
57
57
  export * from "./types/federal_rules/FederalRuleSection.js";
58
+ export * from "./types/jurisdictions/County.js";
59
+ export * from "./types/jurisdictions/JurisdictionMetric.js";
60
+ export * from "./types/jurisdictions/JurisdictionTypeID.js";
61
+ export * from "./types/jurisdictions/Municipality.js";
62
+ export * from "./types/jurisdictions/SchoolDistrict.js";
63
+ export * from "./types/jurisdictions/State.js";
58
64
  export * from "./types/label/Label.js";
59
65
  export * from "./types/lal/LALFile.js";
60
66
  export * from "./types/lal/LALFileVoter.js";
@@ -73,10 +79,6 @@ export * from "./types/prism/StateVoterTarget.js";
73
79
  export * from "./types/prism/Voter.js";
74
80
  export * from "./types/prism/VoterFeature.js";
75
81
  export * from "./types/prism/VoterTarget.js";
76
- export * from "./types/regions/County.js";
77
- export * from "./types/regions/Municipality.js";
78
- export * from "./types/regions/SchoolDistrict.js";
79
- export * from "./types/regions/State.js";
80
82
  export * from "./types/scout/Scout.js";
81
83
  export * from "./types/scout/UserScout.js";
82
84
  export * from "./types/scout/UserScoutConversation.js";
@@ -1,4 +1,4 @@
1
- import { StateID } from "../regions/State.js";
1
+ import { StateID } from "../jurisdictions/State.js";
2
2
  declare const ballotpedia_office_type_ids: readonly ["F", "S", "L"];
3
3
  export type BallotpediaOfficeTypeID = typeof ballotpedia_office_type_ids[number];
4
4
  export declare function is_ballotpedia_office_type_id(ballotpedia_office_type_id: any): ballotpedia_office_type_id is BallotpediaOfficeTypeID;
@@ -1,4 +1,4 @@
1
- import { is_state_id } from "../regions/State.js";
1
+ import { is_state_id } from "../jurisdictions/State.js";
2
2
  const ballotpedia_office_type_ids = ["F", "S", "L"];
3
3
  export function is_ballotpedia_office_type_id(ballotpedia_office_type_id) {
4
4
  return ballotpedia_office_type_ids.includes(ballotpedia_office_type_id);
@@ -1,4 +1,4 @@
1
- import { StateID } from "../regions/State.js";
1
+ import { StateID } from "../jurisdictions/State.js";
2
2
  export declare class FederalCensusBlock {
3
3
  readonly federal_census_block_id: string;
4
4
  readonly federal_census_tract_id: string;
@@ -1,4 +1,4 @@
1
- import { is_state_id } from "../regions/State.js";
1
+ import { is_state_id } from "../jurisdictions/State.js";
2
2
  export class FederalCensusBlock {
3
3
  federal_census_block_id;
4
4
  federal_census_tract_id;
@@ -1,4 +1,4 @@
1
- import { StateID } from "../regions/State.js";
1
+ import { StateID } from "../jurisdictions/State.js";
2
2
  export declare class FederalCensusCounty {
3
3
  readonly federal_census_county_id: string;
4
4
  readonly federal_census_id: number;
@@ -1,4 +1,4 @@
1
- import { is_state_id } from "../regions/State.js";
1
+ import { is_state_id } from "../jurisdictions/State.js";
2
2
  export class FederalCensusCounty {
3
3
  federal_census_county_id;
4
4
  federal_census_id;
@@ -1,4 +1,4 @@
1
- import { StateID } from "../regions/State.js";
1
+ import { StateID } from "../jurisdictions/State.js";
2
2
  export declare class FederalCensusMunicipality {
3
3
  readonly federal_census_municipality_id: string;
4
4
  readonly federal_census_id: number;
@@ -1,4 +1,4 @@
1
- import { is_state_id } from "../regions/State.js";
1
+ import { is_state_id } from "../jurisdictions/State.js";
2
2
  export class FederalCensusMunicipality {
3
3
  federal_census_municipality_id;
4
4
  federal_census_id;
@@ -1,4 +1,4 @@
1
- import { StateID } from "../regions/State.js";
1
+ import { StateID } from "../jurisdictions/State.js";
2
2
  export declare const federal_census_school_district_type_ids: readonly ["UNIFIED", "PRIMARY", "SECONDARY"];
3
3
  export type FederalCensusSchoolDistrictTypeID = typeof federal_census_school_district_type_ids[number];
4
4
  export declare function is_federal_census_school_district_type_id(federal_census_school_district_type_id: any): federal_census_school_district_type_id is FederalCensusSchoolDistrictTypeID;
@@ -1,4 +1,4 @@
1
- import { is_state_id } from "../regions/State.js";
1
+ import { is_state_id } from "../jurisdictions/State.js";
2
2
  export const federal_census_school_district_type_ids = ["UNIFIED", "PRIMARY", "SECONDARY"];
3
3
  export function is_federal_census_school_district_type_id(federal_census_school_district_type_id) {
4
4
  return federal_census_school_district_type_ids.includes(federal_census_school_district_type_id);
@@ -1,4 +1,4 @@
1
- import { StateID } from "../regions/State.js";
1
+ import { StateID } from "../jurisdictions/State.js";
2
2
  export declare class FederalCensusTract {
3
3
  readonly federal_census_tract_id: string;
4
4
  readonly federal_census_county_id: string;
@@ -1,4 +1,4 @@
1
- import { is_state_id } from "../regions/State.js";
1
+ import { is_state_id } from "../jurisdictions/State.js";
2
2
  export class FederalCensusTract {
3
3
  federal_census_tract_id;
4
4
  federal_census_county_id;
@@ -1,4 +1,4 @@
1
- import { StateID } from "../regions/State.js";
1
+ import { StateID } from "../jurisdictions/State.js";
2
2
  export declare class FederalCongress {
3
3
  readonly federal_congress_id: number;
4
4
  readonly redistrict_state_ids: StateID[];
@@ -1,4 +1,4 @@
1
- import { is_state_id } from "../regions/State.js";
1
+ import { is_state_id } from "../jurisdictions/State.js";
2
2
  export class FederalCongress {
3
3
  federal_congress_id;
4
4
  redistrict_state_ids;
@@ -1,4 +1,4 @@
1
- import { StateID } from "../regions/State.js";
1
+ import { StateID } from "../jurisdictions/State.js";
2
2
  export declare class FederalCongressDistrict {
3
3
  readonly federal_congress_district_id: string;
4
4
  readonly federal_congress_id: number;
@@ -1,4 +1,4 @@
1
- import { is_state_id } from "../regions/State.js";
1
+ import { is_state_id } from "../jurisdictions/State.js";
2
2
  export class FederalCongressDistrict {
3
3
  federal_congress_district_id;
4
4
  federal_congress_id;
@@ -1,4 +1,4 @@
1
- import { StateID } from "../regions/State.js";
1
+ import { StateID } from "../jurisdictions/State.js";
2
2
  export declare class FederalCongressMember {
3
3
  readonly federal_congress_member_id: string;
4
4
  readonly name: string;
@@ -1,4 +1,4 @@
1
- import { is_state_id } from "../regions/State.js";
1
+ import { is_state_id } from "../jurisdictions/State.js";
2
2
  export class FederalCongressMember {
3
3
  federal_congress_member_id;
4
4
  name;
@@ -1,7 +1,7 @@
1
1
  import { FederalElectionCandidateAux } from "./FederalElectionCandidate.js";
2
2
  import { FederalElectionCommitteeAux } from "./FederalElectionCommittee.js";
3
3
  import { FederalElectionFileExpenditureAux } from "./FederalElectionFileExpenditure.js";
4
- import { StateID } from "../regions/State.js";
4
+ import { StateID } from "../jurisdictions/State.js";
5
5
  export declare const federal_election_office_ids: readonly ["H", "S", "P"];
6
6
  export type FederalElectionOfficeID = typeof federal_election_office_ids[number];
7
7
  export declare function is_federal_election_office_id(federal_election_office_id: any): federal_election_office_id is FederalElectionOfficeID;
@@ -1,7 +1,7 @@
1
1
  import { FederalElectionCandidateAux } from "./FederalElectionCandidate.js";
2
2
  import { FederalElectionCommitteeAux } from "./FederalElectionCommittee.js";
3
3
  import { FederalElectionFileExpenditureAux } from "./FederalElectionFileExpenditure.js";
4
- import { is_state_id } from "../regions/State.js";
4
+ import { is_state_id } from "../jurisdictions/State.js";
5
5
  export const federal_election_office_ids = ["H", "S", "P"];
6
6
  export function is_federal_election_office_id(federal_election_office_id) {
7
7
  return federal_election_office_ids.includes(federal_election_office_id);
@@ -2,7 +2,7 @@ import { FederalElectionCommitteeAux } from "./FederalElectionCommittee.js";
2
2
  import { FederalElectionOfficeID } from "./FederalElection.js";
3
3
  import { FederalElectionFileExpenditureAux } from "./FederalElectionFileExpenditure.js";
4
4
  import { FederalElectionF3File } from "./FederalElectionF3File.js";
5
- import { StateID } from "../regions/State.js";
5
+ import { StateID } from "../jurisdictions/State.js";
6
6
  export declare class FederalElectionCandidate {
7
7
  readonly federal_election_candidate_id: string;
8
8
  readonly name_prefix?: string;
@@ -2,7 +2,7 @@ import { FederalElectionCommitteeAux } from "./FederalElectionCommittee.js";
2
2
  import { is_federal_election_office_id } from "./FederalElection.js";
3
3
  import { FederalElectionFileExpenditureAux } from "./FederalElectionFileExpenditure.js";
4
4
  import { FederalElectionF3File } from "./FederalElectionF3File.js";
5
- import { is_state_id } from "../regions/State.js";
5
+ import { is_state_id } from "../jurisdictions/State.js";
6
6
  // export class ActivityIndex {
7
7
  // readonly news_index : number
8
8
  // readonly twitter_index : number
@@ -1,4 +1,4 @@
1
- import { StateID } from "../regions/State.js";
1
+ import { StateID } from "../jurisdictions/State.js";
2
2
  export declare class FederalElectionDonation {
3
3
  readonly federal_election_donation_id: string;
4
4
  readonly receipt_date: string;
@@ -1,6 +1,6 @@
1
1
  import { FederalElectionOfficeID } from "./FederalElection.js";
2
2
  import { FederalElectionFile } from "./FederalElectionFile.js";
3
- import { StateID } from "../regions/State.js";
3
+ import { StateID } from "../jurisdictions/State.js";
4
4
  export declare class FederalElectionF2File extends FederalElectionFile {
5
5
  readonly federal_election_candidate_id: string;
6
6
  readonly name_prefix?: string;
@@ -1,6 +1,6 @@
1
1
  import { is_federal_election_office_id } from "./FederalElection.js";
2
2
  import { FederalElectionFile } from "./FederalElectionFile.js";
3
- import { is_state_id } from "../regions/State.js";
3
+ import { is_state_id } from "../jurisdictions/State.js";
4
4
  export class FederalElectionF2File extends FederalElectionFile {
5
5
  federal_election_candidate_id;
6
6
  name_prefix;
@@ -0,0 +1,18 @@
1
+ import { FederalCensusCounty } from "../federal_census/FederalCensusCounty.js";
2
+ import { StateID } from "./State.js";
3
+ export declare class County {
4
+ readonly county_id: string;
5
+ readonly state_id: StateID;
6
+ readonly county_type_id: string;
7
+ readonly function_type_id: string;
8
+ readonly name: string;
9
+ readonly federal_census_county_id: string;
10
+ readonly [x: string]: any;
11
+ constructor(county: any);
12
+ static is(county: any): county is County;
13
+ }
14
+ export declare class CountyAux extends County {
15
+ readonly federal_census_county: FederalCensusCounty;
16
+ constructor(county: CountyAux);
17
+ static is(county: any): county is CountyAux;
18
+ }
@@ -0,0 +1,44 @@
1
+ import { FederalCensusCounty } from "../federal_census/FederalCensusCounty.js";
2
+ import { is_state_id } from "./State.js";
3
+ export class County {
4
+ county_id;
5
+ state_id;
6
+ county_type_id;
7
+ function_type_id;
8
+ name;
9
+ federal_census_county_id;
10
+ constructor(county) {
11
+ if (!County.is(county)) {
12
+ throw Error("Invalid input.");
13
+ }
14
+ this.county_id = county.county_id;
15
+ this.state_id = county.state_id;
16
+ this.county_type_id = county.county_type_id;
17
+ this.function_type_id = county.function_type_id;
18
+ this.name = county.name;
19
+ this.federal_census_county_id = county.federal_census_county_id;
20
+ }
21
+ static is(county) {
22
+ return (county !== undefined &&
23
+ typeof county.county_id === "string" &&
24
+ is_state_id(county.state_id) &&
25
+ typeof county.county_type_id === "string" &&
26
+ typeof county.function_type_id === "string" &&
27
+ typeof county.name === "string" &&
28
+ typeof county.federal_census_county_id === "string");
29
+ }
30
+ }
31
+ export class CountyAux extends County {
32
+ federal_census_county;
33
+ constructor(county) {
34
+ if (!CountyAux.is(county)) {
35
+ throw Error("Invalid input.");
36
+ }
37
+ super(county);
38
+ this.federal_census_county = county.federal_census_county;
39
+ }
40
+ static is(county) {
41
+ return (County.is(county) &&
42
+ FederalCensusCounty.is(county.federal_census_county));
43
+ }
44
+ }
@@ -0,0 +1,10 @@
1
+ import { JurisdictionTypeID } from "./JurisdictionTypeID.js";
2
+ export declare class JurisdictionMetric {
3
+ readonly jurisdiction_type_id: JurisdictionTypeID;
4
+ readonly jurisdiction_id: string;
5
+ readonly metric_id: string;
6
+ readonly value: number;
7
+ readonly [x: string]: any;
8
+ constructor(jurisdiction_metric: any);
9
+ static is(jurisdiction_metric: any): jurisdiction_metric is JurisdictionMetric;
10
+ }
@@ -0,0 +1,23 @@
1
+ import { is_jurisdiction_type_id } from "./JurisdictionTypeID.js";
2
+ export class JurisdictionMetric {
3
+ jurisdiction_type_id;
4
+ jurisdiction_id;
5
+ metric_id;
6
+ value;
7
+ constructor(jurisdiction_metric) {
8
+ if (!JurisdictionMetric.is(jurisdiction_metric)) {
9
+ throw Error("Invalid input.");
10
+ }
11
+ this.jurisdiction_type_id = jurisdiction_metric.jurisdiction_type_id;
12
+ this.jurisdiction_id = jurisdiction_metric.jurisdiction_id;
13
+ this.metric_id = jurisdiction_metric.metric_id;
14
+ this.value = jurisdiction_metric.value;
15
+ }
16
+ static is(jurisdiction_metric) {
17
+ return (jurisdiction_metric !== undefined &&
18
+ is_jurisdiction_type_id(jurisdiction_metric.jurisdiction_type_id) &&
19
+ typeof jurisdiction_metric.jurisdiction_id === "string" &&
20
+ typeof jurisdiction_metric.metric_id === "string" &&
21
+ typeof jurisdiction_metric.value === "number");
22
+ }
23
+ }
@@ -0,0 +1,3 @@
1
+ export declare const jurisdiction_type_ids: readonly ["state", "federal_congress_district", "state_legislature_district", "county", "municipality", "school_district"];
2
+ export type JurisdictionTypeID = typeof jurisdiction_type_ids[number];
3
+ export declare function is_jurisdiction_type_id(jurisdiction_type_id: any): jurisdiction_type_id is JurisdictionTypeID;
@@ -0,0 +1,4 @@
1
+ export const jurisdiction_type_ids = ["state", "federal_congress_district", "state_legislature_district", "county", "municipality", "school_district"];
2
+ export function is_jurisdiction_type_id(jurisdiction_type_id) {
3
+ return jurisdiction_type_ids.includes(jurisdiction_type_id);
4
+ }
@@ -0,0 +1,17 @@
1
+ import { FederalCensusMunicipality } from "../federal_census/FederalCensusMunicipality.js";
2
+ import { StateID } from "./State.js";
3
+ export declare class Municipality {
4
+ readonly municipality_id: string;
5
+ readonly state_id: StateID;
6
+ readonly municipality_type_id?: string;
7
+ readonly name: string;
8
+ readonly federal_census_municipality_id: string;
9
+ readonly [x: string]: any;
10
+ constructor(municipality: any);
11
+ static is(municipality: any): municipality is Municipality;
12
+ }
13
+ export declare class MunicipalityAux extends Municipality {
14
+ readonly federal_census_municipality: FederalCensusMunicipality;
15
+ constructor(municipality: MunicipalityAux);
16
+ static is(municipality: any): municipality is MunicipalityAux;
17
+ }
@@ -0,0 +1,41 @@
1
+ import { FederalCensusMunicipality } from "../federal_census/FederalCensusMunicipality.js";
2
+ import { is_state_id } from "./State.js";
3
+ export class Municipality {
4
+ municipality_id;
5
+ state_id;
6
+ municipality_type_id;
7
+ name;
8
+ federal_census_municipality_id;
9
+ constructor(municipality) {
10
+ if (!Municipality.is(municipality)) {
11
+ throw Error("Invalid input.");
12
+ }
13
+ this.municipality_id = municipality.municipality_id;
14
+ this.state_id = municipality.state_id;
15
+ this.municipality_type_id = municipality.municipality_type_id;
16
+ this.name = municipality.name;
17
+ this.federal_census_municipality_id = municipality.federal_census_municipality_id;
18
+ }
19
+ static is(municipality) {
20
+ return (municipality !== undefined &&
21
+ typeof municipality.municipality_id === "string" &&
22
+ is_state_id(municipality.state_id) &&
23
+ (municipality.municipality_type_id === undefined || typeof municipality.municipality_type_id === "string") &&
24
+ typeof municipality.name === "string" &&
25
+ typeof municipality.federal_census_municipality_id === "string");
26
+ }
27
+ }
28
+ export class MunicipalityAux extends Municipality {
29
+ federal_census_municipality;
30
+ constructor(municipality) {
31
+ if (!MunicipalityAux.is(municipality)) {
32
+ throw Error("Invalid input.");
33
+ }
34
+ super(municipality);
35
+ this.federal_census_municipality = municipality.federal_census_municipality;
36
+ }
37
+ static is(municipality) {
38
+ return (Municipality.is(municipality) &&
39
+ FederalCensusMunicipality.is(municipality.federal_census_municipality));
40
+ }
41
+ }
@@ -0,0 +1,16 @@
1
+ import { FederalCensusSchoolDistrict } from "../federal_census/FederalCensusSchoolDistrict.js";
2
+ import { StateID } from "./State.js";
3
+ export declare class SchoolDistrict {
4
+ readonly school_district_id: string;
5
+ readonly state_id: StateID;
6
+ readonly name: string;
7
+ readonly federal_census_school_district_id: string;
8
+ readonly [x: string]: any;
9
+ constructor(school_district: any);
10
+ static is(school_district: any): school_district is SchoolDistrict;
11
+ }
12
+ export declare class SchoolDistrictAux extends SchoolDistrict {
13
+ readonly federal_census_school_district: FederalCensusSchoolDistrict;
14
+ constructor(school_district: SchoolDistrictAux);
15
+ static is(school_district: any): school_district is SchoolDistrictAux;
16
+ }
@@ -0,0 +1,38 @@
1
+ import { FederalCensusSchoolDistrict } from "../federal_census/FederalCensusSchoolDistrict.js";
2
+ import { is_state_id } from "./State.js";
3
+ export class SchoolDistrict {
4
+ school_district_id;
5
+ state_id;
6
+ name;
7
+ federal_census_school_district_id;
8
+ constructor(school_district) {
9
+ if (!SchoolDistrict.is(school_district)) {
10
+ throw Error("Invalid input.");
11
+ }
12
+ this.school_district_id = school_district.school_district_id;
13
+ this.state_id = school_district.state_id;
14
+ this.name = school_district.name;
15
+ this.federal_census_school_district_id = school_district.federal_census_school_district_id;
16
+ }
17
+ static is(school_district) {
18
+ return (school_district !== undefined &&
19
+ typeof school_district.school_district_id === "string" &&
20
+ is_state_id(school_district.state_id) &&
21
+ typeof school_district.name === "string" &&
22
+ typeof school_district.federal_census_school_district_id === "string");
23
+ }
24
+ }
25
+ export class SchoolDistrictAux extends SchoolDistrict {
26
+ federal_census_school_district;
27
+ constructor(school_district) {
28
+ if (!SchoolDistrictAux.is(school_district)) {
29
+ throw Error("Invalid input.");
30
+ }
31
+ super(school_district);
32
+ this.federal_census_school_district = school_district.federal_census_school_district;
33
+ }
34
+ static is(school_district) {
35
+ return (SchoolDistrict.is(school_district) &&
36
+ FederalCensusSchoolDistrict.is(school_district.federal_census_school_district));
37
+ }
38
+ }
@@ -0,0 +1,12 @@
1
+ export declare const state_ids: readonly ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "DC", "PR", "AS", "GU", "MP", "VI"];
2
+ export type StateID = typeof state_ids[number];
3
+ export declare function is_state_id(state_id: any): state_id is StateID;
4
+ export declare class State {
5
+ readonly state_id: StateID;
6
+ readonly name: string;
7
+ readonly federal_census_state_id: string;
8
+ readonly is_territory: boolean;
9
+ constructor(state: any);
10
+ static is(state: any): state is State;
11
+ }
12
+ export declare const states_by_state_id: Record<StateID, State>;