我正在使用TypeScript的JSDoc形式,并尝试使用扩展对象的泛型。我的编辑器为声明类型为MyInterface<T>的参数的index.js代码提供了一个TypeScript错误,即Type 'T' does not satisfy the constraint '{如何指定接受约束JSDoc TypeSc
在TypeScript中,有没有办法键入以下fn函数,以便TypeScript仍然知道result的类型是'hello' const hello = 'hello' // hello is of type'hello'
const result = fn(hello) // result is of type unknown 对于泛型,可以