@duet3d/objectmodel 3.5.0-beta.20 → 3.5.0-beta.21
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/ModelObject.d.ts
CHANGED
|
@@ -24,15 +24,6 @@ export declare abstract class ModelObject implements IModelObject {
|
|
|
24
24
|
* @returns Updated instance (may not equal the original instance)
|
|
25
25
|
*/
|
|
26
26
|
update(jsonElement: any): IModelObject | null;
|
|
27
|
-
/**
|
|
28
|
-
* Called to check if a diverging property type may be set.
|
|
29
|
-
* Note that this is not applicable to null values; null is always legit
|
|
30
|
-
* @param key Property key
|
|
31
|
-
* @param oldValue Old member value
|
|
32
|
-
* @param newValue New member value
|
|
33
|
-
* @returns True if the value can be set by the update call
|
|
34
|
-
*/
|
|
35
|
-
protected checkDivergingDataType<K extends keyof this>(key: K, oldValue: typeof this[K], newValue: any): boolean;
|
|
36
27
|
/**
|
|
37
28
|
* Wrap a nullable model object property so that type checks can be performed
|
|
38
29
|
* @param key Property key of the derived class
|
package/dist/ModelObject.js
CHANGED
|
@@ -113,7 +113,7 @@ class ModelObject {
|
|
|
113
113
|
if (typeof value === "boolean") {
|
|
114
114
|
this[ownKey] = value;
|
|
115
115
|
}
|
|
116
|
-
else if (typeof value === "number"
|
|
116
|
+
else if (typeof value === "number") {
|
|
117
117
|
// RRF used to report booleans as integers so convert them if necessary
|
|
118
118
|
this[ownKey] = Boolean(value);
|
|
119
119
|
}
|
|
@@ -122,7 +122,7 @@ class ModelObject {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
else if (propType === "number") {
|
|
125
|
-
if (typeof value === "number" || typeof value === "bigint"
|
|
125
|
+
if (typeof value === "number" || typeof value === "bigint") {
|
|
126
126
|
this[ownKey] = value;
|
|
127
127
|
}
|
|
128
128
|
else if (process.env.NODE_ENV !== "production") {
|
|
@@ -130,7 +130,7 @@ class ModelObject {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
else if (propType === "bigint") {
|
|
133
|
-
if (typeof value === "number" || typeof value === "bigint"
|
|
133
|
+
if (typeof value === "number" || typeof value === "bigint") {
|
|
134
134
|
this[ownKey] = value;
|
|
135
135
|
}
|
|
136
136
|
else if (process.env.NODE_ENV !== "production") {
|
|
@@ -138,7 +138,7 @@ class ModelObject {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
else if (propType === "string") {
|
|
141
|
-
if (typeof value === "string"
|
|
141
|
+
if (typeof value === "string") {
|
|
142
142
|
this[ownKey] = value;
|
|
143
143
|
}
|
|
144
144
|
else if (process.env.NODE_ENV !== "production") {
|
|
@@ -146,7 +146,7 @@ class ModelObject {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
else if (propType === "function") {
|
|
149
|
-
if (typeof value === "function"
|
|
149
|
+
if (typeof value === "function") {
|
|
150
150
|
this[ownKey] = value;
|
|
151
151
|
}
|
|
152
152
|
else if (process.env.NODE_ENV !== "production") {
|
|
@@ -154,7 +154,7 @@ class ModelObject {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
else if (propType === "object") {
|
|
157
|
-
if (typeof value === "object"
|
|
157
|
+
if (typeof value === "object") {
|
|
158
158
|
this[ownKey] = value;
|
|
159
159
|
}
|
|
160
160
|
else if (process.env.NODE_ENV !== "production") {
|
|
@@ -169,17 +169,6 @@ class ModelObject {
|
|
|
169
169
|
}
|
|
170
170
|
return this;
|
|
171
171
|
}
|
|
172
|
-
/**
|
|
173
|
-
* Called to check if a diverging property type may be set.
|
|
174
|
-
* Note that this is not applicable to null values; null is always legit
|
|
175
|
-
* @param key Property key
|
|
176
|
-
* @param oldValue Old member value
|
|
177
|
-
* @param newValue New member value
|
|
178
|
-
* @returns True if the value can be set by the update call
|
|
179
|
-
*/
|
|
180
|
-
checkDivergingDataType(key, oldValue, newValue) {
|
|
181
|
-
return false;
|
|
182
|
-
}
|
|
183
172
|
/**
|
|
184
173
|
* Wrap a nullable model object property so that type checks can be performed
|
|
185
174
|
* @param key Property key of the derived class
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ModelObject from "../ModelObject";
|
|
1
|
+
import ModelObject, { IModelObject } from "../ModelObject";
|
|
2
2
|
export declare enum MessageBoxMode {
|
|
3
3
|
noButtons = 0,
|
|
4
4
|
closeOnly = 1,
|
|
@@ -21,6 +21,6 @@ export declare class MessageBox extends ModelObject {
|
|
|
21
21
|
seq: number;
|
|
22
22
|
timeout: number;
|
|
23
23
|
title: string;
|
|
24
|
-
|
|
24
|
+
update(jsonElement: any): IModelObject | null;
|
|
25
25
|
}
|
|
26
26
|
export default MessageBox;
|
package/dist/state/MessageBox.js
CHANGED
|
@@ -28,8 +28,11 @@ class MessageBox extends ModelObject_1.default {
|
|
|
28
28
|
this.timeout = 0;
|
|
29
29
|
this.title = "";
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
update(jsonElement) {
|
|
32
|
+
if (jsonElement instanceof Object && (typeof jsonElement.default === "number" || typeof jsonElement.default === "string")) {
|
|
33
|
+
this.default = jsonElement;
|
|
34
|
+
}
|
|
35
|
+
return super.update(jsonElement);
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
38
|
exports.MessageBox = MessageBox;
|