/**
 * Leiden community detection — vendored from ngraph.leiden (MIT).
 * Adapted to work directly with CodeGraph (no external graph library dependency).
 *
 * Original: https://github.com/anvaka/ngraph.leiden
 * License:  MIT — see LICENSE in this directory.
 */
import type { CodeGraph } from '../../model.js';
import type { LeidenOptions } from './optimiser.js';
export type { LeidenOptions } from './optimiser.js';
export type DetectClustersOptions = LeidenOptions;
export interface DetectClustersResult {
    getClass(nodeId: string | number): number | undefined;
    getCommunities(): Map<number, string[]>;
    quality(): number;
    toJSON(): {
        membership: Record<string, number>;
        meta: {
            levels: number;
            quality: number;
            options: DetectClustersOptions;
        };
    };
}
/**
 * Detect communities in a CodeGraph using the Leiden algorithm.
 *
 * Note on `quality()`: For modularity, `quality()` always evaluates at gamma=1.0
 * (standard Newman-Girvan modularity) regardless of the `resolution` used during
 * optimization. This makes quality values comparable across runs with different
 * resolutions. For CPM, `quality()` uses the caller-specified resolution since gamma
 * is intrinsic to the CPM metric. Do not use modularity `quality()` values to
 * compare partitions found at different resolutions — they reflect Q at gamma=1.0,
 * not the objective that was actually optimized.
 */
export declare function detectClusters(graph: CodeGraph, options?: DetectClustersOptions): DetectClustersResult;
//# sourceMappingURL=index.d.ts.map