import cytoscape, { Css, EventObject, Ext, LayoutOptions, NodeSingular, Stylesheet } from 'cytoscape'; export interface ISelected { type: 'none' | 'single' | 'double'; style?: Css.Node; } export interface INodeHover { style?: Css.Node; } export interface INode { id: number | string; name: string; type?: 'normal' | 'image' | 'mixed'; category?: 'pub' | 'org' | 'patent' | 'enterprise' | 'person' | 'field' | 'subject' | 'product' | 'policy'; style?: Css.Node; selected?: ISelected; hover?: INodeHover; bgImgUrl?: string; props?: { [key: string]: any; }; } export interface IEdge { startNode: number | string; endNode: number | string; id: number | string; name?: string; style?: Css.Edge; hover?: { style?: Css.Node; }; } export interface IData { nodes: INode[]; edges?: IEdge[]; } export interface ILegend { data: { name: string; category: string; [key: string]: any; }[]; } export interface IOption { container: HTMLDivElement | string; data: IData; legend?: ILegend; legendContainer?: HTMLDivElement | string; ext?: Ext; style?: Stylesheet[] | undefined; layout?: LayoutOptions | undefined; defaultBgImgUrl?: string; renderImmediately?: boolean; highlightType?: 'all' | 'partial'; defaultSelectedNode?: string; mouseEvent?: { mouseover?: boolean; mouseout?: boolean; click?: boolean; nodeClickCb?: (data: INode, node: NodeSingular, evt: EventObject) => void; nodeMouseoverCb?: (data: INode, node: NodeSingular, evt: EventObject) => void; edgeMouseoverCb?: (data: IEdge, node: NodeSingular, evt: EventObject) => void; nodeMouseoutCb?: (data: INode, node: NodeSingular, evt: EventObject) => void; edgeMouseoutCb?: (data: IEdge, node: NodeSingular, evt: EventObject) => void; }; options?: { [key: string]: any; }; onReady?: (cy: cytoscape.Core, event: EventObject, extraParams: any) => void; } export interface ILegendOption { cy: cytoscape.Core; option: { data: { name: string; category: string; [key: string]: any; }[]; container?: string | HTMLDivElement; [key: string]: any; }; }