graphology-types
Advanced tools
Comparing version 0.17.0 to 0.18.0
499
index.d.ts
@@ -45,3 +45,5 @@ /** | ||
type EdgeKeyGeneratorFunction<EdgeAttributes extends Attributes = Attributes> = ( | ||
type EdgeKeyGeneratorFunction< | ||
EdgeAttributes extends Attributes = Attributes | ||
> = ( | ||
undirected: boolean, | ||
@@ -54,21 +56,26 @@ source: string, | ||
type GraphOptions<EdgeAttributes extends Attributes = Attributes> = { | ||
allowSelfLoops?: boolean | ||
edgeKeyGenerator?: EdgeKeyGeneratorFunction<EdgeAttributes>, | ||
multi?: boolean, | ||
type?: GraphType | ||
allowSelfLoops?: boolean; | ||
edgeKeyGenerator?: EdgeKeyGeneratorFunction<EdgeAttributes>; | ||
multi?: boolean; | ||
type?: GraphType; | ||
}; | ||
type AdjacencyEntry<NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes> = [ | ||
type AdjacencyEntry< | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes | ||
> = [string, string, NodeAttributes, NodeAttributes, string, EdgeAttributes]; | ||
type NodeEntry<NodeAttributes extends Attributes = Attributes> = [ | ||
string, | ||
string, | ||
NodeAttributes, | ||
NodeAttributes, | ||
string, | ||
EdgeAttributes | ||
NodeAttributes | ||
]; | ||
type EdgeEntry< | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes | ||
> = [string, EdgeAttributes, string, string, NodeAttributes, NodeAttributes]; | ||
type NodeEntry<NodeAttributes extends Attributes = Attributes> = [string, NodeAttributes]; | ||
type EdgeEntry<NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes> = [string, EdgeAttributes, string, string, NodeAttributes, NodeAttributes]; | ||
type AdjacencyCallback<NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes> = ( | ||
type AdjacencyCallback< | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes | ||
> = ( | ||
source: string, | ||
@@ -87,3 +94,6 @@ target: string, | ||
type EdgeIterationCallback<NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes> = ( | ||
type EdgeIterationCallback< | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes | ||
> = ( | ||
edge: string, | ||
@@ -98,25 +108,41 @@ attributes: EdgeAttributes, | ||
type SerializedNode<NodeAttributes extends Attributes = Attributes> = { | ||
key: string, | ||
attributes?: NodeAttributes | ||
key: string; | ||
attributes?: NodeAttributes; | ||
}; | ||
type SerializedEdge<EdgeAttributes extends Attributes = Attributes> = { | ||
key?: string, | ||
source: string, | ||
target: string, | ||
attributes?: EdgeAttributes, | ||
undirected?: boolean | ||
key?: string; | ||
source: string; | ||
target: string; | ||
attributes?: EdgeAttributes; | ||
undirected?: boolean; | ||
}; | ||
type SerializedGraph<NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes, GraphAttributes extends Attributes = Attributes> = { | ||
attributes?: GraphAttributes, | ||
nodes: Array<SerializedNode<NodeAttributes>>, | ||
edges: Array<SerializedEdge<EdgeAttributes>> | ||
type SerializedGraphOptions = { | ||
allowSelfLoops?: boolean; | ||
multi?: boolean; | ||
type?: GraphType; | ||
}; | ||
type SerializedGraph< | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes, | ||
GraphAttributes extends Attributes = Attributes | ||
> = { | ||
attributes?: GraphAttributes; | ||
options?: SerializedGraphOptions; | ||
nodes: Array<SerializedNode<NodeAttributes>>; | ||
edges: Array<SerializedEdge<EdgeAttributes>>; | ||
}; | ||
/** | ||
* Main interface. | ||
*/ | ||
declare abstract class AbstractGraph<NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes, GraphAttributes extends Attributes = Attributes> extends EventEmitter implements Iterable<AdjacencyEntry<NodeAttributes, EdgeAttributes>> { | ||
declare abstract class AbstractGraph< | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes, | ||
GraphAttributes extends Attributes = Attributes | ||
> | ||
extends EventEmitter | ||
implements Iterable<AdjacencyEntry<NodeAttributes, EdgeAttributes>> { | ||
// Constructor | ||
@@ -133,2 +159,6 @@ constructor(options?: GraphOptions<EdgeAttributes>); | ||
allowSelfLoops: boolean; | ||
implementation: string; | ||
selfLoopCount: number; | ||
directedSelfLoopCount: number; | ||
undirectedSelfLoopCount: number; | ||
@@ -152,5 +182,7 @@ // Read methods | ||
opposite(node: NodeKey, edge: EdgeKey): string; | ||
undirected(edge: EdgeKey): boolean; | ||
directed(edge: EdgeKey): boolean; | ||
selfLoop(edge: EdgeKey): boolean; | ||
isUndirected(edge: EdgeKey): boolean; | ||
isDirected(edge: EdgeKey): boolean; | ||
isSelfLoop(edge: EdgeKey): boolean; | ||
hasExtremity(edge: EdgeKey, node: NodeKey): boolean; | ||
hasGeneratedKey(edge: EdgeKey): boolean; | ||
neighbors(source: NodeKey, target: NodeKey): boolean; | ||
@@ -167,14 +199,68 @@ undirectedNeighbors(source: NodeKey, target: NodeKey): boolean; | ||
mergeNode(node: NodeKey, attributes?: NodeAttributes): string; | ||
addEdge(source: NodeKey, target: NodeKey, attributes?: EdgeAttributes): string; | ||
mergeEdge(source: NodeKey, target: NodeKey, attributes?: EdgeAttributes): string; | ||
addDirectedEdge(source: NodeKey, target: NodeKey, attributes?: EdgeAttributes): string; | ||
mergeDirectedEdge(source: NodeKey, target: NodeKey, attributes?: EdgeAttributes): string; | ||
addUndirectedEdge(source: NodeKey, target: NodeKey, attributes?: EdgeAttributes): string; | ||
mergeUndirectedEdge(source: NodeKey, target: NodeKey, attributes?: EdgeAttributes): string; | ||
addEdgeWithKey(edge: EdgeKey, source: NodeKey, target: NodeKey, attributes?: EdgeAttributes): string; | ||
mergeEdgeWithKey(edge: EdgeKey, source: NodeKey, target: NodeKey, attributes?: EdgeAttributes): string; | ||
addDirectedEdgeWithKey(edge: EdgeKey, source: NodeKey, target: NodeKey, attributes?: EdgeAttributes): string; | ||
mergeDirectedEdgeWithKey(edge: EdgeKey, source: NodeKey, target: NodeKey, attributes?: EdgeAttributes): string; | ||
addUndirectedEdgeWithKey(edge: EdgeKey, source: NodeKey, target: NodeKey, attributes?: EdgeAttributes): string; | ||
mergeUndirectedEdgeWithKey(edge: EdgeKey, source: NodeKey, target: NodeKey, attributes?: EdgeAttributes): string; | ||
addEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes?: EdgeAttributes | ||
): string; | ||
mergeEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes?: EdgeAttributes | ||
): string; | ||
addDirectedEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes?: EdgeAttributes | ||
): string; | ||
mergeDirectedEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes?: EdgeAttributes | ||
): string; | ||
addUndirectedEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes?: EdgeAttributes | ||
): string; | ||
mergeUndirectedEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes?: EdgeAttributes | ||
): string; | ||
addEdgeWithKey( | ||
edge: EdgeKey, | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes?: EdgeAttributes | ||
): string; | ||
mergeEdgeWithKey( | ||
edge: EdgeKey, | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes?: EdgeAttributes | ||
): string; | ||
addDirectedEdgeWithKey( | ||
edge: EdgeKey, | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes?: EdgeAttributes | ||
): string; | ||
mergeDirectedEdgeWithKey( | ||
edge: EdgeKey, | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes?: EdgeAttributes | ||
): string; | ||
addUndirectedEdgeWithKey( | ||
edge: EdgeKey, | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes?: EdgeAttributes | ||
): string; | ||
mergeUndirectedEdgeWithKey( | ||
edge: EdgeKey, | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes?: EdgeAttributes | ||
): string; | ||
dropNode(node: NodeKey): void; | ||
@@ -201,3 +287,7 @@ dropEdge(edge: EdgeKey): void; | ||
setNodeAttribute(node: NodeKey, name: string, value: any): this; | ||
updateNodeAttribute(node: NodeKey, name: string, updater: (value: any) => any): this; | ||
updateNodeAttribute( | ||
node: NodeKey, | ||
name: string, | ||
updater: (value: any) => any | ||
): this; | ||
removeNodeAttribute(node: NodeKey, name: string): this; | ||
@@ -212,3 +302,7 @@ replaceNodeAttributes(node: NodeKey, attributes: NodeAttributes): this; | ||
setEdgeAttribute(edge: EdgeKey, name: string, value: any): this; | ||
updateEdgeAttribute(edge: EdgeKey, name: string, updater: (value: any) => any): this; | ||
updateEdgeAttribute( | ||
edge: EdgeKey, | ||
name: string, | ||
updater: (value: any) => any | ||
): this; | ||
removeEdgeAttribute(edge: EdgeKey, name: string): this; | ||
@@ -221,10 +315,30 @@ replaceEdgeAttributes(edge: EdgeKey, attributes: EdgeAttributes): this; | ||
hasEdgeAttribute(source: NodeKey, target: NodeKey, name: string): boolean; | ||
setEdgeAttribute(source: NodeKey, target: NodeKey, name: string, value: any): this; | ||
updateEdgeAttribute(source: NodeKey, target: NodeKey, name: string, updater: (value: any) => any): this; | ||
setEdgeAttribute( | ||
source: NodeKey, | ||
target: NodeKey, | ||
name: string, | ||
value: any | ||
): this; | ||
updateEdgeAttribute( | ||
source: NodeKey, | ||
target: NodeKey, | ||
name: string, | ||
updater: (value: any) => any | ||
): this; | ||
removeEdgeAttribute(source: NodeKey, target: NodeKey, name: string): this; | ||
replaceEdgeAttributes(source: NodeKey, target: NodeKey, attributes: EdgeAttributes): this; | ||
mergeEdgeAttributes(source: NodeKey, target: NodeKey, attributes: EdgeAttributes): this; | ||
replaceEdgeAttributes( | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes: EdgeAttributes | ||
): this; | ||
mergeEdgeAttributes( | ||
source: NodeKey, | ||
target: NodeKey, | ||
attributes: EdgeAttributes | ||
): this; | ||
// Iteration methods | ||
[Symbol.iterator](): IterableIterator<AdjacencyEntry<NodeAttributes, EdgeAttributes>>; | ||
[Symbol.iterator](): IterableIterator< | ||
AdjacencyEntry<NodeAttributes, EdgeAttributes> | ||
>; | ||
forEach(callback: AdjacencyCallback<NodeAttributes, EdgeAttributes>): void; | ||
@@ -258,44 +372,150 @@ adjacency(): IterableIterator<AdjacencyEntry<NodeAttributes, EdgeAttributes>>; | ||
outboundEdges(source: NodeKey, target: NodeKey): Array<string>; | ||
forEachEdge(callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachEdge(node: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachEdge(source: NodeKey, target: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachUndirectedEdge(callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachUndirectedEdge(node: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachUndirectedEdge(source: NodeKey, target: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachDirectedEdge(callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachDirectedEdge(node: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachDirectedEdge(source: NodeKey, target: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachInEdge(callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachInEdge(node: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachInEdge(source: NodeKey, target: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachOutEdge(callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachOutEdge(node: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachOutEdge(source: NodeKey, target: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachInboundEdge(callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachInboundEdge(node: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachInboundEdge(source: NodeKey, target: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachOutboundEdge(callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachOutboundEdge(node: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachOutboundEdge(source: NodeKey, target: NodeKey, callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes>): void; | ||
forEachEdge( | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachEdge( | ||
node: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachUndirectedEdge( | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachUndirectedEdge( | ||
node: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachUndirectedEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachDirectedEdge( | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachDirectedEdge( | ||
node: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachDirectedEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachInEdge( | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachInEdge( | ||
node: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachInEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachOutEdge( | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachOutEdge( | ||
node: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachOutEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachInboundEdge( | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachInboundEdge( | ||
node: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachInboundEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachOutboundEdge( | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachOutboundEdge( | ||
node: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachOutboundEdge( | ||
source: NodeKey, | ||
target: NodeKey, | ||
callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
edgeEntries(): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
edgeEntries(node: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
edgeEntries(source: NodeKey, target: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
undirectedEdgeEntries(): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
undirectedEdgeEntries(node: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
undirectedEdgeEntries(source: NodeKey, target: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
directedEdgeEntries(): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
directedEdgeEntries(node: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
directedEdgeEntries(source: NodeKey, target: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
edgeEntries( | ||
node: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
edgeEntries( | ||
source: NodeKey, | ||
target: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
undirectedEdgeEntries(): IterableIterator< | ||
EdgeEntry<NodeAttributes, EdgeAttributes> | ||
>; | ||
undirectedEdgeEntries( | ||
node: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
undirectedEdgeEntries( | ||
source: NodeKey, | ||
target: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
directedEdgeEntries(): IterableIterator< | ||
EdgeEntry<NodeAttributes, EdgeAttributes> | ||
>; | ||
directedEdgeEntries( | ||
node: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
directedEdgeEntries( | ||
source: NodeKey, | ||
target: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
inEdgeEntries(): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
inEdgeEntries(node: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
inEdgeEntries(source: NodeKey, target: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
inEdgeEntries( | ||
node: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
inEdgeEntries( | ||
source: NodeKey, | ||
target: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
outEdgeEntries(): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
outEdgeEntries(node: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
outEdgeEntries(source: NodeKey, target: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
inboundEdgeEntries(): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
inboundEdgeEntries(node: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
inboundEdgeEntries(source: NodeKey, target: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
outboundEdgeEntries(): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
outboundEdgeEntries(node: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
outboundEdgeEntries(source: NodeKey, target: NodeKey): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
outEdgeEntries( | ||
node: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
outEdgeEntries( | ||
source: NodeKey, | ||
target: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
inboundEdgeEntries(): IterableIterator< | ||
EdgeEntry<NodeAttributes, EdgeAttributes> | ||
>; | ||
inboundEdgeEntries( | ||
node: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
inboundEdgeEntries( | ||
source: NodeKey, | ||
target: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
outboundEdgeEntries(): IterableIterator< | ||
EdgeEntry<NodeAttributes, EdgeAttributes> | ||
>; | ||
outboundEdgeEntries( | ||
node: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
outboundEdgeEntries( | ||
source: NodeKey, | ||
target: NodeKey | ||
): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
@@ -309,16 +529,47 @@ neighbors(node: NodeKey): Array<string>; | ||
outboundNeighbors(node: NodeKey): Array<string>; | ||
forEachNeighbor(node: NodeKey, callback: NodeIterationCallback<NodeAttributes>): void; | ||
forEachUndirectedNeighbor(node: NodeKey, callback: NodeIterationCallback<NodeAttributes>): void; | ||
forEachDirectedNeighbor(node: NodeKey, callback: NodeIterationCallback<NodeAttributes>): void; | ||
forEachInNeighbor(node: NodeKey, callback: NodeIterationCallback<NodeAttributes>): void; | ||
forEachOutNeighbor(node: NodeKey, callback: NodeIterationCallback<NodeAttributes>): void; | ||
forEachInboundNeighbor(node: NodeKey, callback: NodeIterationCallback<NodeAttributes>): void; | ||
forEachOutboundNeighbor(node: NodeKey, callback: NodeIterationCallback<NodeAttributes>): void; | ||
forEachNeighbor( | ||
node: NodeKey, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
): void; | ||
forEachUndirectedNeighbor( | ||
node: NodeKey, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
): void; | ||
forEachDirectedNeighbor( | ||
node: NodeKey, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
): void; | ||
forEachInNeighbor( | ||
node: NodeKey, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
): void; | ||
forEachOutNeighbor( | ||
node: NodeKey, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
): void; | ||
forEachInboundNeighbor( | ||
node: NodeKey, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
): void; | ||
forEachOutboundNeighbor( | ||
node: NodeKey, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
): void; | ||
neighborEntries(node: NodeKey): IterableIterator<NodeEntry<NodeAttributes>>; | ||
undirectedNeighborEntries(node: NodeKey): IterableIterator<NodeEntry<NodeAttributes>>; | ||
directedNeighborEntries(node: NodeKey): IterableIterator<NodeEntry<NodeAttributes>>; | ||
undirectedNeighborEntries( | ||
node: NodeKey | ||
): IterableIterator<NodeEntry<NodeAttributes>>; | ||
directedNeighborEntries( | ||
node: NodeKey | ||
): IterableIterator<NodeEntry<NodeAttributes>>; | ||
inNeighborEntries(node: NodeKey): IterableIterator<NodeEntry<NodeAttributes>>; | ||
outNeighborEntries(node: NodeKey): IterableIterator<NodeEntry<NodeAttributes>>; | ||
inboundNeighborEntries(node: NodeKey): IterableIterator<NodeEntry<NodeAttributes>>; | ||
outboundNeighborEntries(node: NodeKey): IterableIterator<NodeEntry<NodeAttributes>>; | ||
outNeighborEntries( | ||
node: NodeKey | ||
): IterableIterator<NodeEntry<NodeAttributes>>; | ||
inboundNeighborEntries( | ||
node: NodeKey | ||
): IterableIterator<NodeEntry<NodeAttributes>>; | ||
outboundNeighborEntries( | ||
node: NodeKey | ||
): IterableIterator<NodeEntry<NodeAttributes>>; | ||
@@ -331,4 +582,10 @@ // Serialization methods | ||
importEdge(data: SerializedEdge<EdgeAttributes>, merge?: boolean): this; | ||
import(data: SerializedGraph<NodeAttributes, EdgeAttributes, GraphAttributes>, merge?: boolean): this; | ||
import(graph: AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes>, merge?: boolean): this; | ||
import( | ||
data: SerializedGraph<NodeAttributes, EdgeAttributes, GraphAttributes>, | ||
merge?: boolean | ||
): this; | ||
import( | ||
graph: AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes>, | ||
merge?: boolean | ||
): this; | ||
@@ -347,11 +604,35 @@ // Utils | ||
static from<NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes, GraphAttributes extends Attributes = Attributes>(data: SerializedGraph<NodeAttributes, EdgeAttributes, GraphAttributes>): AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes>; | ||
static from<NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes, GraphAttributes extends Attributes = Attributes>(graph: AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes>): AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes>; | ||
static from< | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes, | ||
GraphAttributes extends Attributes = Attributes | ||
>( | ||
data: SerializedGraph<NodeAttributes, EdgeAttributes, GraphAttributes> | ||
): AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes>; | ||
static from< | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes, | ||
GraphAttributes extends Attributes = Attributes | ||
>( | ||
graph: AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes> | ||
): AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes>; | ||
} | ||
interface IGraphConstructor<NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes, GraphAttributes extends Attributes = Attributes> { | ||
new(options?: GraphOptions<GraphAttributes>): AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes>; | ||
interface IGraphConstructor< | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes, | ||
GraphAttributes extends Attributes = Attributes | ||
> { | ||
new (options?: GraphOptions<GraphAttributes>): AbstractGraph< | ||
NodeAttributes, | ||
EdgeAttributes, | ||
GraphAttributes | ||
>; | ||
} | ||
type GraphConstructor<NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes, GraphAttributes extends Attributes = Attributes> = IGraphConstructor<NodeAttributes, EdgeAttributes, GraphAttributes>; | ||
type GraphConstructor< | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes, | ||
GraphAttributes extends Attributes = Attributes | ||
> = IGraphConstructor<NodeAttributes, EdgeAttributes, GraphAttributes>; | ||
@@ -358,0 +639,0 @@ export { |
{ | ||
"name": "graphology-types", | ||
"version": "0.17.0", | ||
"version": "0.18.0", | ||
"description": "TypeScript declaration for graphology.", | ||
@@ -9,2 +9,5 @@ "main": "index.d.ts", | ||
], | ||
"scripts": { | ||
"prettier": "prettier --write '*.d.ts'" | ||
}, | ||
"repository": { | ||
@@ -31,3 +34,8 @@ "type": "git", | ||
"homepage": "https://github.com/graphology/graphology-types#readme", | ||
"dependencies": {} | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@yomguithereal/prettier-config": "^1.1.0", | ||
"prettier": "^2.1.2" | ||
}, | ||
"prettier": "@yomguithereal/prettier-config" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
22486
608
2
1