[英]Creating an instance of a Javascript class from TypeScript
I am trying to call a javascript class from Typescript but the compiler (VS) is throwing a wobbly. 我正在尝试从Typescript调用javascript类,但是编译器(VS)却出现了摆动。
The class itself is InfoBox but unfortunately I cannot find a typescript definition for it. 该类本身是InfoBox,但是不幸的是我找不到它的打字稿定义。
When I try to use it from my TS class it complains that it cannot find name "InfoBox" 当我尝试从TS类使用它时,它抱怨找不到名称“ InfoBox”
public showInfoWindow(latLng: google.maps.LatLng, map: google.maps.Map): InfoBox {
var infobox = new InfoBox({
// ...
}
return infobox;
}
In the InfoBox.js file it is defined using the prototype
method like so 在InfoBox.js文件中,它是使用prototype
方法定义的,如下所示
function InfoBox(opt_opts) { ... }
InfoBox.prototype = new google.maps.OverlayView();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.