graphology-types
Advanced tools
Comparing version 0.20.1 to 0.21.0
969
index.d.ts
@@ -11,3 +11,3 @@ /** | ||
*/ | ||
type Attributes = {[key: string]: any}; | ||
type Attributes = {[name: string]: any}; | ||
@@ -18,13 +18,4 @@ type GraphType = 'mixed' | 'directed' | 'undirected'; | ||
type EdgeKeyGeneratorFunction<EdgeAttributes extends Attributes = Attributes> = | ||
(data: { | ||
undirected: boolean; | ||
source: string; | ||
target: string; | ||
attributes: EdgeAttributes; | ||
}) => unknown; | ||
type GraphOptions<EdgeAttributes extends Attributes = Attributes> = { | ||
type GraphOptions = { | ||
allowSelfLoops?: boolean; | ||
edgeKeyGenerator?: EdgeKeyGeneratorFunction<EdgeAttributes>; | ||
multi?: boolean; | ||
@@ -37,12 +28,34 @@ type?: GraphType; | ||
EdgeAttributes extends Attributes = Attributes | ||
> = [string, string, NodeAttributes, NodeAttributes, string, EdgeAttributes]; | ||
> = { | ||
source: string; | ||
target: string; | ||
sourceAttributes: NodeAttributes; | ||
targetAttributes: NodeAttributes; | ||
edge: string; | ||
edgeAttributes: EdgeAttributes; | ||
undirected: boolean; | ||
}; | ||
type NodeEntry<NodeAttributes extends Attributes = Attributes> = [ | ||
string, | ||
NodeAttributes | ||
]; | ||
type NodeEntry<NodeAttributes extends Attributes = Attributes> = { | ||
node: string; | ||
attributes: NodeAttributes; | ||
}; | ||
type NeighborEntry<NodeAttributes extends Attributes = Attributes> = { | ||
neighbor: string; | ||
attributes: NodeAttributes; | ||
}; | ||
type EdgeEntry< | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes | ||
> = [string, EdgeAttributes, string, string, NodeAttributes, NodeAttributes]; | ||
> = { | ||
edge: string; | ||
attributes: EdgeAttributes; | ||
source: string; | ||
target: string; | ||
sourceAttributes: NodeAttributes; | ||
targetAttributes: NodeAttributes; | ||
undirected: boolean; | ||
}; | ||
@@ -59,7 +72,6 @@ type AdjacencyIterationCallback< | ||
edgeAttributes: EdgeAttributes, | ||
undirected: boolean, | ||
generatedKey: boolean | ||
undirected: boolean | ||
) => void; | ||
type AdjacencyUntilIterationCallback< | ||
type AdjacencyPredicate< | ||
NodeAttributes extends Attributes = Attributes, | ||
@@ -74,5 +86,4 @@ EdgeAttributes extends Attributes = Attributes | ||
edgeAttributes: EdgeAttributes, | ||
undirected: boolean, | ||
generatedKey: boolean | ||
) => boolean | undefined; | ||
undirected: boolean | ||
) => boolean | void; | ||
@@ -84,6 +95,18 @@ type NodeIterationCallback<NodeAttributes extends Attributes = Attributes> = ( | ||
type NodeUntilIterationCallback< | ||
NodeAttributes extends Attributes = Attributes | ||
> = (node: string, attributes: NodeAttributes) => boolean | undefined; | ||
type NodePredicate<NodeAttributes extends Attributes = Attributes> = ( | ||
node: string, | ||
attributes: NodeAttributes | ||
) => boolean | void; | ||
type NodeMapper<T, NodeAttributes extends Attributes = Attributes> = ( | ||
node: string, | ||
attributes: NodeAttributes | ||
) => T; | ||
type NodeReducer<T, NodeAttributes extends Attributes = Attributes> = ( | ||
accumulator: T, | ||
node: string, | ||
attributes: NodeAttributes | ||
) => T; | ||
type NodeUpdateIterationCallback< | ||
@@ -93,2 +116,21 @@ NodeAttributes extends Attributes = Attributes | ||
type NeighborIterationCallback<NodeAttributes extends Attributes = Attributes> = | ||
(neighbor: string, attributes: NodeAttributes) => void; | ||
type NeighborPredicate<NodeAttributes extends Attributes = Attributes> = ( | ||
neighbor: string, | ||
attributes: NodeAttributes | ||
) => boolean | void; | ||
type NeighborMapper<T, NodeAttributes extends Attributes = Attributes> = ( | ||
neighbor: string, | ||
attributes: NodeAttributes | ||
) => T; | ||
type NeighborReducer<T, NodeAttributes extends Attributes = Attributes> = ( | ||
accumulator: T, | ||
neighbor: string, | ||
attributes: NodeAttributes | ||
) => T; | ||
type EdgeIterationCallback< | ||
@@ -104,7 +146,6 @@ NodeAttributes extends Attributes = Attributes, | ||
targetAttributes: NodeAttributes, | ||
undirected: boolean, | ||
generatedKey: boolean | ||
undirected: boolean | ||
) => void; | ||
type EdgeUntilIterationCallback< | ||
type EdgePredicate< | ||
NodeAttributes extends Attributes = Attributes, | ||
@@ -119,6 +160,34 @@ EdgeAttributes extends Attributes = Attributes | ||
targetAttributes: NodeAttributes, | ||
undirected: boolean, | ||
generatedKey: boolean | ||
) => boolean | undefined; | ||
undirected: boolean | ||
) => boolean | void; | ||
type EdgeMapper< | ||
T, | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes | ||
> = ( | ||
edge: string, | ||
attributes: EdgeAttributes, | ||
source: string, | ||
target: string, | ||
sourceAttributes: NodeAttributes, | ||
targetAttributes: NodeAttributes, | ||
undirected: boolean | ||
) => T; | ||
type EdgeReducer< | ||
T, | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes | ||
> = ( | ||
accumulator: T, | ||
edge: string, | ||
attributes: EdgeAttributes, | ||
source: string, | ||
target: string, | ||
sourceAttributes: NodeAttributes, | ||
targetAttributes: NodeAttributes, | ||
undirected: boolean | ||
) => T; | ||
type EdgeUpdateIterationCallback< | ||
@@ -141,8 +210,2 @@ EdgeAttributes extends Attributes = Attributes | ||
type SerializedGraphOptions = { | ||
allowSelfLoops?: boolean; | ||
multi?: boolean; | ||
type?: GraphType; | ||
}; | ||
type SerializedGraph< | ||
@@ -153,4 +216,4 @@ NodeAttributes extends Attributes = Attributes, | ||
> = { | ||
attributes?: GraphAttributes; | ||
options?: SerializedGraphOptions; | ||
attributes: GraphAttributes; | ||
options: GraphOptions; | ||
nodes: Array<SerializedNode<NodeAttributes>>; | ||
@@ -166,3 +229,3 @@ edges: Array<SerializedEdge<EdgeAttributes>>; | ||
type AttributeUpdateTypes = 'set' | 'remove' | 'replace' | 'merge'; | ||
type AttributeUpdateType = 'set' | 'remove' | 'replace' | 'merge'; | ||
@@ -193,3 +256,3 @@ interface GraphEvents< | ||
attributesUpdated(payload: { | ||
type: AttributeUpdateTypes; | ||
type: AttributeUpdateType; | ||
attributes: GraphAttributes; | ||
@@ -200,3 +263,3 @@ name: string; | ||
nodeAttributesUpdated(payload: { | ||
type: AttributeUpdateTypes; | ||
type: AttributeUpdateType; | ||
key: string; | ||
@@ -208,3 +271,3 @@ attributes: NodeAttributes; | ||
edgeAttributesUpdated(payload: { | ||
type: AttributeUpdateTypes; | ||
type: AttributeUpdateType; | ||
key: string; | ||
@@ -361,3 +424,3 @@ attributes: EdgeAttributes; | ||
// Constructor | ||
constructor(options?: GraphOptions<EdgeAttributes>); | ||
constructor(options?: GraphOptions); | ||
@@ -388,7 +451,12 @@ // Members | ||
edge(source: unknown, target: unknown): string | undefined; | ||
inDegree(node: unknown, selfLoops?: boolean): number; | ||
outDegree(node: unknown, selfLoops?: boolean): number; | ||
directedDegree(node: unknown, selfLoops?: boolean): number; | ||
undirectedDegree(node: unknown, selfLoops?: boolean): number; | ||
degree(node: unknown, selfLoops?: boolean): number; | ||
inDegree(node: unknown): number; | ||
outDegree(node: unknown): number; | ||
directedDegree(node: unknown): number; | ||
undirectedDegree(node: unknown): number; | ||
degree(node: unknown): number; | ||
inDegreeWithoutSelfLoops(node: unknown): number; | ||
outDegreeWithoutSelfLoops(node: unknown): number; | ||
directedDegreeWithoutSelfLoops(node: unknown): number; | ||
undirectedDegreeWithoutSelfLoops(node: unknown): number; | ||
degreeWithoutSelfLoops(node: unknown): number; | ||
source(edge: unknown): string; | ||
@@ -402,10 +470,9 @@ target(edge: unknown): string; | ||
hasExtremity(edge: unknown, node: unknown): boolean; | ||
hasGeneratedKey(edge: unknown): boolean; | ||
neighbors(source: unknown, target: unknown): boolean; | ||
undirectedNeighbors(source: unknown, target: unknown): boolean; | ||
directedNeighbors(source: unknown, target: unknown): boolean; | ||
inNeighbors(source: unknown, target: unknown): boolean; | ||
outNeighbors(source: unknown, target: unknown): boolean; | ||
inboundNeighbors(source: unknown, target: unknown): boolean; | ||
outboundNeighbors(source: unknown, target: unknown): boolean; | ||
areNeighbors(source: unknown, target: unknown): boolean; | ||
areUndirectedNeighbors(source: unknown, target: unknown): boolean; | ||
areDirectedNeighbors(source: unknown, target: unknown): boolean; | ||
areInNeighbors(source: unknown, target: unknown): boolean; | ||
areOutNeighbors(source: unknown, target: unknown): boolean; | ||
areInboundNeighbors(source: unknown, target: unknown): boolean; | ||
areOutboundNeighbors(source: unknown, target: unknown): boolean; | ||
@@ -812,5 +879,5 @@ // Mutation methods | ||
): void; | ||
forEachUntil( | ||
callback: AdjacencyUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
find( | ||
callback: AdjacencyPredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
adjacency(): IterableIterator<AdjacencyEntry<NodeAttributes, EdgeAttributes>>; | ||
@@ -820,5 +887,8 @@ | ||
forEachNode(callback: NodeIterationCallback<NodeAttributes>): void; | ||
forEachNodeUntil( | ||
callback: NodeUntilIterationCallback<NodeAttributes> | ||
): boolean; | ||
mapNodes<T>(callback: NodeMapper<T, NodeAttributes>): Array<T>; | ||
filterNodes(callback: NodePredicate<NodeAttributes>): Array<string>; | ||
reduceNodes<T>(callback: NodeReducer<T, NodeAttributes>, initialValue: T): T; | ||
findNode(callback: NodePredicate<NodeAttributes>): string | undefined; | ||
someNode(callback: NodePredicate<NodeAttributes>): boolean; | ||
everyNode(callback: NodePredicate<NodeAttributes>): boolean; | ||
nodeEntries(): IterableIterator<NodeEntry<NodeAttributes>>; | ||
@@ -847,2 +917,3 @@ | ||
outboundEdges(source: unknown, target: unknown): Array<string>; | ||
forEachEdge( | ||
@@ -932,86 +1003,524 @@ callback: EdgeIterationCallback<NodeAttributes, EdgeAttributes> | ||
): void; | ||
forEachEdgeUntil( | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
mapEdges<T>( | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapEdges<T>( | ||
node: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapUndirectedEdges<T>( | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapUndirectedEdges<T>( | ||
node: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapUndirectedEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapDirectedEdges<T>( | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapDirectedEdges<T>( | ||
node: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapDirectedEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapInEdges<T>( | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapInEdges<T>( | ||
node: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapInEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapOutEdges<T>( | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapOutEdges<T>( | ||
node: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapOutEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapInboundEdges<T>( | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapInboundEdges<T>( | ||
node: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapInboundEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapOutboundEdges<T>( | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapOutboundEdges<T>( | ||
node: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
mapOutboundEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeMapper<T, NodeAttributes, EdgeAttributes> | ||
): Array<T>; | ||
filterEdges( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterEdges( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterEdges( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterUndirectedEdges( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterUndirectedEdges( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterUndirectedEdges( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterDirectedEdges( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterDirectedEdges( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterDirectedEdges( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterInEdges( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterInEdges( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterInEdges( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterOutEdges( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterOutEdges( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterOutEdges( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterInboundEdges( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterInboundEdges( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterInboundEdges( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterOutboundEdges( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterOutboundEdges( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
filterOutboundEdges( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): Array<string>; | ||
reduceEdges<T>( | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceEdges<T>( | ||
node: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceUndirectedEdges<T>( | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceUndirectedEdges<T>( | ||
node: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceUndirectedEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceDirectedEdges<T>( | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceDirectedEdges<T>( | ||
node: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceDirectedEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceInEdges<T>( | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceInEdges<T>( | ||
node: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceInEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceOutEdges<T>( | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceOutEdges<T>( | ||
node: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceOutEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceInboundEdges<T>( | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceInboundEdges<T>( | ||
node: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceInboundEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceOutboundEdges<T>( | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceOutboundEdges<T>( | ||
node: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceOutboundEdges<T>( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeReducer<T, NodeAttributes, EdgeAttributes>, | ||
initialValue: T | ||
): T; | ||
findEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findUndirectedEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findUndirectedEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findUndirectedEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findDirectedEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findDirectedEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findDirectedEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findInEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findInEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findInEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findOutEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findOutEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findOutEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findInboundEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findInboundEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findInboundEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findOutboundEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findOutboundEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
findOutboundEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): string | undefined; | ||
someEdge(callback: EdgePredicate<NodeAttributes, EdgeAttributes>): boolean; | ||
someEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachEdgeUntil( | ||
someEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
someUndirectedEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
someUndirectedEdge( | ||
node: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachEdgeUntil( | ||
someUndirectedEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachUndirectedEdgeUntil( | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
someDirectedEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachUndirectedEdgeUntil( | ||
someDirectedEdge( | ||
node: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachUndirectedEdgeUntil( | ||
someDirectedEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachDirectedEdgeUntil( | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
someInEdge(callback: EdgePredicate<NodeAttributes, EdgeAttributes>): boolean; | ||
someInEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachDirectedEdgeUntil( | ||
someInEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
someOutEdge(callback: EdgePredicate<NodeAttributes, EdgeAttributes>): boolean; | ||
someOutEdge( | ||
node: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachDirectedEdgeUntil( | ||
someOutEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachInEdgeUntil( | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
someInboundEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachInEdgeUntil( | ||
someInboundEdge( | ||
node: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachInEdgeUntil( | ||
someInboundEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachOutEdgeUntil( | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
someOutboundEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachOutEdgeUntil( | ||
someOutboundEdge( | ||
node: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachOutEdgeUntil( | ||
someOutboundEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachInboundEdgeUntil( | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
everyEdge(callback: EdgePredicate<NodeAttributes, EdgeAttributes>): boolean; | ||
everyEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachInboundEdgeUntil( | ||
everyEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyUndirectedEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyUndirectedEdge( | ||
node: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachInboundEdgeUntil( | ||
everyUndirectedEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachOutboundEdgeUntil( | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
everyDirectedEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachOutboundEdgeUntil( | ||
everyDirectedEdge( | ||
node: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
forEachOutboundEdgeUntil( | ||
everyDirectedEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgeUntilIterationCallback<NodeAttributes, EdgeAttributes> | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyInEdge(callback: EdgePredicate<NodeAttributes, EdgeAttributes>): boolean; | ||
everyInEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyInEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyOutEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyOutEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyOutEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyInboundEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyInboundEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyInboundEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyOutboundEdge( | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyOutboundEdge( | ||
node: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
everyOutboundEdge( | ||
source: unknown, | ||
target: unknown, | ||
callback: EdgePredicate<NodeAttributes, EdgeAttributes> | ||
): boolean; | ||
edgeEntries(): IterableIterator<EdgeEntry<NodeAttributes, EdgeAttributes>>; | ||
@@ -1089,75 +1598,234 @@ edgeEntries( | ||
outboundNeighbors(node: unknown): Array<string>; | ||
forEachNeighbor( | ||
node: unknown, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
callback: NeighborIterationCallback<NodeAttributes> | ||
): void; | ||
forEachUndirectedNeighbor( | ||
node: unknown, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
callback: NeighborIterationCallback<NodeAttributes> | ||
): void; | ||
forEachDirectedNeighbor( | ||
node: unknown, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
callback: NeighborIterationCallback<NodeAttributes> | ||
): void; | ||
forEachInNeighbor( | ||
node: unknown, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
callback: NeighborIterationCallback<NodeAttributes> | ||
): void; | ||
forEachOutNeighbor( | ||
node: unknown, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
callback: NeighborIterationCallback<NodeAttributes> | ||
): void; | ||
forEachInboundNeighbor( | ||
node: unknown, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
callback: NeighborIterationCallback<NodeAttributes> | ||
): void; | ||
forEachOutboundNeighbor( | ||
node: unknown, | ||
callback: NodeIterationCallback<NodeAttributes> | ||
callback: NeighborIterationCallback<NodeAttributes> | ||
): void; | ||
forEachNeighborUntil( | ||
mapNeighbors<T>( | ||
node: unknown, | ||
callback: NodeUntilIterationCallback<NodeAttributes> | ||
callback: NeighborMapper<T, NodeAttributes> | ||
): Array<T>; | ||
mapUndirectedNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborMapper<T, NodeAttributes> | ||
): Array<T>; | ||
mapDirectedNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborMapper<T, NodeAttributes> | ||
): Array<T>; | ||
mapInNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborMapper<T, NodeAttributes> | ||
): Array<T>; | ||
mapOutNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborMapper<T, NodeAttributes> | ||
): Array<T>; | ||
mapInboundNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborMapper<T, NodeAttributes> | ||
): Array<T>; | ||
mapOutboundNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborMapper<T, NodeAttributes> | ||
): Array<T>; | ||
filterNeighbors( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): Array<string>; | ||
filterUndirectedNeighbors( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): Array<string>; | ||
filterDirectedNeighbors( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): Array<string>; | ||
filterInNeighbors( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): Array<string>; | ||
filterOutNeighbors( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): Array<string>; | ||
filterInboundNeighbors( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): Array<string>; | ||
filterOutboundNeighbors( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): Array<string>; | ||
reduceNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborReducer<T, NodeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceUndirectedNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborReducer<T, NodeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceDirectedNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborReducer<T, NodeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceInNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborReducer<T, NodeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceOutNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborReducer<T, NodeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceInboundNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborReducer<T, NodeAttributes>, | ||
initialValue: T | ||
): T; | ||
reduceOutboundNeighbors<T>( | ||
node: unknown, | ||
callback: NeighborReducer<T, NodeAttributes>, | ||
initialValue: T | ||
): T; | ||
findNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): string | undefined; | ||
findUndirectedNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): string | undefined; | ||
findDirectedNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): string | undefined; | ||
findInNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): string | undefined; | ||
findOutNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): string | undefined; | ||
findInboundNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): string | undefined; | ||
findOutboundNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): string | undefined; | ||
someNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
forEachUndirectedNeighborUntil( | ||
someUndirectedNeighbor( | ||
node: unknown, | ||
callback: NodeUntilIterationCallback<NodeAttributes> | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
forEachDirectedNeighborUntil( | ||
someDirectedNeighbor( | ||
node: unknown, | ||
callback: NodeUntilIterationCallback<NodeAttributes> | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
forEachInNeighborUntil( | ||
someInNeighbor( | ||
node: unknown, | ||
callback: NodeUntilIterationCallback<NodeAttributes> | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
forEachOutNeighborUntil( | ||
someOutNeighbor( | ||
node: unknown, | ||
callback: NodeUntilIterationCallback<NodeAttributes> | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
forEachInboundNeighborUntil( | ||
someInboundNeighbor( | ||
node: unknown, | ||
callback: NodeUntilIterationCallback<NodeAttributes> | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
forEachOutboundNeighborUntil( | ||
someOutboundNeighbor( | ||
node: unknown, | ||
callback: NodeUntilIterationCallback<NodeAttributes> | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
neighborEntries(node: unknown): IterableIterator<NodeEntry<NodeAttributes>>; | ||
everyNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
everyUndirectedNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
everyDirectedNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
everyInNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
everyOutNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
everyInboundNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
everyOutboundNeighbor( | ||
node: unknown, | ||
callback: NeighborPredicate<NodeAttributes> | ||
): boolean; | ||
neighborEntries( | ||
node: unknown | ||
): IterableIterator<NeighborEntry<NodeAttributes>>; | ||
undirectedNeighborEntries( | ||
node: unknown | ||
): IterableIterator<NodeEntry<NodeAttributes>>; | ||
): IterableIterator<NeighborEntry<NodeAttributes>>; | ||
directedNeighborEntries( | ||
node: unknown | ||
): IterableIterator<NodeEntry<NodeAttributes>>; | ||
inNeighborEntries(node: unknown): IterableIterator<NodeEntry<NodeAttributes>>; | ||
): IterableIterator<NeighborEntry<NodeAttributes>>; | ||
inNeighborEntries( | ||
node: unknown | ||
): IterableIterator<NeighborEntry<NodeAttributes>>; | ||
outNeighborEntries( | ||
node: unknown | ||
): IterableIterator<NodeEntry<NodeAttributes>>; | ||
): IterableIterator<NeighborEntry<NodeAttributes>>; | ||
inboundNeighborEntries( | ||
node: unknown | ||
): IterableIterator<NodeEntry<NodeAttributes>>; | ||
): IterableIterator<NeighborEntry<NodeAttributes>>; | ||
outboundNeighborEntries( | ||
node: unknown | ||
): IterableIterator<NodeEntry<NodeAttributes>>; | ||
): IterableIterator<NeighborEntry<NodeAttributes>>; | ||
@@ -1171,3 +1839,5 @@ // Serialization methods | ||
import( | ||
data: SerializedGraph<NodeAttributes, EdgeAttributes, GraphAttributes>, | ||
data: Partial< | ||
SerializedGraph<NodeAttributes, EdgeAttributes, GraphAttributes> | ||
>, | ||
merge?: boolean | ||
@@ -1208,3 +1878,3 @@ ): this; | ||
interface IGraphConstructor< | ||
interface GraphConstructor< | ||
NodeAttributes extends Attributes = Attributes, | ||
@@ -1214,3 +1884,3 @@ EdgeAttributes extends Attributes = Attributes, | ||
> { | ||
new (options?: GraphOptions<GraphAttributes>): AbstractGraph< | ||
new (options?: GraphOptions): AbstractGraph< | ||
NodeAttributes, | ||
@@ -1222,24 +1892,27 @@ EdgeAttributes, | ||
type GraphConstructor< | ||
NodeAttributes extends Attributes = Attributes, | ||
EdgeAttributes extends Attributes = Attributes, | ||
GraphAttributes extends Attributes = Attributes | ||
> = IGraphConstructor<NodeAttributes, EdgeAttributes, GraphAttributes>; | ||
export { | ||
AbstractGraph, | ||
GraphConstructor, | ||
Attributes, | ||
GraphType, | ||
EdgeKeyGeneratorFunction, | ||
GraphOptions, | ||
AdjacencyEntry, | ||
NodeEntry, | ||
NeighborEntry, | ||
EdgeEntry, | ||
AdjacencyIterationCallback, | ||
AdjacencyUntilIterationCallback, | ||
AdjacencyPredicate, | ||
NodeIterationCallback, | ||
NodeUntilIterationCallback, | ||
NodePredicate, | ||
NodeMapper, | ||
NodeReducer, | ||
NodeUpdateIterationCallback, | ||
NeighborIterationCallback, | ||
NeighborPredicate, | ||
NeighborMapper, | ||
NeighborReducer, | ||
EdgeIterationCallback, | ||
EdgeUntilIterationCallback, | ||
EdgePredicate, | ||
EdgeMapper, | ||
EdgeReducer, | ||
EdgeUpdateIterationCallback, | ||
@@ -1249,5 +1922,5 @@ SerializedNode, | ||
SerializedGraph, | ||
GraphConstructor | ||
AttributeUpdateType | ||
}; | ||
export default AbstractGraph; |
{ | ||
"name": "graphology-types", | ||
"version": "0.20.1", | ||
"version": "0.21.0", | ||
"description": "TypeScript declaration for graphology.", | ||
@@ -14,3 +14,3 @@ "main": "index.d.ts", | ||
"type": "git", | ||
"url": "git+https://github.com/graphology/graphology-types.git" | ||
"url": "git+https://github.com/graphology/graphology.git" | ||
}, | ||
@@ -31,6 +31,6 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/graphology/graphology-types/issues" | ||
"url": "https://github.com/graphology/graphology/issues" | ||
}, | ||
"homepage": "https://github.com/graphology/graphology-types#readme", | ||
"homepage": "https://github.com/graphology/graphology#readme", | ||
"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
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 bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
56948
1825
0
1