/**
 * `GET /api/filecode/<path>` — the whole-file source view in one round-trip.
 *
 * The Symbol view asks "what does this body reach"; this screen asks the same
 * question of every line of a file at once, and answers it beside the file's
 * own source. What that needs is one payload holding everything the graph says
 * about lines in this file, and nothing that depends on scroll position:
 *
 * * the file's symbols in source order — the sticky outline rail, and the
 *   definition line every intra-file arc lands on,
 * * one row per (calling symbol, called symbol) pair, carrying the call-site
 *   lines the gutter ports and the callee rail anchor to,
 * * the references that never resolved, so a line that reaches `console.log`
 *   still shows a hollow port instead of an empty gutter that reads as
 *   "nothing happens here",
 * * the file's total line count, which IS the layout: every line is a fixed
 *   height, so the viewer can size a 6 800-line document and start drawing
 *   before a single page of source has arrived.
 *
 * The source itself does NOT ride along. A 6 800-line TypeScript file is ~1.5 s
 * of parsing and megabytes of JSON; the viewer pages it through
 * `/api/source` as the reader scrolls, which is also what lets the graph
 * facts — ports, arcs, rail rows — be complete from the first frame while the
 * text fills in behind them.
 *
 * **The arcs are not a separate list.** An arc is a call whose target is
 * defined in this same file, so the viewer derives them from `calls` and the
 * `intraFileCalls` count here is computed from the SHOWN groups for the same
 * reason: a header that counted raw edges would disagree with the picture under
 * it the moment a cap bit.
 */
import type { CodeGraph } from '../../index';
import { type WireOutlineEntry } from './file';
import { type WireList, type WireRelation } from './wire';
/**
 * Call groups returned for one file.
 *
 * A generous cap, not a display budget: the viewer only ever draws the rows in
 * the window it is scrolled to, so the number that matters is what a payload
 * costs to ship. This repo's largest file (`src/mcp/tools.ts`, 6 820 lines)
 * produces 498.
 */
export declare const MAX_FILE_CALL_GROUPS = 2000;
/**
 * Unresolved references returned for one file.
 *
 * These are markers, not rows — each one is a hollow port and a soft underline
 * with nothing behind it. `src/mcp/tools.ts` has 1 113; a generated bundle can
 * have tens of thousands, and past this point the count says everything the
 * list would.
 */
export declare const MAX_FILE_OUTSIDE_REFS = 3000;
/**
 * Unresolved-reference rows read before the count itself becomes a floor.
 *
 * `total` has to be the real number — the rest of this API guarantees that a
 * count equals a list — and the filter below (plain identifiers only) is not
 * expressible in SQL, so the rows have to be scanned to be counted. This is the
 * backstop against a generated bundle with a million of them, and it is far
 * above anything hand-written: the largest file in this repo's own index has
 * 1 113.
 */
export declare const MAX_FILE_OUTSIDE_SCAN = 50000;
/** A reference the resolver never landed: a port with no destination. */
export interface WireFileOutsideRef {
    line: number;
    col: number;
    /** The identifier as written — how the viewer finds the token to underline. */
    name: string;
    kind: string;
}
/** Every edge from ONE symbol in this file to ONE symbol anywhere. */
export interface WireFileCall {
    /**
     * The symbol in this file that makes the calls.
     *
     * Never null: extraction records a statement outside every definition as an
     * edge out of the FILE node, so top-level code has an owner too — the file
     * itself.
     */
    ownerId: string;
    /** First line of the owner's definition, so a rail row can be attributed. */
    ownerLine: number;
    relation: WireRelation;
}
export interface WireFileCodePayload {
    file: {
        path: string;
        language: string;
        size: number;
        indexedAt: number;
        contentHash: string;
        generated: boolean;
        test: boolean;
        errors: string[];
        /** The file node's own id — the owner of every top-level call. */
        id: string | null;
        /**
         * Lines on disk right now. Null when the file could not be read, which is
         * the one case the viewer cannot lay out and says so.
         */
        totalLines: number | null;
    };
    /** The file changed on disk since it was indexed — every line number is suspect. */
    drift: boolean;
    /** Why, when there is something to say beyond the flag. */
    reason?: string;
    /** The file's symbols in source order — the same rows `/api/file` draws. */
    outline: WireList<WireOutlineEntry>;
    /** One row per (calling symbol, called symbol) pair, in call-site order. */
    calls: WireList<WireFileCall>;
    /** References with nothing behind them — hollow ports. */
    outside: WireList<WireFileOutsideRef>;
    /**
     * Calls landing on a definition in THIS file — the arc diagram's total.
     *
     * Counted over the groups actually returned, so it always equals the number
     * of arcs the viewer can draw from this payload.
     */
    intraFileCalls: number;
    timing: {
        elapsedMs: number;
    };
}
export declare function buildFileCode(cg: CodeGraph, projectRoot: string, requested: string): WireFileCodePayload;
//# sourceMappingURL=filecode.d.ts.map