I have a function which takes in another function as an argument, does something to that function-argument, and then returns that same function-argument (or at least returns a function with the exact same signature to it)
/**
* The param and return should be the same (as far as JSDoc is concerned)!
* @param {Function} fnToWrap
* @returns {fnToWrap}
*/
function wrapperFunction(fnToWrap) {
// Does something...
return fnToWrap;
}
However, as you can see from my comments in the following...
/**
* IntelliSense detects this...
* @param paramA
* @returns
*/
var arbitraryFn = function(paramA) {
return paramA * 2;
}
// But NOT this!!!
var wrappedArbitraryFn = wrapperFunction(arbitraryFn);
... IntelliSense will autocomplete when calling arbitraryFn() but not wrappedArbitraryFn().
Is there any way to get IntelliSense to dynamically autocomplete my wrapped functions with the same signature as their unwrapped counterparts, i.e. without having to explicitly re-document every newly-wrapped function?