mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-25 15:47:55 +01:00
Add missing type information.
This commit is contained in:
parent
151590e024
commit
0fe100222f
@ -280,7 +280,6 @@ class DesignerKeyboard extends Keyboard {
|
||||
const nodes = designer.getModel().filterSelectedTopics();
|
||||
if (nodes.length > 0) {
|
||||
// If a modifier is press, the key selected must be ignored.
|
||||
const pressKey = String.fromCharCode(keyCode);
|
||||
if (event.ctrlKey || event.altKey || event.metaKey) {
|
||||
return;
|
||||
}
|
||||
@ -363,7 +362,7 @@ class DesignerKeyboard extends Keyboard {
|
||||
}
|
||||
}
|
||||
|
||||
private _goToChild(designer, node) {
|
||||
private _goToChild(designer: Designer, node: Topic) {
|
||||
const children = node.getChildren();
|
||||
if (children.length > 0) {
|
||||
let target = children[0];
|
||||
|
@ -114,7 +114,7 @@ class StandaloneActionDispatcher extends ActionDispatcher {
|
||||
changeTextToTopic(topicsIds: number[], text: string) {
|
||||
$assert($defined(topicsIds), 'topicsIds can not be null');
|
||||
|
||||
const commandFunc = (topic: Topic, value: object) => {
|
||||
const commandFunc = (topic: Topic, value: string) => {
|
||||
const result = topic.getText();
|
||||
topic.setText(value);
|
||||
return result;
|
||||
|
@ -530,7 +530,7 @@ abstract class Topic extends NodeGraph {
|
||||
}
|
||||
}
|
||||
|
||||
_setText(text, updateModel) {
|
||||
_setText(text: string, updateModel: boolean) {
|
||||
const textShape = this.getTextShape();
|
||||
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 ...
|
||||
if (!text || $.trim(text).length === 0) {
|
||||
this._setText(null, true);
|
||||
@ -553,7 +553,7 @@ abstract class Topic extends NodeGraph {
|
||||
}
|
||||
|
||||
/** */
|
||||
getText() {
|
||||
getText(): string {
|
||||
const model = this.getModel();
|
||||
let result = model.getText();
|
||||
if (!$defined(result)) {
|
||||
@ -563,11 +563,11 @@ abstract class Topic extends NodeGraph {
|
||||
}
|
||||
|
||||
/** */
|
||||
setBackgroundColor(color) {
|
||||
setBackgroundColor(color: string) {
|
||||
this._setBackgroundColor(color, true);
|
||||
}
|
||||
|
||||
_setBackgroundColor(color, updateModel) {
|
||||
_setBackgroundColor(color: string, updateModel: boolean) {
|
||||
const innerShape = this.getInnerShape();
|
||||
innerShape.setFill(color);
|
||||
|
||||
@ -583,7 +583,7 @@ abstract class Topic extends NodeGraph {
|
||||
}
|
||||
|
||||
/** */
|
||||
getBackgroundColor() {
|
||||
getBackgroundColor(): string {
|
||||
const model = this.getModel();
|
||||
let result = model.getBackgroundColor();
|
||||
if (!$defined(result)) {
|
||||
@ -593,11 +593,11 @@ abstract class Topic extends NodeGraph {
|
||||
}
|
||||
|
||||
/** */
|
||||
setBorderColor(color) {
|
||||
setBorderColor(color: string) {
|
||||
this._setBorderColor(color, true);
|
||||
}
|
||||
|
||||
_setBorderColor(color, updateModel) {
|
||||
_setBorderColor(color: string, updateModel: boolean) {
|
||||
const innerShape = this.getInnerShape();
|
||||
innerShape.setAttribute('strokeColor', color);
|
||||
|
||||
@ -1349,7 +1349,7 @@ abstract class Topic extends NodeGraph {
|
||||
return result;
|
||||
}
|
||||
|
||||
isCentralTopic() {
|
||||
isCentralTopic(): boolean {
|
||||
return this.getModel().getType() === 'CentralTopic';
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user