0

我想使用该函数intellisense.undefinedWithCompletionsOf(value)为所有未定义的值显示窗口(或任何对象)的智能感知。但我无法让它工作。不幸的是,MSDN 也没有此功能的任何示例。

现在,我有 2 个文件:“intellisenseCode.js”,其中有:

intellisense.undefinedWithCompletionsOf(window);

和“appCode.js”,其中有:

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

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

我在这里做错了吗?

谢谢!

4

1 回答 1

1

知道了!以下是您可以使用相关功能的方式:

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
}
于 2013-12-19T16:18:09.013 回答