mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-20 21:07:37 +08:00
JsDoc types fixed and typecheck activated
This commit is contained in:
@@ -23,10 +23,6 @@ export default class IElement extends HTMLElement {
|
||||
/** @type {IContext[]} */
|
||||
inputObjects = []
|
||||
|
||||
/**
|
||||
* @param {IEntity} entity The entity containing blueprint related data for this graph element
|
||||
* @param {ITemplate} template The template to render this node
|
||||
*/
|
||||
constructor(entity, template) {
|
||||
super()
|
||||
this.blueprint = null
|
||||
|
||||
@@ -6,11 +6,11 @@ import MouseMoveNodes from "../input/mouse/MouseMoveNodes"
|
||||
|
||||
/**
|
||||
* @typedef {import("../template/SelectableDraggableTemplate").default} SelectableDraggableTemplate
|
||||
* @typedef {import("../entity/IntegerEntity").default} IntegerEntity
|
||||
*/
|
||||
export default class ISelectableDraggableElement extends IElement {
|
||||
|
||||
constructor(...args) {
|
||||
// @ts-expect-error
|
||||
super(...args)
|
||||
this.dragObject = null
|
||||
this.location = [0, 0]
|
||||
|
||||
@@ -21,7 +21,7 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
/** @type {NodeTemplate} */
|
||||
this.template
|
||||
this.dragLinkObjects = []
|
||||
super.setLocation([this.entity.NodePosX, this.entity.NodePosY])
|
||||
super.setLocation([this.entity.NodePosX.value, this.entity.NodePosY.value])
|
||||
}
|
||||
|
||||
static fromSerializedObject(str) {
|
||||
@@ -56,7 +56,9 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
|
||||
setLocation(value = [0, 0]) {
|
||||
let nodeType = this.entity.NodePosX.constructor
|
||||
// @ts-expect-error
|
||||
this.entity.NodePosX = new nodeType(value[0])
|
||||
// @ts-expect-error
|
||||
this.entity.NodePosY = new nodeType(value[1])
|
||||
super.setLocation(value)
|
||||
}
|
||||
|
||||
@@ -7,8 +7,9 @@ import ExecPinTemplate from "../template/ExecPinTemplate"
|
||||
import StringPinTemplate from "../template/StringPinTemplate"
|
||||
|
||||
/**
|
||||
* @typedef {import("./NodeElement").default} NodeElement
|
||||
* @typedef {import("../entity/GuidEntity").default} GuidEntity
|
||||
* @typedef {import("../entity/PinEntity").default} PinEntity
|
||||
* @typedef {import("./NodeElement").default} NodeElement
|
||||
*/
|
||||
export default class PinElement extends IElement {
|
||||
|
||||
@@ -34,7 +35,7 @@ export default class PinElement extends IElement {
|
||||
new (PinElement.#typeTemplateMap[entity.getType()] ?? PinTemplate)()
|
||||
)
|
||||
|
||||
/** @type {import("../entity/PinEntity").default} */
|
||||
/** @type {PinEntity} */
|
||||
this.entity
|
||||
|
||||
/** @type {PinTemplate} */
|
||||
|
||||
@@ -17,7 +17,7 @@ export default class SelectorElement extends IElement {
|
||||
|
||||
/**
|
||||
* Create a selection rectangle starting from the specified position
|
||||
* @param {number[]} initialPosition - Selection rectangle initial position (relative to the .ueb-grid element)
|
||||
* @param {Number[]} initialPosition - Selection rectangle initial position (relative to the .ueb-grid element)
|
||||
*/
|
||||
startSelecting(initialPosition) {
|
||||
this.template.applyStartSelecting(this, initialPosition)
|
||||
@@ -26,7 +26,7 @@ export default class SelectorElement extends IElement {
|
||||
|
||||
/**
|
||||
* Move selection rectagle to the specified final position. The initial position was specified by startSelecting()
|
||||
* @param {number[]} finalPosition - Selection rectangle final position (relative to the .ueb-grid element)
|
||||
* @param {Number[]} finalPosition - Selection rectangle final position (relative to the .ueb-grid element)
|
||||
*/
|
||||
doSelecting(finalPosition) {
|
||||
this.template.applyDoSelecting(this, finalPosition)
|
||||
|
||||
Reference in New Issue
Block a user