Ever since the upgrade to Typescript 4.4.2 (which was necessary for supporting Angular 13), it appears that the require
syntax is no longer compatible.
Now, it seems like I have to use this alternative syntax instead:
import * as d3ContextMenu from 'd3-context-menu';
I couldn't find any type definitions for d3-context-menu
in DefinitelyTyped
or anywhere else. So, I decided to try creating my own based on these guidelines: (refer to "Plan C" here for details)
The issue arises when attempting to utilize these custom type definitions in a project compiled using ng-packagr
- it doesn't seem to function properly (although it works fine in a standard Angular project).
What am I overlooking in this process? What's the missing piece to properly integrating this type definition file?