admin管理员组

文章数量:1400124

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?

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?

Share Improve this question edited Sep 30, 2016 at 11:30 peterh 1 asked Dec 21, 2015 at 12:23 GayanGayan 2,8817 gold badges50 silver badges92 bronze badges 2
  • 1 Here is a quick migration guide : basarat.gitbooks.io/typescript/content/docs/types/… – basarat Commented Dec 21, 2015 at 22:38
  • Possible duplicate of typescript: What to do if a typings (or tsd) is not available? – Alex Commented Sep 30, 2016 at 11:35
Add a ment  | 

1 Answer 1

Reset to default 7

You can put the following line before the function call:

declare var loadImage;

[Playground]

本文标签: javascriptTypescript declaration for global functionStack Overflow