简体   繁体   中英

Typescript declaration for global function

I am trying to use image loading third party plugin 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 ]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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