Since upgrading to Typescript 4.4.2 (needed to support Angular 13), the require
syntax is no longer supported.
Now it seems I must use this syntax instead:
import * as d3ContextMenu from 'd3-context-menu';
Type definitions don't exist for d3-context-menu
in DefinitelyTyped
or anywhere else that I could find. So, I've tried creating my own using these instructions: (see "Plan C" here)
The problem is when I try to use these type definitions in a project compiled using ng-packagr
I can't get it to work.(it works in a regular Angular project)
What am I missing here? What's the secret sauce to including this type definition file?