










class a extends schema {
fun1 () => 1
}
class b extends schema{
fun2 () => 2
}
const objs = {
a:new a
b:new b
}
function find(key) : any{
return objs[key]
}
这个 objs 很多个 obj 他们都继承自同一个父类,有什么办法在调用 find 返回的对象能保持代码提示吗?
let obj = find('a')
obj.fun1 //代码提示
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。