Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript / Angular 14 support #56

Open
florianeichincode opened this issue May 24, 2023 · 1 comment
Open

Typescript / Angular 14 support #56

florianeichincode opened this issue May 24, 2023 · 1 comment

Comments

@florianeichincode
Copy link

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?

@feichin-noreja
Copy link

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;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants