triangle-types 1.0.263 → 1.0.265
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.
- package/dist/src/types/label/Label.d.ts +2 -1
- package/dist/src/types/label/Label.js +4 -1
- package/dist/src/types/web/WebDocumentFragment.d.ts +6 -0
- package/dist/src/types/web/WebDocumentFragment.js +15 -0
- package/package.json +1 -1
- package/src/types/label/Label.ts +5 -2
- package/src/types/web/WebDocumentFragment.ts +22 -0
|
@@ -2,6 +2,7 @@ export class Label {
|
|
|
2
2
|
label_id;
|
|
3
3
|
resource_type_id;
|
|
4
4
|
name;
|
|
5
|
+
description;
|
|
5
6
|
constructor(label) {
|
|
6
7
|
if (!Label.is(label)) {
|
|
7
8
|
throw Error("Invalid input.");
|
|
@@ -9,11 +10,13 @@ export class Label {
|
|
|
9
10
|
this.label_id = label.label_id;
|
|
10
11
|
this.resource_type_id = label.resource_type_id;
|
|
11
12
|
this.name = label.name;
|
|
13
|
+
this.description = label.description;
|
|
12
14
|
}
|
|
13
15
|
static is(label) {
|
|
14
16
|
return (label !== undefined &&
|
|
15
17
|
typeof label.label_id === "string" &&
|
|
16
18
|
typeof label.resource_type_id === "string" &&
|
|
17
|
-
|
|
19
|
+
typeof label.name === "string" &&
|
|
20
|
+
typeof label.description === "string");
|
|
18
21
|
}
|
|
19
22
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WebDocument } from "./WebDocument.js";
|
|
1
2
|
declare const fragment_type_ids: readonly ["LINE", "CHAR"];
|
|
2
3
|
export type FragmentTypeID = typeof fragment_type_ids[number];
|
|
3
4
|
export declare function is_fragment_type_id(fragment_type_id: any): fragment_type_id is FragmentTypeID;
|
|
@@ -15,4 +16,9 @@ export declare class WebDocumentFragment {
|
|
|
15
16
|
constructor(web_document_fragment: WebDocumentFragment);
|
|
16
17
|
static is(web_document_fragment: any): web_document_fragment is WebDocumentFragment;
|
|
17
18
|
}
|
|
19
|
+
export declare class WebDocumentFragmentAux extends WebDocumentFragment {
|
|
20
|
+
readonly web_document: WebDocument;
|
|
21
|
+
constructor(web_document_fragment: WebDocumentFragment);
|
|
22
|
+
static is(web_document_fragment: any): web_document_fragment is WebDocumentFragmentAux;
|
|
23
|
+
}
|
|
18
24
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WebDocument } from "./WebDocument.js";
|
|
1
2
|
const fragment_type_ids = ["LINE", "CHAR"];
|
|
2
3
|
export function is_fragment_type_id(fragment_type_id) {
|
|
3
4
|
return fragment_type_ids.includes(fragment_type_id);
|
|
@@ -39,3 +40,17 @@ export class WebDocumentFragment {
|
|
|
39
40
|
(web_document_fragment.vector === undefined || Array.isArray(web_document_fragment.vector) && web_document_fragment.vector.every((coordinate) => typeof coordinate === "number")));
|
|
40
41
|
}
|
|
41
42
|
}
|
|
43
|
+
export class WebDocumentFragmentAux extends WebDocumentFragment {
|
|
44
|
+
web_document;
|
|
45
|
+
constructor(web_document_fragment) {
|
|
46
|
+
if (!WebDocumentFragmentAux.is(web_document_fragment)) {
|
|
47
|
+
throw Error("Invalid input.");
|
|
48
|
+
}
|
|
49
|
+
super(web_document_fragment);
|
|
50
|
+
this.web_document = web_document_fragment.web_document;
|
|
51
|
+
}
|
|
52
|
+
static is(web_document_fragment) {
|
|
53
|
+
return (WebDocumentFragment.is(web_document_fragment) &&
|
|
54
|
+
WebDocument.is(web_document_fragment.web_document));
|
|
55
|
+
}
|
|
56
|
+
}
|
package/package.json
CHANGED
package/src/types/label/Label.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export class Label {
|
|
2
2
|
readonly label_id : string
|
|
3
3
|
readonly resource_type_id : string
|
|
4
|
-
readonly name
|
|
4
|
+
readonly name : string
|
|
5
|
+
readonly description : string
|
|
5
6
|
|
|
6
7
|
constructor(label : any) {
|
|
7
8
|
if (!Label.is(label)) {
|
|
@@ -10,6 +11,7 @@ export class Label {
|
|
|
10
11
|
this.label_id = label.label_id
|
|
11
12
|
this.resource_type_id = label.resource_type_id
|
|
12
13
|
this.name = label.name
|
|
14
|
+
this.description = label.description
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
static is(label : any) : label is Label {
|
|
@@ -17,7 +19,8 @@ export class Label {
|
|
|
17
19
|
label !== undefined &&
|
|
18
20
|
typeof label.label_id === "string" &&
|
|
19
21
|
typeof label.resource_type_id === "string" &&
|
|
20
|
-
|
|
22
|
+
typeof label.name === "string" &&
|
|
23
|
+
typeof label.description === "string"
|
|
21
24
|
)
|
|
22
25
|
}
|
|
23
26
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { WebDocument } from "./WebDocument"
|
|
2
|
+
|
|
1
3
|
const fragment_type_ids = ["LINE", "CHAR"] as const
|
|
2
4
|
|
|
3
5
|
export type FragmentTypeID = typeof fragment_type_ids[number]
|
|
@@ -47,4 +49,24 @@ export class WebDocumentFragment {
|
|
|
47
49
|
(web_document_fragment.vector === undefined || Array.isArray(web_document_fragment.vector) && web_document_fragment.vector.every((coordinate : any) => typeof coordinate === "number"))
|
|
48
50
|
)
|
|
49
51
|
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export class WebDocumentFragmentAux extends WebDocumentFragment {
|
|
55
|
+
readonly web_document : WebDocument
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
constructor(web_document_fragment : WebDocumentFragment) {
|
|
59
|
+
if (!WebDocumentFragmentAux.is(web_document_fragment)) {
|
|
60
|
+
throw Error("Invalid input.")
|
|
61
|
+
}
|
|
62
|
+
super(web_document_fragment)
|
|
63
|
+
this.web_document = web_document_fragment.web_document
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static is(web_document_fragment : any) : web_document_fragment is WebDocumentFragmentAux {
|
|
67
|
+
return (
|
|
68
|
+
WebDocumentFragment.is(web_document_fragment) &&
|
|
69
|
+
WebDocument.is(web_document_fragment.web_document)
|
|
70
|
+
)
|
|
71
|
+
}
|
|
50
72
|
}
|