سؤال

I want to use the function intellisense.undefinedWithCompletionsOf(value) to show intellisense for window (or any object) for all undefined values. But I cannot get it to work. Unfortunately, MSDN does not have any example for this function either.

For now, I have 2 files: "intellisenseCode.js" which has:

intellisense.undefinedWithCompletionsOf(window);

and "appCode.js" which has:

/// <reference path="intellisenseCode.js" />

var hello;
hello. // should show intellisense for window object here

Am I doing something wrong here?

Thanks!

هل كانت مفيدة؟

المحلول

Got it! Here's the way you can use the function in question:

function(param1, param2){
    // param 1 is undefined for intellisense at this point
    param1 = intellisense.undefinedWithCompletionsOf(window); // can set it to any type instead of window
    param1. // shows intellisense for window object
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top