JsDoc types fixed and typecheck activated

This commit is contained in:
barsdeveloper
2022-03-30 21:59:41 +02:00
parent 464a9c068d
commit 90400110e2
33 changed files with 391 additions and 151 deletions

View File

@@ -7,20 +7,6 @@ import ObjectReferenceEntity from "./ObjectReferenceEntity"
import PinReferenceEntity from "./PinReferenceEntity"
import TypeInitialization from "./TypeInitialization"
/**
* @typedef {{
* PinCategory: String,
* PinSubCategory: String,
* PinSubCategoryObject: ObjectReferenceEntity,
* PinSubCategoryMemberReference: *,
* PinValueType: String,
* ContainerType: ObjectReferenceEntity,
* bIsReference: Boolean,
* bIsConst: Boolean,
* bIsWeakPointer: Boolean,
* bIsUObjectWrapper: Boolean,
* }} PinTypeObjectType
*/
export default class PinEntity extends IEntity {
static lookbehind = "Pin"
@@ -55,6 +41,40 @@ export default class PinEntity extends IEntity {
bOrphanedPin: false,
}
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,
* }}
*/ this.PinType
/** @type {PinReferenceEntity[]} */ this.LinkedTo
/** @type {String} */ 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
}
isInput() {
return !this.bHidden && this.Direction !== "EGPD_Output"
}
@@ -75,6 +95,7 @@ export default class PinEntity extends IEntity {
/** @type {PinReferenceEntity[]} */
this.LinkedTo
const linkFound = this.LinkedTo?.find(pinReferenceEntity => {
// @ts-ignore
return pinReferenceEntity.objectName == targetObjectName
&& pinReferenceEntity.pinGuid.valueOf() == targetPinEntity.PinId.valueOf()
})
@@ -96,6 +117,7 @@ export default class PinEntity extends IEntity {
/** @type {PinReferenceEntity[]} */
this.LinkedTo
const indexElement = this.LinkedTo.findIndex(pinReferenceEntity => {
// @ts-expect-error
return pinReferenceEntity.objectName == targetObjectName
&& pinReferenceEntity.pinGuid == targetPinEntity.PinId
})