/**
 * `GET /api/screens` — the app as a reader experiences it: screens, and the
 * transitions between them, each labelled with what has to be true for it to
 * happen.
 *
 * The graph already holds the pieces: a `route` node per screen file (Expo
 * Router, and any framework that binds a route to the component that renders
 * it), and a `navigates` edge from the function that pushes a path to the
 * route it names. What a reader wants is neither of those nodes — it is
 * "from the Home screen, tapping an object card opens Object Detail, but only
 * for a collected object". That sentence is three hops away from the edge:
 *
 *   HomeScreen ─renders→ ItemsGrid ─renders→ ItemCard ─calls→ openObjectDetail ─navigates→ /object-detail
 *
 * So for every `navigates` edge this walks BACKWARDS from its source through
 * `calls` edges (the JSX-render synthesizer's edges among them) until it
 * reaches a component that a route renders. That component's screen is where
 * the transition starts; the nodes passed on the way are the `via` chain, and
 * the branch conditions at each call site along it (`graph/branch-guards.ts`)
 * are joined into the link's `when`. A navigation whose walk reaches no screen
 * within the hop cap — a store action, a service that runs after login — is
 * kept as an `origin` rather than dropped: it is a real transition with a real
 * trigger, just not a screen.
 *
 * Read from the graph at request time, never cached: the `when` labels are
 * read from the source as it stands. Seventy-odd transitions and a few
 * hundred guarded call sites resolve in tens of milliseconds.
 */
import type CodeGraph from '../../index';
import { type WireNodeRef } from './wire';
export interface WireScreen {
    /** The route node's id — what a link's `from`/`to` name. */
    id: string;
    /** The screen's path: `/object-detail`, `/item/[id]`. */
    path: string;
    file: string;
    line: number;
    /** The component the route renders, when the graph bound one. */
    component: WireNodeRef | null;
    /** Transitions into and out of this screen. */
    incoming: number;
    outgoing: number;
}
/**
 * A navigation whose start is not one screen: a function no screen reaches
 * (a store action after login), or a component so many screens render (a
 * top bar) that attributing its navigation to each of them would draw the
 * same three arrows from every box.
 */
export interface WireScreenOrigin {
    id: string;
    node: WireNodeRef;
    outgoing: number;
    /** For shared chrome: how many screens render it. */
    sharedBy?: number;
}
export interface WireScreenSite {
    file: string;
    line: number;
    /** The href as written at the call, `${…}` for interpolations. */
    href: string;
    /** `push`, `replace`, `navigate`, or `return` for a helper's return value. */
    method: string;
    /**
     * The conditions THIS site runs under — the whole chain's plus its own,
     * joined; '' when unconditional. A link with several sites is several
     * scenarios; the link's `when` is only their summary.
     */
    when: string;
}
export interface WireScreenLink {
    id: string;
    /** A screen id, or an origin id. */
    from: string;
    /** Always a screen id. */
    to: string;
    /** True when `from` is an origin, not a screen. */
    fromOrigin: boolean;
    /**
     * The symbols the transition passes through, from just below the screen's
     * component down to the one that holds the navigation call. Empty when the
     * screen's own component navigates.
     */
    via: WireNodeRef[];
    /** Conditions along the whole chain, joined; '' when unconditional. */
    when: string;
    /** Every call site behind this link (same screen, same chain end). */
    sites: WireScreenSite[];
    /**
     * The destination was inferred, not written at the call: it came back from
     * a helper's return value. (A synthesized render hop on the way — every
     * parent → child component step is one — does not count: that would dash
     * nearly every arrow.)
     */
    synthesized: boolean;
}
export interface WireScreensPayload {
    /** False when the graph holds no screen navigation at all. */
    routed: boolean;
    /** The route named `/`, when there is one. */
    entry: string | null;
    screens: WireScreen[];
    origins: WireScreenOrigin[];
    links: WireScreenLink[];
    /** Navigations dropped because the backwards walk hit a cap. */
    dropped: number;
    index: {
        lastIndexedAt: number | null;
        edges: number;
        files: number;
    };
    timing: {
        elapsedMs: number;
    };
}
export declare function buildScreens(cg: CodeGraph, projectRoot: string): Promise<WireScreensPayload>;
//# sourceMappingURL=screens.d.ts.map