triangle-types 1.0.228 → 1.0.229
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.
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { FederalCongressMember } from "../federal_congress/FederalCongressMember.js";
|
|
2
|
+
import { FederalElectionCandidate } from "../federal_elections/FederalElectionCandidate.js";
|
|
1
3
|
export declare class Scout {
|
|
2
4
|
readonly scout_id: string;
|
|
3
5
|
readonly name?: string;
|
|
@@ -9,8 +11,8 @@ export declare class Scout {
|
|
|
9
11
|
static is(scout: any): scout is Scout;
|
|
10
12
|
}
|
|
11
13
|
export declare class ScoutAux extends Scout {
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
+
readonly federal_election_candidates: FederalElectionCandidate[];
|
|
15
|
+
readonly federal_congress_member?: FederalCongressMember;
|
|
14
16
|
constructor(scout: any);
|
|
15
17
|
static is(scout: any): scout is ScoutAux;
|
|
16
18
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { FederalCongressMember } from "../federal_congress/FederalCongressMember.js";
|
|
2
|
+
import { FederalElectionCandidate } from "../federal_elections/FederalElectionCandidate.js";
|
|
1
3
|
// const scout_type_ids = ["I", "O"] as const
|
|
2
4
|
// export type ScoutTypeID = typeof scout_type_ids[number]
|
|
3
5
|
// export function is_scout_type_id(scout_type_id : any) : scout_type_id is ScoutTypeID {
|
|
@@ -32,20 +34,20 @@ export class Scout {
|
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
export class ScoutAux extends Scout {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
federal_election_candidates;
|
|
38
|
+
federal_congress_member;
|
|
37
39
|
constructor(scout) {
|
|
38
40
|
if (!ScoutAux.is(scout)) {
|
|
39
41
|
throw Error("Invalid input.");
|
|
40
42
|
}
|
|
41
43
|
super(scout);
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
44
|
+
this.federal_election_candidates = scout.federal_election_candidates;
|
|
45
|
+
this.federal_congress_member = scout.federal_congress_member;
|
|
44
46
|
}
|
|
45
47
|
static is(scout) {
|
|
46
48
|
return (Scout.is(scout) &&
|
|
47
|
-
Array.isArray(scout.
|
|
48
|
-
(scout.
|
|
49
|
+
Array.isArray(scout.federal_election_candidates) && scout.federal_election_candidates.every(FederalElectionCandidate.is) &&
|
|
50
|
+
(scout.federal_congress_member === undefined || FederalCongressMember.is(scout.federal_congress_member)));
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
// const scout_office_ids = ["USP", "USH", "USS", "STG", "STH", "STS"] as const
|
package/package.json
CHANGED
package/src/types/scout/Scout.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { FederalCongressMember } from "../federal_congress/FederalCongressMember"
|
|
2
|
+
import { FederalElectionCandidate } from "../federal_elections/FederalElectionCandidate"
|
|
1
3
|
import { DocumentTypeID, is_document_type_id } from "../fragments/Fragment"
|
|
2
4
|
import { StateID } from "../regions/State"
|
|
3
5
|
|
|
@@ -44,23 +46,23 @@ export class Scout {
|
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
export class ScoutAux extends Scout {
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
49
|
+
readonly federal_election_candidates : FederalElectionCandidate[]
|
|
50
|
+
readonly federal_congress_member? : FederalCongressMember
|
|
49
51
|
|
|
50
52
|
constructor(scout : any) {
|
|
51
53
|
if (!ScoutAux.is(scout)) {
|
|
52
54
|
throw Error("Invalid input.")
|
|
53
55
|
}
|
|
54
56
|
super(scout)
|
|
55
|
-
this.
|
|
56
|
-
this.
|
|
57
|
+
this.federal_election_candidates = scout.federal_election_candidates
|
|
58
|
+
this.federal_congress_member = scout.federal_congress_member
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
static is(scout : any) : scout is ScoutAux {
|
|
60
62
|
return (
|
|
61
63
|
Scout.is(scout) &&
|
|
62
|
-
Array.isArray(scout.
|
|
63
|
-
(scout.
|
|
64
|
+
Array.isArray(scout.federal_election_candidates) && scout.federal_election_candidates.every(FederalElectionCandidate.is) &&
|
|
65
|
+
(scout.federal_congress_member === undefined || FederalCongressMember.is(scout.federal_congress_member))
|
|
64
66
|
)
|
|
65
67
|
}
|
|
66
68
|
}
|