/**
 * Pure-function adapter — converts the in-memory `Graph` into the
 * shape cytoscape.js consumes (`ElementsDefinition` equivalent).
 *
 * Three tiers, matching the dashboard's three-level drill-down:
 *
 *   Tier 1 — community view (default tab landing)
 *     N community bubbles + inter-community edges, sized by
 *     member-count (sqrt scale) and labeled by dominantSourceDir.
 *
 *   Tier 2 — file view (within one community)
 *     File nodes for every file in the community, sized by call
 *     in-degree, edges = imports_from between member files plus
 *     the strongest cross-community import edges.
 *
 *   Tier 3 — symbol view (within one file)
 *     Symbol nodes for every function / class / method in the file,
 *     sized by call in-degree, edges = calls within the file plus
 *     thin external-call indicators that the renderer can wire as
 *     "click → jump to the target file."
 *
 * Pure: no DOM access, no cytoscape import, no I/O. Tested with
 * synthetic `Graph` fixtures (see test/dashboard/graph-adapter.test.ts).
 * The DOM-bound mounter (Part B's `graph-tab.ts`) consumes these
 * elements and hands them to cytoscape.
 *
 * Per CLAUDE.md Rule 12: every graph traversal here goes through
 * `src/explore/queries.ts` — no callers / callees / community lookup
 * code is reimplemented in this module. The arch gate enforces.
 */
import type { Graph } from '../explore/types';
/** A cytoscape node element — `data.id` is required. */
export interface CytoscapeNode {
    group: 'nodes';
    data: {
        id: string;
        /** Display label rendered by cytoscape. */
        label: string;
        /**
         * Numeric size hint in [0, 1]. The renderer maps this to a pixel
         * radius via the cytoscape stylesheet (e.g., 8px + 24px * size).
         * Sqrt-scaled at the adapter so 2× nodes don't dominate visually.
         */
        size: number;
        /**
         * Color group key — typically a pack id ('typescript', 'python',
         * ...) for Tier 1/2 and a symbol kind ('function', 'class', ...)
         * for Tier 3. The stylesheet binds this to the actual hex.
         */
        colorGroup: string;
        /**
         * Tier-specific payload. Renderer uses these for hover tooltips
         * + click-to-expand wiring. Optional fields are absent (not
         * `null`) when the underlying data didn't supply them.
         */
        tier: 1 | 2 | 3;
        /** Tier 1 only — present so the renderer can drill in. */
        communityId?: number;
        /** Tier 1 + Tier 2 — present so the renderer can drill in. */
        sourceFile?: string;
        /** Tier 3 only — present so the renderer can deep-link by line. */
        line?: number;
        /** Free-form metadata for the hover tooltip. Renderer formats. */
        meta?: Record<string, string | number | boolean>;
    };
}
/** A cytoscape edge element — `data.source` + `data.target` required. */
export interface CytoscapeEdge {
    group: 'edges';
    data: {
        id: string;
        source: string;
        target: string;
        /**
         * Edge category, drives stylesheet variant. `'calls'` = solid
         * gray, `'imports_from'` = dashed gray, `'method'` = thin gray
         * (Tier 3 only), `'community'` = thicker connector between
         * community bubbles in Tier 1.
         */
        relation: 'calls' | 'imports_from' | 'method' | 'community';
        /**
         * Visual weight hint in [0, 1]. The renderer maps to edge
         * thickness (e.g., 1px + 4px * weight). Sqrt-scaled.
         */
        weight: number;
        /** Renderer surfaces this on hover. Always >= 1 when present. */
        occurrences?: number;
        /**
         * Tier 3 only — set when the call's target is in a DIFFERENT
         * file. Renderer styles these as dim "leaving" indicators
         * pointing to a virtual external node, then makes them clickable
         * to navigate to the target file's Tier 3.
         */
        externalTargetFile?: string;
    };
}
/**
 * The complete set of cytoscape elements for one tier. Returned by
 * each adapter; consumed by `cytoscape({ elements: [...] })`. Empty
 * arrays are valid (e.g., a single-node community has no inter-file
 * edges); the renderer handles the empty cases.
 */
export interface CytoscapeElements {
    nodes: CytoscapeNode[];
    edges: CytoscapeEdge[];
}
/**
 * Build the cytoscape elements for the community-view (Tier 1) of a
 * graph. Each community becomes one node; inter-community edges are
 * synthesized by counting cross-community `calls` + `imports_from`
 * edges.
 *
 * Limit defaults to the top-20 communities by node-count — beyond
 * that the layout gets dense without adding information. The CLI's
 * `explore communities` default is 8; the viz needs more breadth to
 * communicate "this repo has lots of natural modules" so we lift
 * the cap.
 */
export declare function adaptToTier1(graph: Graph, opts?: {
    limit?: number;
}): CytoscapeElements;
/**
 * Build the cytoscape elements for the file-view (Tier 2) of one
 * community. File nodes are the union of `sourceFile` across all
 * nodes whose community is the target.
 *
 * Edges are intra-community `imports_from` + `calls` aggregated to
 * the file level (a 12-call cluster from src/foo.ts → src/bar.ts
 * becomes one edge with `occurrences: 12`).
 *
 * Empty result when the community id is unknown — the renderer
 * surfaces a "community not found" error in that case.
 */
export declare function adaptToTier2(graph: Graph, communityId: number): CytoscapeElements;
/**
 * Build the cytoscape elements for the symbol-view (Tier 3) of one
 * file. Symbol nodes are the function / class / method declarations
 * (module nodes are excluded — they're file-as-a-whole markers, not
 * navigable symbols).
 *
 * Edges are `calls` edges between symbols within the file. Calls
 * that LEAVE the file become "external" indicators carrying the
 * target file path — the renderer styles them as dim arrows and
 * makes them clickable for navigation.
 *
 * Empty result when no symbols are declared in the file (the file
 * isn't in the graph) — the renderer surfaces a "no symbols
 * extracted" message.
 */
export declare function adaptToTier3(graph: Graph, sourceFile: string): CytoscapeElements;
//# sourceMappingURL=graph-adapter.d.ts.map