triangle-types 1.0.276 → 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
+ }
@@ -12,7 +12,7 @@ export declare class UserComment {
12
12
  constructor(user_comment: UserComment);
13
13
  static is(user_comment: any): user_comment is UserComment;
14
14
  }
15
- export declare class UserCommentAux {
15
+ export declare class UserCommentAux extends UserComment {
16
16
  readonly user: User;
17
17
  constructor(user_comment: UserCommentAux);
18
18
  static is(user_comment: any): user_comment is UserCommentAux;
@@ -30,12 +30,13 @@ export class UserComment {
30
30
  typeof user_comment.is_active === "boolean");
31
31
  }
32
32
  }
33
- export class UserCommentAux {
33
+ export class UserCommentAux extends UserComment {
34
34
  user;
35
35
  constructor(user_comment) {
36
36
  if (!UserCommentAux.is(user_comment)) {
37
37
  throw Error("Invalid Input.");
38
38
  }
39
+ super(user_comment);
39
40
  this.user = user_comment.user;
40
41
  }
41
42
  static is(user_comment) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.276",
3
+ "version": "1.0.278",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -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
  }
@@ -38,13 +38,14 @@ export class UserComment {
38
38
  }
39
39
  }
40
40
 
41
- export class UserCommentAux {
41
+ export class UserCommentAux extends UserComment {
42
42
  readonly user : User
43
43
 
44
44
  constructor(user_comment : UserCommentAux) {
45
45
  if (!UserCommentAux.is(user_comment)) {
46
46
  throw Error("Invalid Input.")
47
47
  }
48
+ super(user_comment)
48
49
  this.user = user_comment.user
49
50
  }
50
51