我正在使用TypeScript的JSDoc形式,并尝试使用扩展对象的泛型。我的编辑器为声明类型为MyInterface<T>的参数的index.js代码提供了一个TypeScript错误,即Type 'T' does not satisfy the constraint '{如何指定接受约束JSDoc TypeScript中对象的<
我正在尝试提出以下TypeScript类型断言函数的JavaScript+JSDoc变体: function typeCheck<T>(value: unknown, type: new () =>HTMLButtonElement带有下划线,错误消息为: Argument of type '{ new (): HTMLButtonElement; prototype: HTMLButtonElementinstantiated with an arbitrary type which coul