{ this.action[action] = false; this.net-6ren">
gpt4 book ai didi

typescript - TsLint 说 "expected callSignature to have a typedef."是什么意思

转载 作者:搜寻专家 更新时间:2023-10-30 20:30:17 25 4
gpt4 key购买 nike

我的代码中有一个函数:

networkStop = (action: string = null) => {
this.action[action] = false;
this.net = false;
this.netd = false;
}

我收到 TsLint 错误提示:

Message 4   TsLint: expected callSignature to have a typedef.

谁能解释一下这是什么意思?

最佳答案

“缺少类型定义”请参阅:https://github.com/palantir/tslint/blob/master/src/rules/typedefRule.ts了解详情。基本上 一些 注释(对于一个函数,因为 callSignature)丢失了。

可能是修复(明确指定返回类型):

networkStop = (action: string = null):void => {
this.action[action] = false;
this.net = false;
this.netd = false;
}

关于typescript - TsLint 说 "expected callSignature to have a typedef."是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25459136/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com