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

Cannot declare and use cytoscape-node-html-label for typescript project. #78

Open
Sagar-PH opened this issue Aug 2, 2023 · 1 comment

Comments

@Sagar-PH
Copy link

Sagar-PH commented Aug 2, 2023

It would be helpful if u provide or find any similar dependencies of same features or provide @types/cytoscape-node-html-label dependency so that it would be useful that i can use in my typescript project.

@zdenekhynek
Copy link

zdenekhynek commented Nov 1, 2023

Following worked for me to quickly test this in a typescript project

# typings.d.ts
declare module "cytoscape-node-html-label";
# test-cytoscape.ts
import { Core } from "cytoscape";
import nodeHtmlLabel, { CytoscapeNodeHtmlParams, CytoscapeContainerParams } from "cytoscape-node-html-label";

export interface IExtendedCytoscapeCore extends Core {
  nodeHtmlLabel: (options: CytoscapeNodeHtmlParams[], params?: CytoscapeContainerParams) => void;
}

const cy = cytoscape(opts) as IExtendedCytoscapeCore;

Will probably become easier when #45 is merged.

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