Add missing type information.

This commit is contained in:
Paulo Gustavo Veiga 2022-02-18 07:26:15 -08:00
parent 151590e024
commit 0fe100222f
3 changed files with 11 additions and 12 deletions

View File

@ -280,7 +280,6 @@ class DesignerKeyboard extends Keyboard {
const nodes = designer.getModel().filterSelectedTopics(); const nodes = designer.getModel().filterSelectedTopics();
if (nodes.length > 0) { if (nodes.length > 0) {
// If a modifier is press, the key selected must be ignored. // If a modifier is press, the key selected must be ignored.
const pressKey = String.fromCharCode(keyCode);
if (event.ctrlKey || event.altKey || event.metaKey) { if (event.ctrlKey || event.altKey || event.metaKey) {
return; return;
} }
@ -363,7 +362,7 @@ class DesignerKeyboard extends Keyboard {
} }
} }
private _goToChild(designer, node) { private _goToChild(designer: Designer, node: Topic) {
const children = node.getChildren(); const children = node.getChildren();
if (children.length > 0) { if (children.length > 0) {
let target = children[0]; let target = children[0];

View File

@ -114,7 +114,7 @@ class StandaloneActionDispatcher extends ActionDispatcher {
changeTextToTopic(topicsIds: number[], text: string) { changeTextToTopic(topicsIds: number[], text: string) {
$assert($defined(topicsIds), 'topicsIds can not be null'); $assert($defined(topicsIds), 'topicsIds can not be null');
const commandFunc = (topic: Topic, value: object) => { const commandFunc = (topic: Topic, value: string) => {
const result = topic.getText(); const result = topic.getText();
topic.setText(value); topic.setText(value);
return result; return result;

View File

@ -530,7 +530,7 @@ abstract class Topic extends NodeGraph {
} }
} }
_setText(text, updateModel) { _setText(text: string, updateModel: boolean) {
const textShape = this.getTextShape(); const textShape = this.getTextShape();
textShape.setText(text == null ? TopicStyle.defaultText(this) : text); textShape.setText(text == null ? TopicStyle.defaultText(this) : text);
@ -541,7 +541,7 @@ abstract class Topic extends NodeGraph {
} }
/** */ /** */
setText(text) { setText(text: string) {
// Avoid empty nodes ... // Avoid empty nodes ...
if (!text || $.trim(text).length === 0) { if (!text || $.trim(text).length === 0) {
this._setText(null, true); this._setText(null, true);
@ -553,7 +553,7 @@ abstract class Topic extends NodeGraph {
} }
/** */ /** */
getText() { getText(): string {
const model = this.getModel(); const model = this.getModel();
let result = model.getText(); let result = model.getText();
if (!$defined(result)) { if (!$defined(result)) {
@ -563,11 +563,11 @@ abstract class Topic extends NodeGraph {
} }
/** */ /** */
setBackgroundColor(color) { setBackgroundColor(color: string) {
this._setBackgroundColor(color, true); this._setBackgroundColor(color, true);
} }
_setBackgroundColor(color, updateModel) { _setBackgroundColor(color: string, updateModel: boolean) {
const innerShape = this.getInnerShape(); const innerShape = this.getInnerShape();
innerShape.setFill(color); innerShape.setFill(color);
@ -583,7 +583,7 @@ abstract class Topic extends NodeGraph {
} }
/** */ /** */
getBackgroundColor() { getBackgroundColor(): string {
const model = this.getModel(); const model = this.getModel();
let result = model.getBackgroundColor(); let result = model.getBackgroundColor();
if (!$defined(result)) { if (!$defined(result)) {
@ -593,11 +593,11 @@ abstract class Topic extends NodeGraph {
} }
/** */ /** */
setBorderColor(color) { setBorderColor(color: string) {
this._setBorderColor(color, true); this._setBorderColor(color, true);
} }
_setBorderColor(color, updateModel) { _setBorderColor(color: string, updateModel: boolean) {
const innerShape = this.getInnerShape(); const innerShape = this.getInnerShape();
innerShape.setAttribute('strokeColor', color); innerShape.setAttribute('strokeColor', color);
@ -1349,7 +1349,7 @@ abstract class Topic extends NodeGraph {
return result; return result;
} }
isCentralTopic() { isCentralTopic(): boolean {
return this.getModel().getType() === 'CentralTopic'; return this.getModel().getType() === 'CentralTopic';
} }
} }