/** * Graphology Typings * =================== * * Graphology TypeScript declaration. */ /** * Miscellaneous types. */ type Attributes = {[name: string]: any}; type GraphType = 'mixed' | 'directed' | 'undirected'; type UpdateHints = { attributes?: Array; }; type GraphOptions = { allowSelfLoops?: boolean; multi?: boolean; type?: GraphType; }; type AdjacencyEntry< NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes > = { source: string; target: string; sourceAttributes: NodeAttributes; targetAttributes: NodeAttributes; edge: string; edgeAttributes: EdgeAttributes; undirected: boolean; }; type NodeEntry = { node: string; attributes: NodeAttributes; }; type NodeMergeResult = [key: string, nodeWasAdded: boolean]; type NeighborEntry = { neighbor: string; attributes: NodeAttributes; }; type EdgeEntry< NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes > = { edge: string; attributes: EdgeAttributes; source: string; target: string; sourceAttributes: NodeAttributes; targetAttributes: NodeAttributes; undirected: boolean; }; type EdgeMergeResult = [ key: string, edgeWasAdded: boolean, sourceWasAdded: boolean, targetWasAdded: boolean ]; type AdjacencyIterationCallback< NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes > = ( node: string, neighbor: string, nodeAttributes: NodeAttributes, neighborAttributes: NodeAttributes, edge: string, edgeAttributes: EdgeAttributes, undirected: boolean ) => void; type AdjacencyIterationCallbackWithOrphans< NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes > = ( node: string, neighbor: string | null, nodeAttributes: NodeAttributes, neighborAttributes: NodeAttributes | null, edge: string | null, edgeAttributes: EdgeAttributes | null, undirected: boolean | null ) => void; type NodeIterationCallback = ( node: string, attributes: NodeAttributes ) => void; type NodePredicate = ( node: string, attributes: NodeAttributes ) => boolean | void; type NodeMapper = ( node: string, attributes: NodeAttributes ) => T; type NodeReducer = ( accumulator: T, node: string, attributes: NodeAttributes ) => T; type NeighborIterationCallback = (neighbor: string, attributes: NodeAttributes) => void; type NeighborPredicate = ( neighbor: string, attributes: NodeAttributes ) => boolean | void; type NeighborMapper = ( neighbor: string, attributes: NodeAttributes ) => T; type NeighborReducer = ( accumulator: T, neighbor: string, attributes: NodeAttributes ) => T; type EdgeIterationCallback< NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes > = ( edge: string, attributes: EdgeAttributes, source: string, target: string, sourceAttributes: NodeAttributes, targetAttributes: NodeAttributes, undirected: boolean ) => void; type EdgePredicate< NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes > = ( edge: string, attributes: EdgeAttributes, source: string, target: string, sourceAttributes: NodeAttributes, targetAttributes: NodeAttributes, 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 SerializedNode = { key: string; attributes?: NodeAttributes; }; type SerializedEdge = { 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; options: GraphOptions; nodes: Array>; edges: Array>; }; /** * Event Emitter typings for convience. * @note Taken from here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/events/index.d.ts */ type Listener = (...args: any[]) => void; type EventsMapping = Record; type AttributeUpdateType = 'set' | 'remove' | 'replace' | 'merge' | 'update'; type AttributeUpdatePayload = | { type: 'set'; key: string; attributes: ItemAttributes; name: keyof ItemAttributes; } | { type: 'remove'; key: string; attributes: ItemAttributes; name: keyof ItemAttributes; } | { type: 'replace'; key: string; attributes: ItemAttributes; } | { type: 'merge'; key: string; attributes: ItemAttributes; data: ItemAttributes; } | { type: 'update'; key: string; attributes: ItemAttributes; }; type GraphEvents< NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes, GraphAttributes extends Attributes = Attributes > = { nodeAdded(payload: {key: string; attributes: NodeAttributes}): void; edgeAdded(payload: { key: string; source: string; target: string; attributes: EdgeAttributes; undirected: boolean; }): void; nodeDropped(payload: {key: string; attributes: NodeAttributes}): void; edgeDropped(payload: { key: string; source: string; target: string; attributes: EdgeAttributes; undirected: boolean; }): void; cleared(): void; edgesCleared(): void; attributesUpdated( payload: Omit, 'key'> ): void; nodeAttributesUpdated(payload: AttributeUpdatePayload): void; edgeAttributesUpdated(payload: AttributeUpdatePayload): void; eachNodeAttributesUpdated(payload: { hints: UpdateHints; }): void; eachEdgeAttributesUpdated(payload: { hints: UpdateHints; }): void; }; declare class GraphEventEmitter { static listenerCount( emitter: GraphEventEmitter, type: string | number ): number; static defaultMaxListeners: number; eventNames(): Array; setMaxListeners(n: number): this; getMaxListeners(): number; emit( type: Event, ...args: Parameters ): boolean; addListener( type: Event, listener: Events[Event] ): this; on(type: Event, listener: Events[Event]): this; once(type: Event, listener: Events[Event]): this; prependListener( type: Event, listener: Events[Event] ): this; prependOnceListener( type: Event, listener: Events[Event] ): this; removeListener( type: Event, listener: Events[Event] ): this; off(type: Event, listener: Events[Event]): this; removeAllListeners(type?: Event): this; listeners(type: Event): Events[Event][]; listenerCount(type: Event): number; rawListeners(type: Event): Events[Event][]; } /** * Main interface. */ declare abstract class AbstractGraph< NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes, GraphAttributes extends Attributes = Attributes > extends GraphEventEmitter< GraphEvents > { // Constructor constructor(options?: GraphOptions); // Members order: number; size: number; directedSize: number; undirectedSize: number; type: GraphType; multi: boolean; allowSelfLoops: boolean; implementation: string; selfLoopCount: number; directedSelfLoopCount: number; undirectedSelfLoopCount: number; // Read methods hasNode(node: unknown): boolean; hasDirectedEdge(edge: unknown): boolean; hasDirectedEdge(source: unknown, target: unknown): boolean; hasUndirectedEdge(edge: unknown): boolean; hasUndirectedEdge(source: unknown, target: unknown): boolean; hasEdge(edge: unknown): boolean; hasEdge(source: unknown, target: unknown): boolean; directedEdge(source: unknown, target: unknown): string | undefined; undirectedEdge(source: unknown, target: unknown): string | undefined; edge(source: unknown, target: unknown): string | undefined; inDegree(node: unknown): number; outDegree(node: unknown): number; inboundDegree(node: unknown): number; outboundDegree(node: unknown): number; directedDegree(node: unknown): number; undirectedDegree(node: unknown): number; degree(node: unknown): number; inDegreeWithoutSelfLoops(node: unknown): number; outDegreeWithoutSelfLoops(node: unknown): number; inboundDegreeWithoutSelfLoops(node: unknown): number; outboundDegreeWithoutSelfLoops(node: unknown): number; directedDegreeWithoutSelfLoops(node: unknown): number; undirectedDegreeWithoutSelfLoops(node: unknown): number; degreeWithoutSelfLoops(node: unknown): number; source(edge: unknown): string; target(edge: unknown): string; extremities(edge: unknown): [string, string]; opposite(node: unknown, edge: unknown): string; isUndirected(edge: unknown): boolean; isDirected(edge: unknown): boolean; isSelfLoop(edge: unknown): boolean; hasExtremity(edge: unknown, node: 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; // Mutation methods addNode(node: unknown, attributes?: NodeAttributes): string; mergeNode( node: unknown, attributes?: Partial ): NodeMergeResult; updateNode( node: unknown, updater?: (attributes: Partial) => NodeAttributes ): NodeMergeResult; addEdge( source: unknown, target: unknown, attributes?: EdgeAttributes ): string; mergeEdge( source: unknown, target: unknown, attributes?: Partial ): EdgeMergeResult; updateEdge( source: unknown, target: unknown, updater?: (attributes: Partial) => EdgeAttributes ): EdgeMergeResult; addDirectedEdge( source: unknown, target: unknown, attributes?: EdgeAttributes ): string; mergeDirectedEdge( source: unknown, target: unknown, attributes?: Partial ): EdgeMergeResult; updateDirectedEdge( source: unknown, target: unknown, updater?: (attributes: Partial) => EdgeAttributes ): EdgeMergeResult; addUndirectedEdge( source: unknown, target: unknown, attributes?: EdgeAttributes ): string; mergeUndirectedEdge( source: unknown, target: unknown, attributes?: Partial ): EdgeMergeResult; updateUndirectedEdge( source: unknown, target: unknown, updater?: (attributes: Partial) => EdgeAttributes ): EdgeMergeResult; addEdgeWithKey( edge: unknown, source: unknown, target: unknown, attributes?: EdgeAttributes ): string; mergeEdgeWithKey( edge: unknown, source: unknown, target: unknown, attributes?: Partial ): EdgeMergeResult; updateEdgeWithKey( edge: unknown, source: unknown, target: unknown, updater?: (attributes: Partial) => EdgeAttributes ): EdgeMergeResult; addDirectedEdgeWithKey( edge: unknown, source: unknown, target: unknown, attributes?: EdgeAttributes ): string; mergeDirectedEdgeWithKey( edge: unknown, source: unknown, target: unknown, attributes?: Partial ): EdgeMergeResult; updateDirectedEdgeWithKey( edge: unknown, source: unknown, target: unknown, updater?: (attributes: Partial) => EdgeAttributes ): EdgeMergeResult; addUndirectedEdgeWithKey( edge: unknown, source: unknown, target: unknown, attributes?: EdgeAttributes ): string; mergeUndirectedEdgeWithKey( edge: unknown, source: unknown, target: unknown, attributes?: Partial ): EdgeMergeResult; updateUndirectedEdgeWithKey( edge: unknown, source: unknown, target: unknown, updater?: (attributes: Partial) => EdgeAttributes ): EdgeMergeResult; dropNode(node: unknown): void; dropEdge(edge: unknown): void; dropEdge(source: unknown, target: unknown): void; dropDirectedEdge(source: unknown, target: unknown): void; dropUndirectedEdge(source: unknown, target: unknown): void; clear(): void; clearEdges(): void; // Graph attribute methods getAttribute( name: AttributeName ): GraphAttributes[AttributeName]; getAttributes(): GraphAttributes; hasAttribute( name: AttributeName ): boolean; setAttribute( name: AttributeName, value: GraphAttributes[AttributeName] ): this; updateAttribute( name: AttributeName, updater: ( value: GraphAttributes[AttributeName] | undefined ) => GraphAttributes[AttributeName] ): this; removeAttribute( name: AttributeName ): this; replaceAttributes(attributes: GraphAttributes): this; mergeAttributes(attributes: Partial): this; updateAttributes( updater: (attributes: GraphAttributes) => GraphAttributes ): this; // Node attribute methods getNodeAttribute( node: unknown, name: AttributeName ): NodeAttributes[AttributeName]; getNodeAttributes(node: unknown): NodeAttributes; hasNodeAttribute( node: unknown, name: AttributeName ): boolean; setNodeAttribute( node: unknown, name: AttributeName, value: NodeAttributes[AttributeName] ): this; updateNodeAttribute( node: unknown, name: AttributeName, updater: ( value: NodeAttributes[AttributeName] | undefined ) => NodeAttributes[AttributeName] ): this; removeNodeAttribute( node: unknown, name: AttributeName ): this; replaceNodeAttributes(node: unknown, attributes: NodeAttributes): this; mergeNodeAttributes(node: unknown, attributes: Partial): this; updateNodeAttributes( node: unknown, updater: (attributes: NodeAttributes) => NodeAttributes ): this; getSourceAttribute( edge: unknown, name: AttributeName ): NodeAttributes[AttributeName]; getSourceAttributes(edge: unknown): NodeAttributes; hasSourceAttribute( edge: unknown, name: AttributeName ): boolean; setSourceAttribute( edge: unknown, name: AttributeName, value: NodeAttributes[AttributeName] ): this; updateSourceAttribute( edge: unknown, name: AttributeName, updater: ( value: NodeAttributes[AttributeName] | undefined ) => NodeAttributes[AttributeName] ): this; removeSourceAttribute( edge: unknown, name: AttributeName ): this; replaceSourceAttributes(edge: unknown, attributes: NodeAttributes): this; mergeSourceAttributes( edge: unknown, attributes: Partial ): this; updateSourceAttributes( edge: unknown, updater: (attributes: NodeAttributes) => NodeAttributes ): this; getTargetAttribute( edge: unknown, name: AttributeName ): NodeAttributes[AttributeName]; getTargetAttributes(edge: unknown): NodeAttributes; hasTargetAttribute( edge: unknown, name: AttributeName ): boolean; setTargetAttribute( edge: unknown, name: AttributeName, value: NodeAttributes[AttributeName] ): this; updateTargetAttribute( edge: unknown, name: AttributeName, updater: ( value: NodeAttributes[AttributeName] | undefined ) => NodeAttributes[AttributeName] ): this; removeTargetAttribute( edge: unknown, name: AttributeName ): this; replaceTargetAttributes(edge: unknown, attributes: NodeAttributes): this; mergeTargetAttributes( edge: unknown, attributes: Partial ): this; updateTargetAttributes( edge: unknown, updater: (attributes: NodeAttributes) => NodeAttributes ): this; getOppositeAttribute( node: unknown, edge: unknown, name: AttributeName ): NodeAttributes[AttributeName]; getOppositeAttributes(node: unknown): NodeAttributes; hasOppositeAttribute( node: unknown, edge: unknown, name: AttributeName ): boolean; setOppositeAttribute( node: unknown, edge: unknown, name: AttributeName, value: NodeAttributes[AttributeName] ): this; updateOppositeAttribute( node: unknown, edge: unknown, name: AttributeName, updater: ( value: NodeAttributes[AttributeName] | undefined ) => NodeAttributes[AttributeName] ): this; removeOppositeAttribute( node: unknown, edge: unknown, name: AttributeName ): this; replaceOppositeAttributes( node: unknown, edge: unknown, attributes: NodeAttributes ): this; mergeOppositeAttributes( node: unknown, edge: unknown, attributes: Partial ): this; updateOppositeAttributes( node: unknown, edge: unknown, updater: (attributes: NodeAttributes) => NodeAttributes ): this; updateEachNodeAttributes( updater: NodeMapper, hints?: UpdateHints ): void; // Edge attribute methods getEdgeAttribute( edge: unknown, name: AttributeName ): EdgeAttributes[AttributeName]; getEdgeAttributes(edge: unknown): EdgeAttributes; hasEdgeAttribute( edge: unknown, name: AttributeName ): boolean; setEdgeAttribute( edge: unknown, name: AttributeName, value: EdgeAttributes[AttributeName] ): this; updateEdgeAttribute( edge: unknown, name: AttributeName, updater: ( value: EdgeAttributes[AttributeName] | undefined ) => EdgeAttributes[AttributeName] ): this; removeEdgeAttribute( edge: unknown, name: AttributeName ): this; replaceEdgeAttributes(edge: unknown, attributes: EdgeAttributes): this; mergeEdgeAttributes(edge: unknown, attributes: Partial): this; updateEdgeAttributes( edge: unknown, updater: (attributes: EdgeAttributes) => EdgeAttributes ): this; updateEachEdgeAttributes( updater: EdgeMapper, hints?: UpdateHints ): void; // Edge attribute methods (source, target) getEdgeAttribute( source: unknown, target: unknown, name: AttributeName ): EdgeAttributes[AttributeName]; getEdgeAttributes(source: unknown, target: unknown): EdgeAttributes; hasEdgeAttribute( source: unknown, target: unknown, name: AttributeName ): boolean; setEdgeAttribute( source: unknown, target: unknown, name: AttributeName, value: EdgeAttributes[AttributeName] ): this; updateEdgeAttribute( source: unknown, target: unknown, name: AttributeName, updater: ( value: EdgeAttributes[AttributeName] | undefined ) => EdgeAttributes[AttributeName] ): this; removeEdgeAttribute( source: unknown, target: unknown, name: AttributeName ): this; replaceEdgeAttributes( source: unknown, target: unknown, attributes: EdgeAttributes ): this; mergeEdgeAttributes( source: unknown, target: unknown, attributes: Partial ): this; updateEdgeAttributes( source: unknown, target: unknown, updater: (attributes: EdgeAttributes) => EdgeAttributes ): this; getDirectedEdgeAttribute( source: unknown, target: unknown, name: AttributeName ): EdgeAttributes[AttributeName]; getDirectedEdgeAttributes(source: unknown, target: unknown): EdgeAttributes; hasDirectedEdgeAttribute( source: unknown, target: unknown, name: AttributeName ): boolean; setDirectedEdgeAttribute( source: unknown, target: unknown, name: AttributeName, value: EdgeAttributes[AttributeName] ): this; updateDirectedEdgeAttribute( source: unknown, target: unknown, name: AttributeName, updater: ( value: EdgeAttributes[AttributeName] | undefined ) => EdgeAttributes[AttributeName] ): this; removeDirectedEdgeAttribute( source: unknown, target: unknown, name: AttributeName ): this; replaceDirectedEdgeAttributes( source: unknown, target: unknown, attributes: EdgeAttributes ): this; mergeDirectedEdgeAttributes( source: unknown, target: unknown, attributes: Partial ): this; updateDirectedEdgeAttributes( source: unknown, target: unknown, updater: (attributes: EdgeAttributes) => EdgeAttributes ): this; getUndirectedEdgeAttribute( source: unknown, target: unknown, name: AttributeName ): EdgeAttributes[AttributeName]; getUndirectedEdgeAttributes(source: unknown, target: unknown): EdgeAttributes; hasUndirectedEdgeAttribute( source: unknown, target: unknown, name: AttributeName ): boolean; setUndirectedEdgeAttribute( source: unknown, target: unknown, name: AttributeName, value: EdgeAttributes[AttributeName] ): this; updateUndirectedEdgeAttribute( source: unknown, target: unknown, name: AttributeName, updater: ( value: EdgeAttributes[AttributeName] | undefined ) => EdgeAttributes[AttributeName] ): this; removeUndirectedEdgeAttribute( source: unknown, target: unknown, name: AttributeName ): this; replaceUndirectedEdgeAttributes( source: unknown, target: unknown, attributes: EdgeAttributes ): this; mergeUndirectedEdgeAttributes( source: unknown, target: unknown, attributes: Partial ): this; updateUndirectedEdgeAttributes( source: unknown, target: unknown, updater: (attributes: EdgeAttributes) => EdgeAttributes ): this; // Iteration methods forEachAdjacencyEntry( callback: AdjacencyIterationCallback ): void; forEachAssymetricAdjacencyEntry( callback: AdjacencyIterationCallback ): void; forEachAdjacencyEntryWithOrphans( callback: AdjacencyIterationCallbackWithOrphans< NodeAttributes, EdgeAttributes > ): void; forEachAssymetricAdjacencyEntryWithOrphans( callback: AdjacencyIterationCallbackWithOrphans< NodeAttributes, EdgeAttributes > ): void; nodes(): Array; forEachNode(callback: NodeIterationCallback): void; mapNodes(callback: NodeMapper): Array; filterNodes(callback: NodePredicate): Array; reduceNodes(callback: NodeReducer, initialValue: T): T; findNode(callback: NodePredicate): string | undefined; someNode(callback: NodePredicate): boolean; everyNode(callback: NodePredicate): boolean; nodeEntries(): IterableIterator>; edges(): Array; edges(node: unknown): Array; edges(source: unknown, target: unknown): Array; undirectedEdges(): Array; undirectedEdges(node: unknown): Array; undirectedEdges(source: unknown, target: unknown): Array; directedEdges(): Array; directedEdges(node: unknown): Array; directedEdges(source: unknown, target: unknown): Array; inEdges(): Array; inEdges(node: unknown): Array; inEdges(source: unknown, target: unknown): Array; outEdges(): Array; outEdges(node: unknown): Array; outEdges(source: unknown, target: unknown): Array; inboundEdges(): Array; inboundEdges(node: unknown): Array; inboundEdges(source: unknown, target: unknown): Array; outboundEdges(): Array; outboundEdges(node: unknown): Array; outboundEdges(source: unknown, target: unknown): Array; forEachEdge( callback: EdgeIterationCallback ): void; forEachEdge( node: unknown, callback: EdgeIterationCallback ): void; forEachEdge( source: unknown, target: unknown, callback: EdgeIterationCallback ): void; forEachUndirectedEdge( callback: EdgeIterationCallback ): void; forEachUndirectedEdge( node: unknown, callback: EdgeIterationCallback ): void; forEachUndirectedEdge( source: unknown, target: unknown, callback: EdgeIterationCallback ): void; forEachDirectedEdge( callback: EdgeIterationCallback ): void; forEachDirectedEdge( node: unknown, callback: EdgeIterationCallback ): void; forEachDirectedEdge( source: unknown, target: unknown, callback: EdgeIterationCallback ): void; forEachInEdge( callback: EdgeIterationCallback ): void; forEachInEdge( node: unknown, callback: EdgeIterationCallback ): void; forEachInEdge( source: unknown, target: unknown, callback: EdgeIterationCallback ): void; forEachOutEdge( callback: EdgeIterationCallback ): void; forEachOutEdge( node: unknown, callback: EdgeIterationCallback ): void; forEachOutEdge( source: unknown, target: unknown, callback: EdgeIterationCallback ): void; forEachInboundEdge( callback: EdgeIterationCallback ): void; forEachInboundEdge( node: unknown, callback: EdgeIterationCallback ): void; forEachInboundEdge( source: unknown, target: unknown, callback: EdgeIterationCallback ): void; forEachOutboundEdge( callback: EdgeIterationCallback ): void; forEachOutboundEdge( node: unknown, callback: EdgeIterationCallback ): void; forEachOutboundEdge( source: unknown, target: unknown, callback: EdgeIterationCallback ): void; mapEdges( callback: EdgeMapper ): Array; mapEdges( node: unknown, callback: EdgeMapper ): Array; mapEdges( source: unknown, target: unknown, callback: EdgeMapper ): Array; mapUndirectedEdges( callback: EdgeMapper ): Array; mapUndirectedEdges( node: unknown, callback: EdgeMapper ): Array; mapUndirectedEdges( source: unknown, target: unknown, callback: EdgeMapper ): Array; mapDirectedEdges( callback: EdgeMapper ): Array; mapDirectedEdges( node: unknown, callback: EdgeMapper ): Array; mapDirectedEdges( source: unknown, target: unknown, callback: EdgeMapper ): Array; mapInEdges( callback: EdgeMapper ): Array; mapInEdges( node: unknown, callback: EdgeMapper ): Array; mapInEdges( source: unknown, target: unknown, callback: EdgeMapper ): Array; mapOutEdges( callback: EdgeMapper ): Array; mapOutEdges( node: unknown, callback: EdgeMapper ): Array; mapOutEdges( source: unknown, target: unknown, callback: EdgeMapper ): Array; mapInboundEdges( callback: EdgeMapper ): Array; mapInboundEdges( node: unknown, callback: EdgeMapper ): Array; mapInboundEdges( source: unknown, target: unknown, callback: EdgeMapper ): Array; mapOutboundEdges( callback: EdgeMapper ): Array; mapOutboundEdges( node: unknown, callback: EdgeMapper ): Array; mapOutboundEdges( source: unknown, target: unknown, callback: EdgeMapper ): Array; filterEdges( callback: EdgePredicate ): Array; filterEdges( node: unknown, callback: EdgePredicate ): Array; filterEdges( source: unknown, target: unknown, callback: EdgePredicate ): Array; filterUndirectedEdges( callback: EdgePredicate ): Array; filterUndirectedEdges( node: unknown, callback: EdgePredicate ): Array; filterUndirectedEdges( source: unknown, target: unknown, callback: EdgePredicate ): Array; filterDirectedEdges( callback: EdgePredicate ): Array; filterDirectedEdges( node: unknown, callback: EdgePredicate ): Array; filterDirectedEdges( source: unknown, target: unknown, callback: EdgePredicate ): Array; filterInEdges( callback: EdgePredicate ): Array; filterInEdges( node: unknown, callback: EdgePredicate ): Array; filterInEdges( source: unknown, target: unknown, callback: EdgePredicate ): Array; filterOutEdges( callback: EdgePredicate ): Array; filterOutEdges( node: unknown, callback: EdgePredicate ): Array; filterOutEdges( source: unknown, target: unknown, callback: EdgePredicate ): Array; filterInboundEdges( callback: EdgePredicate ): Array; filterInboundEdges( node: unknown, callback: EdgePredicate ): Array; filterInboundEdges( source: unknown, target: unknown, callback: EdgePredicate ): Array; filterOutboundEdges( callback: EdgePredicate ): Array; filterOutboundEdges( node: unknown, callback: EdgePredicate ): Array; filterOutboundEdges( source: unknown, target: unknown, callback: EdgePredicate ): Array; reduceEdges( callback: EdgeReducer, initialValue: T ): T; reduceEdges( node: unknown, callback: EdgeReducer, initialValue: T ): T; reduceEdges( source: unknown, target: unknown, callback: EdgeReducer, initialValue: T ): T; reduceUndirectedEdges( callback: EdgeReducer, initialValue: T ): T; reduceUndirectedEdges( node: unknown, callback: EdgeReducer, initialValue: T ): T; reduceUndirectedEdges( source: unknown, target: unknown, callback: EdgeReducer, initialValue: T ): T; reduceDirectedEdges( callback: EdgeReducer, initialValue: T ): T; reduceDirectedEdges( node: unknown, callback: EdgeReducer, initialValue: T ): T; reduceDirectedEdges( source: unknown, target: unknown, callback: EdgeReducer, initialValue: T ): T; reduceInEdges( callback: EdgeReducer, initialValue: T ): T; reduceInEdges( node: unknown, callback: EdgeReducer, initialValue: T ): T; reduceInEdges( source: unknown, target: unknown, callback: EdgeReducer, initialValue: T ): T; reduceOutEdges( callback: EdgeReducer, initialValue: T ): T; reduceOutEdges( node: unknown, callback: EdgeReducer, initialValue: T ): T; reduceOutEdges( source: unknown, target: unknown, callback: EdgeReducer, initialValue: T ): T; reduceInboundEdges( callback: EdgeReducer, initialValue: T ): T; reduceInboundEdges( node: unknown, callback: EdgeReducer, initialValue: T ): T; reduceInboundEdges( source: unknown, target: unknown, callback: EdgeReducer, initialValue: T ): T; reduceOutboundEdges( callback: EdgeReducer, initialValue: T ): T; reduceOutboundEdges( node: unknown, callback: EdgeReducer, initialValue: T ): T; reduceOutboundEdges( source: unknown, target: unknown, callback: EdgeReducer, initialValue: T ): T; findEdge( callback: EdgePredicate ): string | undefined; findEdge( node: unknown, callback: EdgePredicate ): string | undefined; findEdge( source: unknown, target: unknown, callback: EdgePredicate ): string | undefined; findUndirectedEdge( callback: EdgePredicate ): string | undefined; findUndirectedEdge( node: unknown, callback: EdgePredicate ): string | undefined; findUndirectedEdge( source: unknown, target: unknown, callback: EdgePredicate ): string | undefined; findDirectedEdge( callback: EdgePredicate ): string | undefined; findDirectedEdge( node: unknown, callback: EdgePredicate ): string | undefined; findDirectedEdge( source: unknown, target: unknown, callback: EdgePredicate ): string | undefined; findInEdge( callback: EdgePredicate ): string | undefined; findInEdge( node: unknown, callback: EdgePredicate ): string | undefined; findInEdge( source: unknown, target: unknown, callback: EdgePredicate ): string | undefined; findOutEdge( callback: EdgePredicate ): string | undefined; findOutEdge( node: unknown, callback: EdgePredicate ): string | undefined; findOutEdge( source: unknown, target: unknown, callback: EdgePredicate ): string | undefined; findInboundEdge( callback: EdgePredicate ): string | undefined; findInboundEdge( node: unknown, callback: EdgePredicate ): string | undefined; findInboundEdge( source: unknown, target: unknown, callback: EdgePredicate ): string | undefined; findOutboundEdge( callback: EdgePredicate ): string | undefined; findOutboundEdge( node: unknown, callback: EdgePredicate ): string | undefined; findOutboundEdge( source: unknown, target: unknown, callback: EdgePredicate ): string | undefined; someEdge(callback: EdgePredicate): boolean; someEdge( node: unknown, callback: EdgePredicate ): boolean; someEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; someUndirectedEdge( callback: EdgePredicate ): boolean; someUndirectedEdge( node: unknown, callback: EdgePredicate ): boolean; someUndirectedEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; someDirectedEdge( callback: EdgePredicate ): boolean; someDirectedEdge( node: unknown, callback: EdgePredicate ): boolean; someDirectedEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; someInEdge(callback: EdgePredicate): boolean; someInEdge( node: unknown, callback: EdgePredicate ): boolean; someInEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; someOutEdge(callback: EdgePredicate): boolean; someOutEdge( node: unknown, callback: EdgePredicate ): boolean; someOutEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; someInboundEdge( callback: EdgePredicate ): boolean; someInboundEdge( node: unknown, callback: EdgePredicate ): boolean; someInboundEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; someOutboundEdge( callback: EdgePredicate ): boolean; someOutboundEdge( node: unknown, callback: EdgePredicate ): boolean; someOutboundEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; everyEdge(callback: EdgePredicate): boolean; everyEdge( node: unknown, callback: EdgePredicate ): boolean; everyEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; everyUndirectedEdge( callback: EdgePredicate ): boolean; everyUndirectedEdge( node: unknown, callback: EdgePredicate ): boolean; everyUndirectedEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; everyDirectedEdge( callback: EdgePredicate ): boolean; everyDirectedEdge( node: unknown, callback: EdgePredicate ): boolean; everyDirectedEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; everyInEdge(callback: EdgePredicate): boolean; everyInEdge( node: unknown, callback: EdgePredicate ): boolean; everyInEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; everyOutEdge( callback: EdgePredicate ): boolean; everyOutEdge( node: unknown, callback: EdgePredicate ): boolean; everyOutEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; everyInboundEdge( callback: EdgePredicate ): boolean; everyInboundEdge( node: unknown, callback: EdgePredicate ): boolean; everyInboundEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; everyOutboundEdge( callback: EdgePredicate ): boolean; everyOutboundEdge( node: unknown, callback: EdgePredicate ): boolean; everyOutboundEdge( source: unknown, target: unknown, callback: EdgePredicate ): boolean; edgeEntries(): IterableIterator>; edgeEntries( node: unknown ): IterableIterator>; edgeEntries( source: unknown, target: unknown ): IterableIterator>; undirectedEdgeEntries(): IterableIterator< EdgeEntry >; undirectedEdgeEntries( node: unknown ): IterableIterator>; undirectedEdgeEntries( source: unknown, target: unknown ): IterableIterator>; directedEdgeEntries(): IterableIterator< EdgeEntry >; directedEdgeEntries( node: unknown ): IterableIterator>; directedEdgeEntries( source: unknown, target: unknown ): IterableIterator>; inEdgeEntries(): IterableIterator>; inEdgeEntries( node: unknown ): IterableIterator>; inEdgeEntries( source: unknown, target: unknown ): IterableIterator>; outEdgeEntries(): IterableIterator>; outEdgeEntries( node: unknown ): IterableIterator>; outEdgeEntries( source: unknown, target: unknown ): IterableIterator>; inboundEdgeEntries(): IterableIterator< EdgeEntry >; inboundEdgeEntries( node: unknown ): IterableIterator>; inboundEdgeEntries( source: unknown, target: unknown ): IterableIterator>; outboundEdgeEntries(): IterableIterator< EdgeEntry >; outboundEdgeEntries( node: unknown ): IterableIterator>; outboundEdgeEntries( source: unknown, target: unknown ): IterableIterator>; neighbors(node: unknown): Array; undirectedNeighbors(node: unknown): Array; directedNeighbors(node: unknown): Array; inNeighbors(node: unknown): Array; outNeighbors(node: unknown): Array; inboundNeighbors(node: unknown): Array; outboundNeighbors(node: unknown): Array; forEachNeighbor( node: unknown, callback: NeighborIterationCallback ): void; forEachUndirectedNeighbor( node: unknown, callback: NeighborIterationCallback ): void; forEachDirectedNeighbor( node: unknown, callback: NeighborIterationCallback ): void; forEachInNeighbor( node: unknown, callback: NeighborIterationCallback ): void; forEachOutNeighbor( node: unknown, callback: NeighborIterationCallback ): void; forEachInboundNeighbor( node: unknown, callback: NeighborIterationCallback ): void; forEachOutboundNeighbor( node: unknown, callback: NeighborIterationCallback ): void; mapNeighbors( node: unknown, callback: NeighborMapper ): Array; mapUndirectedNeighbors( node: unknown, callback: NeighborMapper ): Array; mapDirectedNeighbors( node: unknown, callback: NeighborMapper ): Array; mapInNeighbors( node: unknown, callback: NeighborMapper ): Array; mapOutNeighbors( node: unknown, callback: NeighborMapper ): Array; mapInboundNeighbors( node: unknown, callback: NeighborMapper ): Array; mapOutboundNeighbors( node: unknown, callback: NeighborMapper ): Array; filterNeighbors( node: unknown, callback: NeighborPredicate ): Array; filterUndirectedNeighbors( node: unknown, callback: NeighborPredicate ): Array; filterDirectedNeighbors( node: unknown, callback: NeighborPredicate ): Array; filterInNeighbors( node: unknown, callback: NeighborPredicate ): Array; filterOutNeighbors( node: unknown, callback: NeighborPredicate ): Array; filterInboundNeighbors( node: unknown, callback: NeighborPredicate ): Array; filterOutboundNeighbors( node: unknown, callback: NeighborPredicate ): Array; reduceNeighbors( node: unknown, callback: NeighborReducer, initialValue: T ): T; reduceUndirectedNeighbors( node: unknown, callback: NeighborReducer, initialValue: T ): T; reduceDirectedNeighbors( node: unknown, callback: NeighborReducer, initialValue: T ): T; reduceInNeighbors( node: unknown, callback: NeighborReducer, initialValue: T ): T; reduceOutNeighbors( node: unknown, callback: NeighborReducer, initialValue: T ): T; reduceInboundNeighbors( node: unknown, callback: NeighborReducer, initialValue: T ): T; reduceOutboundNeighbors( node: unknown, callback: NeighborReducer, initialValue: T ): T; findNeighbor( node: unknown, callback: NeighborPredicate ): string | undefined; findUndirectedNeighbor( node: unknown, callback: NeighborPredicate ): string | undefined; findDirectedNeighbor( node: unknown, callback: NeighborPredicate ): string | undefined; findInNeighbor( node: unknown, callback: NeighborPredicate ): string | undefined; findOutNeighbor( node: unknown, callback: NeighborPredicate ): string | undefined; findInboundNeighbor( node: unknown, callback: NeighborPredicate ): string | undefined; findOutboundNeighbor( node: unknown, callback: NeighborPredicate ): string | undefined; someNeighbor( node: unknown, callback: NeighborPredicate ): boolean; someUndirectedNeighbor( node: unknown, callback: NeighborPredicate ): boolean; someDirectedNeighbor( node: unknown, callback: NeighborPredicate ): boolean; someInNeighbor( node: unknown, callback: NeighborPredicate ): boolean; someOutNeighbor( node: unknown, callback: NeighborPredicate ): boolean; someInboundNeighbor( node: unknown, callback: NeighborPredicate ): boolean; someOutboundNeighbor( node: unknown, callback: NeighborPredicate ): boolean; everyNeighbor( node: unknown, callback: NeighborPredicate ): boolean; everyUndirectedNeighbor( node: unknown, callback: NeighborPredicate ): boolean; everyDirectedNeighbor( node: unknown, callback: NeighborPredicate ): boolean; everyInNeighbor( node: unknown, callback: NeighborPredicate ): boolean; everyOutNeighbor( node: unknown, callback: NeighborPredicate ): boolean; everyInboundNeighbor( node: unknown, callback: NeighborPredicate ): boolean; everyOutboundNeighbor( node: unknown, callback: NeighborPredicate ): boolean; neighborEntries( node: unknown ): IterableIterator>; undirectedNeighborEntries( node: unknown ): IterableIterator>; directedNeighborEntries( node: unknown ): IterableIterator>; inNeighborEntries( node: unknown ): IterableIterator>; outNeighborEntries( node: unknown ): IterableIterator>; inboundNeighborEntries( node: unknown ): IterableIterator>; outboundNeighborEntries( node: unknown ): IterableIterator>; // Serialization methods export(): SerializedGraph; import( data: Partial< SerializedGraph >, merge?: boolean ): this; import( graph: AbstractGraph, merge?: boolean ): this; // Utils nullCopy( options?: Partial ): AbstractGraph; emptyCopy( options?: Partial ): AbstractGraph; copy( options?: Partial ): AbstractGraph; // Well-known methods toJSON(): SerializedGraph; toString(): string; inspect(): any; static from< NA extends Attributes = Attributes, EA extends Attributes = Attributes, GA extends Attributes = Attributes >( data: SerializedGraph | AbstractGraph, options?: GraphOptions ): AbstractGraph; } interface GraphConstructor< NodeAttributes extends Attributes = Attributes, EdgeAttributes extends Attributes = Attributes, GraphAttributes extends Attributes = Attributes > { new (options?: GraphOptions): AbstractGraph< NodeAttributes, EdgeAttributes, GraphAttributes >; } export { AbstractGraph, GraphConstructor, Attributes, GraphType, GraphOptions, GraphEvents, AdjacencyEntry, NodeEntry, NodeMergeResult, NeighborEntry, EdgeEntry, EdgeMergeResult, AdjacencyIterationCallback, AdjacencyIterationCallbackWithOrphans, NodeIterationCallback, NodePredicate, NodeMapper, NodeReducer, NeighborIterationCallback, NeighborPredicate, NeighborMapper, NeighborReducer, EdgeIterationCallback, EdgePredicate, EdgeMapper, EdgeReducer, SerializedNode, SerializedEdge, SerializedGraph, AttributeUpdateType, AttributeUpdatePayload }; export default AbstractGraph;