ngraph.graph
Advanced tools
Comparing version 0.0.18 to 18.0.0
@@ -10,30 +10,30 @@ // Type definitions for ngraph.graph v0.0.14 | ||
interface Link { | ||
interface Link<Data = any> { | ||
id: string, | ||
fromId: NodeId, | ||
toId: NodeId, | ||
data: any | ||
data: Data | ||
} | ||
interface Node { | ||
interface Node<Data = any> { | ||
id: NodeId, | ||
links: Link[], | ||
data: any | ||
data: Data | ||
} | ||
interface Graph { | ||
addNode: (node: NodeId, data?: any) => Node | ||
addLink: (from: NodeId, to: NodeId, data?: any) => Link | ||
removeLink: (link: Link) => boolean | ||
interface Graph<NodeData = any, LinkData = any> { | ||
addNode: (node: NodeId, data?: NodeData) => Node<NodeData> | ||
addLink: (from: NodeId, to: NodeId, data?: LinkData) => Link<LinkData> | ||
removeLink: (link: Link<LinkData>) => boolean | ||
removeNode: (nodeId: NodeId) => boolean | ||
getNode: (nodeId: NodeId) => Node | undefined | ||
hasNode: (nodeId: NodeId) => Node | undefined | ||
getLink: (fromNodeId: NodeId, toNodeId: NodeId) => Link | null | ||
hasLink: (fromNodeId: NodeId, toNodeId: NodeId) => Link | null | ||
getNode: (nodeId: NodeId) => Node<NodeData> | undefined | ||
hasNode: (nodeId: NodeId) => Node<NodeData> | undefined | ||
getLink: (fromNodeId: NodeId, toNodeId: NodeId) => Link<LinkData> | null | ||
hasLink: (fromNodeId: NodeId, toNodeId: NodeId) => Link<LinkData> | null | ||
getNodesCount: () => number | ||
getLinksCount: () => number | ||
getLinks: Link[] | ||
forEachNode: (callbackPerNode: (node: Node) => void) => void | ||
forEachLinkedNode: (nodeId: NodeId, callbackPerNode: (node: Node, link: Link) => void, oriented: boolean) => void | ||
forEachLink: (callbackPerLink: (link: Link) => void) => void | ||
getLinks: Link<LinkData>[] | ||
forEachNode: (callbackPerNode: (node: Node<NodeData>) => void) => void | ||
forEachLinkedNode: (nodeId: NodeId, callbackPerNode: (node: Node<NodeData>, link: Link<LinkData>) => void, oriented: boolean) => void | ||
forEachLink: (callbackPerLink: (link: Link<LinkData>) => void) => void | ||
beginUpdate: () => void | ||
@@ -44,4 +44,4 @@ endUpdate: () => void | ||
export default function createGraph(options?: { multigraph: boolean }): Graph | ||
export default function createGraph<NodeData = any, LinkData = any>(options?: { multigraph: boolean }): Graph<NodeData, LinkData> | ||
} |
{ | ||
"name": "ngraph.graph", | ||
"version": "0.0.18", | ||
"version": "18.0.0", | ||
"description": "Base graph structure in ngraph.*", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -169,3 +169,3 @@ ngraph.graph | ||
} | ||
g.endUpdate(); // this triggers all listners of 'changed' event | ||
g.endUpdate(); // this triggers all listeners of 'changed' event | ||
``` | ||
@@ -172,0 +172,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
73298
2