cytoscape-node-html-label icon indicating copy to clipboard operation
cytoscape-node-html-label copied to clipboard

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

Open Sagar-PH opened this issue 1 year ago • 1 comments

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.

Sagar-PH avatar Aug 02 '23 10:08 Sagar-PH

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 https://github.com/kaluginserg/cytoscape-node-html-label/pull/45 is merged.

zdenekhynek avatar Nov 01 '23 10:11 zdenekhynek