1
例: JS公用事业的功能就像这样:打字稿:如何调用从打字稿类utli JS功能的定制
BDA.Utils.formatString = function (string) {
(....)
return someFormattedStr;
}
现在我想从我的TS类调用该方法,像这样:
export class Building {
image: string;
get getFormatted(): string {
return BDA.Utils.formatString (this.image);
}
}
我得到说,警告/型脚本错误,基本上,它会识别BDA.Utils
反正是有让TS坐视不理?或者将其定义为接口或者使其假定这种事情存在?我的主要问题是嵌套模块/类BDA-> utils的