JSDoc complete type check

This commit is contained in:
barsdeveloper
2022-10-09 11:43:28 +02:00
parent 91e1e0885e
commit cdc5e5b91b
68 changed files with 1603 additions and 648 deletions

View File

@@ -11,6 +11,9 @@ import SimpleSerializationVectorEntity from "./SimpleSerializationVectorEntity"
import TypeInitialization from "./TypeInitialization"
import VectorEntity from "./VectorEntity"
/** @typedef {import("./TypeInitialization").AnyValue} AnyValue */
/** @template {AnyValue} T */
export default class PinEntity extends IEntity {
static #typeEntityMap = {
@@ -76,6 +79,41 @@ export default class PinEntity extends IEntity {
: entity
}
constructor(options = {}) {
super(options)
/** @type {GuidEntity} */ this.PinId
/** @type {String} */ this.PinName
/** @type {LocalizedTextEntity} */ this.PinFriendlyName
/** @type {String} */ this.PinToolTip
/** @type {String} */ this.Direction
/**
* @type {{
* PinCategory: String,
* PinSubCategory: String,
* PinSubCategoryObject: ObjectReferenceEntity,
* PinSubCategoryMemberReference: any,
* PinValueType: String,
* ContainerType: ObjectReferenceEntity,
* bIsReference: Boolean,
* bIsConst: Boolean,
* bIsWeakPointer: Boolean,
* bIsUObjectWrapper: Boolean,
* bSerializeAsSinglePrecisionFloat: Boolean,
* }}
*/ this.PinType
/** @type {PinReferenceEntity[]} */ this.LinkedTo
/** @type {T} */ this.DefaultValue
/** @type {String} */ this.AutogeneratedDefaultValue
/** @type {ObjectReferenceEntity} */ this.DefaultObject
/** @type {GuidEntity} */ this.PersistentGuid
/** @type {Boolean} */ this.bHidden
/** @type {Boolean} */ this.bNotConnectable
/** @type {Boolean} */ this.bDefaultValueIsReadOnly
/** @type {Boolean} */ this.bDefaultValueIsIgnored
/** @type {Boolean} */ this.bAdvancedView
/** @type {Boolean} */ this.bOrphanedPin
}
getType() {
if (this.PinType.PinCategory == "struct") {
return this.PinType.PinSubCategoryObject.path
@@ -84,7 +122,7 @@ export default class PinEntity extends IEntity {
}
getDefaultValue() {
return this.DefaultValue ?? ""
return this.DefaultValue
}
isHidden() {
@@ -111,7 +149,7 @@ export default class PinEntity extends IEntity {
/** @type {PinReferenceEntity[]} */
this.LinkedTo
const linkFound = this.LinkedTo?.find(pinReferenceEntity => {
return pinReferenceEntity.objectName == targetObjectName
return pinReferenceEntity.objectName.toString() == targetObjectName
&& pinReferenceEntity.pinGuid.valueOf() == targetPinEntity.PinId.valueOf()
})
if (!linkFound) {
@@ -130,7 +168,7 @@ export default class PinEntity extends IEntity {
*/
unlinkFrom(targetObjectName, targetPinEntity) {
const indexElement = this.LinkedTo?.findIndex(pinReferenceEntity => {
return pinReferenceEntity.objectName == targetObjectName
return pinReferenceEntity.objectName.toString() == targetObjectName
&& pinReferenceEntity.pinGuid.valueOf() == targetPinEntity.PinId.valueOf()
})
if (indexElement >= 0) {