In other words, can I import an external JavaScript module without (initially) caring about its typing?
In pseudo-TypeScript:
declare module "foo": any;
import foo = module("foo");
foo.bar;
foo.baz();
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes you can – although not specifically as a module:
As you aren’t defining the module in any way, this should be sufficient.
Update
If you want to get a
requirestatement generated, you would need a stronger definition inside of afoo.d.tsfile. I usually recommend therequire: anyhack that you are trying to avoid.