-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
custom.d.ts
43 lines (36 loc) · 1.2 KB
/
custom.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
declare module '*.svg' {
const content: any;
export default content;
}
declare module "react-graph-vis" {
import { Network, NetworkEvents, Options, Node, Edge, DataSet } from "vis";
import { Component } from "react";
export { Network, NetworkEvents, Options, Node, Edge, DataSet } from "vis";
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;
options?: Options;
events?: graphEvents;
getNetwork?: (network: Network) => void;
identifier?: string;
style?: React.CSSProperties;
getNodes?: (nodes: DataSet<Node>) => void;
getEdges?: (edges: DataSet<Edge>) => void;
}
export interface NetworkGraphState {
identifier: string;
}
export default class NetworkGraph extends Component<
NetworkGraphProps,
NetworkGraphState
> {
render() // is this the right one? jsx.element
}
}