From 5bc7e316b2ba3fcd2d5fff1c38c0a958dcb261b4 Mon Sep 17 00:00:00 2001 From: Lukas Nasarek Date: Tue, 27 Apr 2021 16:00:18 +0200 Subject: [PATCH] Use vis' Data type instead of the custom graphData type. Depends on #112. --- lib/index.d.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/index.d.ts b/lib/index.d.ts index d99788e1..b86f8a1a 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -1,23 +1,17 @@ declare module "react-graph-vis" { - import { Network, NetworkEvents, Options, Node, Edge, DataSet } from "vis"; + import { Network, NetworkEvents, Options, Node, Edge, DataSet, Data } from "vis"; import { Component } from "react"; - export { Network, NetworkEvents, Options, Node, Edge, DataSet } from "vis"; + export { Network, NetworkEvents, Options, Node, Edge, DataSet, Data } from "vis"; - export type graphEvents = { + export type GraphEvents = { [event in NetworkEvents]?: (params?: any) => void; }; - //Doesn't appear that this module supports passing in a vis.DataSet directly. Once it does graph can just use the Data object from vis. - export interface graphData { - nodes: Node[]; - edges: Edge[]; - } - export interface NetworkGraphProps { - graph: graphData; + graph: Data; options?: Options; - events?: graphEvents; + events?: GraphEvents; getNetwork?: (network: Network) => void; identifier?: string; style?: React.CSSProperties;