dar*_*ong 5 javascript jsdoc typescript visual-studio-code
我知道类型或接口可用于智能感知函数 params 或 inline @type。但是有没有办法使用类型/接口为整个函数或对象文字提供智能感知?例子:
type TFunc = ( x: number ) => boolean;
/**
* @implements {TFunc}
*/
function isNumber ( x ) {
return typeof x === 'number';
}
Run Code Online (Sandbox Code Playgroud)
@implements不起作用。我想知道是否可以通过其他方式做到这一点?