I'm struggling to incorporate jQuery typings into my Angular2-seed project.
Within my component, I am utilizing jQuery in the following manner:
declare let $: any;
export class LeafletComponent implements OnInit {
ngOnInit(): void {
this.popup = $(this.element.nativeElement).find('#leaflet-popup');
}
}
While this method works well, it results in an untyped $
object. Ideally, I would prefer something like:
declare let $: JQueryStatic;
I have installed @types/jquery via npm and attempted to utilize JQueryStatic
. I have also experimented with various import statements in order to obtain a typed $
object, but none of them have been successful.
Additionally, the provided types from @types/jquery are only for jQuery 2.x, whereas I require types for jQuery 3.x.
Are there any suggestions on how to acquire proper types for jQuery version 3.x?