Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngraph.graph

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngraph.graph - npm Package Compare versions

Comparing version 0.0.18 to 18.0.0

34

index.d.ts

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc