As I try to integrate TypeScript into my codebase, a challenge arises. It seems that when loading jQuery and AngularJS in sequence, AngularJS can inherit functionalities from jQuery. However, when locally importing them in a module, AngularJS fails to extend itself with jQuery. Thus, when I attempt something like this:
import * as $ from 'jquery';
import * as angular from 'angular';
export default ['$window', function($window) {
let position = angular.element($window).scrollTop();
}];
An error in TypeScript occurs:
Error: Property 'scrollTop' does not exist on type 'JQLite'.
How can I ensure that AngularJS recognizes and utilizes the abilities of jQuery when loaded?