triangle-types 1.0.154 → 1.0.156

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.
@@ -46,6 +46,7 @@ export * from "./types/federal_rules/FederalRuleTitle.js";
46
46
  export * from "./types/federal_rules/FederalRuleSection.js";
47
47
  export * from "./types/fragments/Fragment.js";
48
48
  export * from "./types/fragments/FragmentVector.js";
49
+ export * from "./types/lal/LALFile.js";
49
50
  export * from "./types/legistar/LegistarAgency.js";
50
51
  export * from "./types/legistar/LegistarDocument.js";
51
52
  export * from "./types/prism/Prism.js";
package/dist/src/index.js CHANGED
@@ -46,6 +46,7 @@ export * from "./types/federal_rules/FederalRuleTitle.js";
46
46
  export * from "./types/federal_rules/FederalRuleSection.js";
47
47
  export * from "./types/fragments/Fragment.js";
48
48
  export * from "./types/fragments/FragmentVector.js";
49
+ export * from "./types/lal/LALFile.js";
49
50
  export * from "./types/legistar/LegistarAgency.js";
50
51
  export * from "./types/legistar/LegistarDocument.js";
51
52
  export * from "./types/prism/Prism.js";
@@ -0,0 +1,10 @@
1
+ import { StateID } from "../regions/State.js";
2
+ export declare class LALFile {
3
+ readonly lal_file_id: string;
4
+ readonly state_id: StateID;
5
+ readonly date: string;
6
+ readonly s3_id_zip: string;
7
+ readonly s3_id_prefix?: string;
8
+ constructor(lal_file: any);
9
+ static is(lal_file: any): lal_file is LALFile;
10
+ }
@@ -0,0 +1,26 @@
1
+ import { is_state_id } from "../regions/State.js";
2
+ export class LALFile {
3
+ lal_file_id;
4
+ state_id;
5
+ date;
6
+ s3_id_zip;
7
+ s3_id_prefix;
8
+ constructor(lal_file) {
9
+ if (!LALFile.is(lal_file)) {
10
+ throw Error("Invalid input.");
11
+ }
12
+ this.lal_file_id = lal_file.lal_file_id;
13
+ this.state_id = lal_file.state_id;
14
+ this.date = lal_file.date;
15
+ this.s3_id_zip = lal_file.s3_id_zip;
16
+ this.s3_id_prefix = lal_file.s3_id_prefix;
17
+ }
18
+ static is(lal_file) {
19
+ return (lal_file !== undefined &&
20
+ typeof lal_file.lal_file_id === "string" &&
21
+ is_state_id(lal_file.state_id) &&
22
+ typeof lal_file.date === "string" &&
23
+ typeof lal_file.s3_id_zip === "string" &&
24
+ (lal_file.s3_id_prefix === undefined || typeof lal_file.s3_id_prefix === "string"));
25
+ }
26
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.154",
3
+ "version": "1.0.156",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -56,6 +56,8 @@ export * from "./types/federal_rules/FederalRuleSection"
56
56
  export * from "./types/fragments/Fragment"
57
57
  export * from "./types/fragments/FragmentVector"
58
58
 
59
+ export * from "./types/lal/LALFile"
60
+
59
61
  export * from "./types/legistar/LegistarAgency"
60
62
  export * from "./types/legistar/LegistarDocument"
61
63
 
@@ -0,0 +1,31 @@
1
+ import { is_state_id, StateID } from "../regions/State"
2
+
3
+ export class LALFile {
4
+ readonly lal_file_id : string
5
+ readonly state_id : StateID
6
+ readonly date : string
7
+ readonly s3_id_zip : string
8
+ readonly s3_id_prefix? : string
9
+
10
+ constructor(lal_file : any) {
11
+ if (!LALFile.is(lal_file)) {
12
+ throw Error("Invalid input.")
13
+ }
14
+ this.lal_file_id = lal_file.lal_file_id
15
+ this.state_id = lal_file.state_id
16
+ this.date = lal_file.date
17
+ this.s3_id_zip = lal_file.s3_id_zip
18
+ this.s3_id_prefix = lal_file.s3_id_prefix
19
+ }
20
+
21
+ static is(lal_file : any) : lal_file is LALFile {
22
+ return (
23
+ lal_file !== undefined &&
24
+ typeof lal_file.lal_file_id === "string" &&
25
+ is_state_id(lal_file.state_id) &&
26
+ typeof lal_file.date === "string" &&
27
+ typeof lal_file.s3_id_zip === "string" &&
28
+ (lal_file.s3_id_prefix === undefined || typeof lal_file.s3_id_prefix === "string")
29
+ )
30
+ }
31
+ }