Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97387

vscode and jsdocs - How to use TS interfaces or types for javascript functions

$
0
0

I know that a type or an interface can be used for intellisensing function params or inline @type's. But is there some way to use types/interfaces to give intellisense to whole functions or object literals? Example:

type TFunc = ( x: number ) => boolean;

/**
 * @implements {TFunc}
 */
function isNumber ( x ) {
    return typeof x === 'number';
}

@implements doesn't work. I wonder if that can be done in another way?


Viewing all articles
Browse latest Browse all 97387

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>