I installed the waypoints library with npm install waypoints and added types with
npm install --save @types/waypoints
.
I get the error /node_modules/@types/waypoints/index.d.ts' is not a module.
Using waypoints.js in Angular 4 application
discuses the same problem. The user had the same error. One comment suggests "Use export package_name = package_name. this should work" I didn't know how to implement that.
I tried to add
export = waypoints
export as namespace waypoints;
declare namespace waypoints {
}
import * as Waypoint from 'waypoints';
When I then try to import the waypoint I get no error. But if I then add a waypoint like this:
let waypoint = new Waypoint.Waypoint({
element: document.querySelector("#p5"),
handler: function () {
},
});
I get another error ->
Module not found: Error: Can't resolve 'waypoints'