triangle-types 1.0.277 → 1.0.278
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.
|
@@ -3,6 +3,12 @@ export declare class Label {
|
|
|
3
3
|
readonly resource_type_id: string;
|
|
4
4
|
readonly name: string;
|
|
5
5
|
readonly description: string;
|
|
6
|
+
readonly [x: string]: any;
|
|
7
|
+
constructor(label: any);
|
|
8
|
+
static is(label: any): label is Label;
|
|
9
|
+
}
|
|
10
|
+
export declare class LabelAux extends Label {
|
|
11
|
+
readonly num_resources: number;
|
|
6
12
|
constructor(label: any);
|
|
7
13
|
static is(label: any): label is Label;
|
|
8
14
|
}
|
|
@@ -20,3 +20,17 @@ export class Label {
|
|
|
20
20
|
typeof label.description === "string");
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
export class LabelAux extends Label {
|
|
24
|
+
num_resources;
|
|
25
|
+
constructor(label) {
|
|
26
|
+
if (!LabelAux.is(label)) {
|
|
27
|
+
throw Error("Invalid input.");
|
|
28
|
+
}
|
|
29
|
+
super(label);
|
|
30
|
+
this.num_resources = label.num_resources;
|
|
31
|
+
}
|
|
32
|
+
static is(label) {
|
|
33
|
+
return (Label.is(label) &&
|
|
34
|
+
typeof label.num_resources === "number");
|
|
35
|
+
}
|
|
36
|
+
}
|
package/package.json
CHANGED
package/src/types/label/Label.ts
CHANGED
|
@@ -3,6 +3,7 @@ export class Label {
|
|
|
3
3
|
readonly resource_type_id : string
|
|
4
4
|
readonly name : string
|
|
5
5
|
readonly description : string
|
|
6
|
+
readonly [x : string] : any
|
|
6
7
|
|
|
7
8
|
constructor(label : any) {
|
|
8
9
|
if (!Label.is(label)) {
|
|
@@ -23,4 +24,23 @@ export class Label {
|
|
|
23
24
|
typeof label.description === "string"
|
|
24
25
|
)
|
|
25
26
|
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class LabelAux extends Label {
|
|
30
|
+
readonly num_resources : number
|
|
31
|
+
|
|
32
|
+
constructor(label : any) {
|
|
33
|
+
if (!LabelAux.is(label)) {
|
|
34
|
+
throw Error("Invalid input.")
|
|
35
|
+
}
|
|
36
|
+
super(label)
|
|
37
|
+
this.num_resources = label.num_resources
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static is(label : any) : label is Label {
|
|
41
|
+
return (
|
|
42
|
+
Label.is(label) &&
|
|
43
|
+
typeof label.num_resources === "number"
|
|
44
|
+
)
|
|
45
|
+
}
|
|
26
46
|
}
|