export type GraphOptions = { multi?: boolean; type?: 'directed' | 'undirected' | 'mixed'; }; export interface GraphInstance { readonly order: number; readonly size: number; addNode(id: string, attrs?: Record): void; addEdge(source: string, target: string, attrs?: Record): void; hasNode(id: string): boolean; hasEdge(source: string, target: string): boolean; getNodeAttribute(id: string, key: string): unknown; getEdgeAttribute(source: string, target: string, key: string): unknown; getEdgeAttribute(edgeKey: string, key: string): unknown; forEachNode(cb: (id: string, attrs: Record) => void): void; forEachEdge(cb: (edge: string, attrs: Record, source: string, target: string) => void): void; outNeighbors(id: string): string[]; inNeighbors(id: string): string[]; neighbors(id: string): string[]; degree(id: string): number; nodes(): string[]; edges(): string[]; edges(source: string, target: string): string[]; } type GraphCtor = new (options?: GraphOptions) => GraphInstance; export declare const Graph: GraphCtor; export declare const louvain: (graph: GraphInstance, options?: { resolution?: number; rng?: () => number; }) => Record; export declare const pageRankFn: (graph: GraphInstance, options?: { maxIterations?: number; tolerance?: number; }) => Record; export declare const betweennessFn: (graph: GraphInstance) => Record; /** * Modularity scorer from graphology-metrics. Signed in terms of our own * `GraphInstance` for consistency with other helpers. `getNodeCommunity` * accepts either an attribute name or a mapper `(node, attrs) => id`. */ export declare const louvainModularity: (graph: GraphInstance, options?: { getNodeCommunity?: string | ((node: string, attrs: Record) => string | number); resolution?: number; }) => number; export {};