简体   繁体   English

全局函数的Typescript声明

[英]Typescript declaration for global function

I am trying to use image loading third party plugin blueimp . 我正在尝试使用图像加载第三方插件blueimp That plugin has global function 该插件具有全局功能

loadImage(
    e.target.files[0],
    function (img) {
        document.body.appendChild(img);
    },
    { maxWidth: 600 }
);

How can I call this function using typescript? 如何使用打字稿调用此函数?

You can put the following line before the function call: 您可以在函数调用之前放入以下行:

declare var loadImage;

[ Playground ] [ 游乐场 ]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM