mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-04 14:27:29 +08:00
Large typedef import cleanup and smaller fixes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @typedef {import("./IElement").default} IElement
|
||||
* @typedef {import("./IElement.js").default} IElement
|
||||
* @typedef {new (...args) => IElement} ElementConstructor
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import IDraggableElement from "./IDraggableElement.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/WindowElement").default} WindowElement
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../template/IDraggableControlTemplate").default} IDraggableControlTemplate
|
||||
* @typedef {import("../element/WindowElement.js").default} WindowElement
|
||||
* @typedef {import("../entity/IEntity.js").default} IEntity
|
||||
* @typedef {import("../template/IDraggableControlTemplate.js").default} IDraggableControlTemplate
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,8 +3,8 @@ import IElement from "./IElement.js"
|
||||
import Utility from "../Utility.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../template/IDraggableTemplate").default} IDraggableTemplate
|
||||
* @typedef {import("../entity/IEntity.js").default} IEntity
|
||||
* @typedef {import("../template/IDraggableTemplate.js").default} IDraggableTemplate
|
||||
* @typedef {CustomEvent<{
|
||||
* value: [Number, Number]
|
||||
* }>} DragEvent
|
||||
|
||||
@@ -2,11 +2,10 @@ import { LitElement } from "lit"
|
||||
import Configuration from "../Configuration.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../Blueprint").default} Blueprint
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../input/IInput").default} IInput
|
||||
* @typedef {import("../template/ITemplate").default} ITemplate
|
||||
* @typedef {import("lit").PropertyDeclarations} PropertyDeclarations
|
||||
* @typedef {import("../Blueprint.js").default} Blueprint
|
||||
* @typedef {import("../entity/IEntity.js").default} IEntity
|
||||
* @typedef {import("../input/IInput.js").default} IInput
|
||||
* @typedef {import("../template/ITemplate.js").default} ITemplate
|
||||
* @typedef {import("lit").PropertyValues} PropertyValues
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import IElement from "./IElement.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../template/ITemplate").default} ITemplate
|
||||
* @typedef {import("../entity/IEntity.js").default} IEntity
|
||||
* @typedef {import("../template/ITemplate.js").default} ITemplate
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,9 +3,9 @@ import Utility from "../Utility.js"
|
||||
import IDraggableElement from "./IDraggableElement.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/IDraggableElement").DragEvent} DragEvent
|
||||
* @typedef {import("../entity/IEntity").default} IEntity
|
||||
* @typedef {import("../template/ISelectableDraggableTemplate").default} ISelectableDraggableTemplate
|
||||
* @typedef {import("../element/IDraggableElement.js").DragEvent} DragEvent
|
||||
* @typedef {import("../entity/IEntity.js").default} IEntity
|
||||
* @typedef {import("../template/ISelectableDraggableTemplate.js").default} ISelectableDraggableTemplate
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,8 @@ import SVGIcon from "../SVGIcon.js"
|
||||
import Utility from "../Utility.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../element/IDraggableElement").DragEvent} DragEvent
|
||||
* @typedef {import("./PinElement").default} PinElement
|
||||
* @typedef {import("../element/IDraggableElement.js").DragEvent} DragEvent
|
||||
* @typedef {import("./PinElement.js").default} PinElement
|
||||
* @typedef {import("lit").TemplateResult<1>} TemplateResult
|
||||
* @typedef {typeof LinkElement} LinkElementConstructor
|
||||
*/
|
||||
|
||||
@@ -13,11 +13,13 @@ import Utility from "../Utility.js"
|
||||
import VariableAccessNodeTemplate from "../template/node/VariableAccessNodeTemplate.js"
|
||||
import VariableConversionNodeTemplate from "../template/node/VariableConversionNodeTemplate.js"
|
||||
import VariableOperationNodeTemplate from "../template/node/VariableOperationNodeTemplate.js"
|
||||
import UnknownPinEntity from "../entity/UnknownPinEntity.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("./IDraggableElement").DragEvent} DragEvent
|
||||
* @typedef {import("./IElement").default} IElement
|
||||
* @typedef {import("./PinElement").default} PinElement
|
||||
* @typedef {import("./IDraggableElement.js").DragEvent} DragEvent
|
||||
* @typedef {import("./IElement.js").default} IElement
|
||||
* @typedef {import("../entity/ObjectReferenceEntity.js").default} ObjectReferenceEntity
|
||||
* @typedef {import("./PinElement.js").default} PinElement
|
||||
* @typedef {typeof NodeElement} NodeElementConstructor
|
||||
*/
|
||||
|
||||
@@ -278,7 +280,15 @@ export default class NodeElement extends ISelectableDraggableElement {
|
||||
|
||||
/** @returns {PinEntity[]} */
|
||||
getPinEntities() {
|
||||
return this.entity.CustomProperties.filter(v => v instanceof PinEntity)
|
||||
if (this.entity.CustomProperties.length > 0) {
|
||||
return this.entity.CustomProperties.filter(v => v instanceof PinEntity)
|
||||
}
|
||||
// Legacy nodes attempt to find pin entities
|
||||
if (this.entity.Pins) {
|
||||
return this.entity.Pins.map(objectReference =>
|
||||
new UnknownPinEntity(this.entity[Configuration.subObjectAttributeNameFromReference(objectReference)])
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
setLocation(x = 0, y = 0, acknowledge = true) {
|
||||
|
||||
@@ -21,9 +21,9 @@ import Vector2DPinTemplate from "../template/pin/Vector2DPinTemplate.js"
|
||||
import VectorPinTemplate from "../template/pin/VectorPinTemplate.js"
|
||||
|
||||
/**
|
||||
* @typedef {import("../entity/IEntity").AnyValue} AnyValue
|
||||
* @typedef {import("./LinkElement").LinkElementConstructor} LinkElementConstructor
|
||||
* @typedef {import("./NodeElement").default} NodeElement
|
||||
* @typedef {import("../entity/IEntity.js").AnyValue} AnyValue
|
||||
* @typedef {import("./LinkElement.js").LinkElementConstructor} LinkElementConstructor
|
||||
* @typedef {import("./NodeElement.js").default} NodeElement
|
||||
* @typedef {import("lit").CSSResult} CSSResult
|
||||
* @typedef {typeof PinElement} PinElementConstructor
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,7 @@ import FastSelectionModel from "../selection/FastSelectionModel.js"
|
||||
import IFromToPositionedElement from "./IFromToPositionedElement.js"
|
||||
import SelectorTemplate from "../template/SelectorTemplate.js"
|
||||
|
||||
/** @typedef {import("../Blueprint").BlueprintConstructor} BlueprintConstructor */
|
||||
/** @typedef {import("../Blueprint.js").BlueprintConstructor} BlueprintConstructor */
|
||||
|
||||
/** @extends {IFromToPositionedElement<Object, SelectorTemplate>} */
|
||||
export default class SelectorElement extends IFromToPositionedElement {
|
||||
|
||||
Reference in New Issue
Block a user