How can I stop "property does not exist on type JQuery" syntax errors when using Typescript?
You could cast it to <any>
or extend the jquery typing to add your own method.
(<any>$("div.printArea")).printArea();
//Or add your own custom methods (Assuming this is added by yourself as a part of custom plugin)
interface JQuery {
printArea():void;
}
I think this is the most readable solution:
($("div.printArea") as any).printArea();
You can cast it to
(<any>$('.selector') ).function();
Ex: date picker initialize using jquery
(<any>$('.datepicker') ).datepicker();