cytoscape.js-grid-guide icon indicating copy to clipboard operation
cytoscape.js-grid-guide copied to clipboard

Typescript / Angular 14 support

Open florianeichincode opened this issue 1 year ago • 1 comments

I have trouble to import the grud guide module to my angular project.

I get the following error:

Could not find a declaration file for module 'cytoscape-grid-guide'. '/home/user/xxx/node_modules/cytoscape-grid-guide/src/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/cytoscape-grid-guideif it exists or add a new declaration (.d.ts) file containingdeclare module 'cytoscape-grid-guide';``

Is there a typescript type definition that i can use? Maybe you can create one for npm?

florianeichincode avatar May 24 '23 06:05 florianeichincode

Came back to this topic. Solution;

import 'cytoscape-grid-guide';

this.cy?.gridGuide({ // Configure the grid guide plugin gridSpacing: 50, // Example spacing snapToGrid: true // Example option // Add more options as needed });

Add a cytoscape.d.ts file with declare module 'cytoscape' { interface Core { gridGuide(options?: any): void; } }

feichin-noreja avatar Mar 28 '24 08:03 feichin-noreja