如何在TypeScript中获取重写方法的参数类型?

如何在TypeScript中获取重写方法的参数类型?,typescript,types,typing,strong-typing,Typescript,Types,Typing,Strong Typing,我想在子类B中创建一个typesafe方法,而不导入用于args的私有接口 // file A.ts class A<T> { hello(name: PrivateInterface) { console.log("Hello", name); } } // file B.ts class B extends A<Foo> { hello( ...args // How to type this without

我想在子类B中创建一个typesafe方法,而不导入用于args的私有接口

// file A.ts
class A<T> {
    hello(name: PrivateInterface) {
         console.log("Hello", name);
    }
}

// file B.ts
class B extends A<Foo> {
    hello(
        ...args // How to type this without PrivateInterface?
    ) {
         super(...args);
    }
}
//文件A.ts
甲级{
你好(姓名:PrivateInterface){
log(“Hello”,name);
}
}
//文件B.ts
B类扩展了A类{
你好(
…args//如何在没有PrivateInterface的情况下键入此内容?
) {
超级(…args);
}
}
我可以使用
参数
获取方法的返回类型,但我不能使用超类
参数
获取方法的返回类型