Skip to content

Commit d1a8bac

Browse files
eightHundredsliujuping
authored andcommitted
fix(designer): node.ts cannot generate declaration file
1 parent adb9f6b commit d1a8bac

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

  • packages/designer/src/document/node

packages/designer/src/document/node/node.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ export class Node<Schema extends IPublicTypeNodeSchema = IPublicTypeNodeSchema>
392392

393393
this.isInited = true;
394394
this.emitter = createModuleEventBus('Node');
395-
const editor = this.document.designer.editor;
395+
const { editor } = this.document.designer;
396396
this.onVisibleChange((visible: boolean) => {
397397
editor?.eventBus.emit(EDITOR_EVENT.NODE_VISIBLE_CHANGE, this, visible);
398398
});
@@ -1219,11 +1219,18 @@ export class Node<Schema extends IPublicTypeNodeSchema = IPublicTypeNodeSchema>
12191219
/**
12201220
* 获取磁贴相关信息
12211221
*/
1222-
getRGL() {
1222+
getRGL(): {
1223+
isContainerNode: boolean;
1224+
isEmptyNode: boolean;
1225+
isRGLContainerNode: boolean;
1226+
isRGLNode: boolean;
1227+
isRGL: boolean;
1228+
rglNode: Node | null;
1229+
} {
12231230
const isContainerNode = this.isContainer();
12241231
const isEmptyNode = this.isEmpty();
12251232
const isRGLContainerNode = this.isRGLContainer;
1226-
const isRGLNode = this.getParent()?.isRGLContainer;
1233+
const isRGLNode = (this.getParent()?.isRGLContainer) as boolean;
12271234
const isRGL = isRGLContainerNode || (isRGLNode && (!isContainerNode || !isEmptyNode));
12281235
let rglNode = isRGLContainerNode ? this : isRGL ? this?.getParent() : null;
12291236
return { isContainerNode, isEmptyNode, isRGLContainerNode, isRGLNode, isRGL, rglNode };

0 commit comments

Comments
 (0)