我这个问题怎么处理
interface Text {
<T extends object, K extends keyof T>(o: T, n: K): T[K];
}
function test<T extends object, K extends keyof T>(o: T, n: K): T[K] {
return o[n];
}
let test1: Text = test
test1({a:1},'a')
// Error:(8, 5) TS2740: Type '<T extends object, K extends keyof T>(o: T, n: K) => T[K]' is missing the following properties from type 'Text': assignedSlot, wholeText, splitText, data, and 62 more.
展开
作者回复: Text接口在 lib.dom.d.ts 中已被预定义,换个名字就可以了