/**
 * `when` on a wire edge — the branch conditions its call site sits under,
 * read from the source at request time (see `src/graph/branch-guards.ts`).
 *
 * The viewer groups a symbol's edges into relations; this annotates the edges
 * of a set of relations in one pass, parsing each file once. Files that
 * drifted since the index sync are skipped: the recorded line no longer
 * reliably points at the call, and a label at the wrong line is worse than
 * none. The pass is bounded so a hub with hundreds of callers cannot turn one
 * Symbol view into a parse of the repository.
 */
import type CodeGraph from '../../index';
import type { Language, Node } from '../../types';
import { type BranchGuard, type CallSiteText, type DefinitionDecorators, type ReturnSite, type SiteLoop, type SiteTrigger } from '../../graph/branch-guards';
import type { WireEdge } from './wire';
export interface WhenBatch {
    /** POSIX project-relative path of the file the call sites are in. */
    file: string;
    edges: WireEdge[];
}
export declare function annotateWhen(cg: CodeGraph, projectRoot: string, batches: readonly WhenBatch[]): Promise<void>;
/**
 * A per-request reader of the conditions ONE call site sits under, for the
 * endpoints that walk chains rather than annotate rails (the Screens view's
 * transitions, the Steps view's links). Files are resolved once, drifted
 * files yield no label, and the count of sites labelled is bounded so a wide
 * walk cannot turn one request into a parse of the repository.
 */
export interface SiteReader {
    /** The conditions the site runs under, joined; '' when unconditional or unreadable. */
    when(caller: {
        filePath: string;
        language: Language;
    }, site: {
        line?: number;
        column?: number;
    }): Promise<string>;
    /**
     * The same conditions, outermost first, unjoined — each with the branching
     * construct it belongs to, so two sites can be told to be the two arms of
     * ONE `if` rather than two conditions that happen to read as opposites.
     * What {@link SiteReader.when} joins; empty when unconditional or unreadable.
     */
    guards(caller: {
        filePath: string;
        language: Language;
    }, site: {
        line?: number;
        column?: number;
    }): Promise<BranchGuard[]>;
    /** The loops the site is written inside, outermost first — a run of calls that happens once per item. */
    loops(caller: {
        filePath: string;
        language: Language;
    }, site: {
        line?: number;
        column?: number;
    }): Promise<SiteLoop[]>;
    /** What the site passes, abbreviated (`'userEmail', values.email`); null when unreadable. '' for an empty list. */
    args(caller: {
        filePath: string;
        language: Language;
    }, site: {
        line?: number;
        column?: number;
    }): Promise<string | null>;
    /** What fires the site — the JSX prop, `on*` option or runs-later call it is written under; null when nothing binds it. */
    trigger(caller: {
        filePath: string;
        language: Language;
    }, site: {
        line?: number;
        column?: number;
    }): Promise<SiteTrigger | null>;
    /** The call as written (the whole member chain) and what it passes; null when unreadable. `callee` names the call when a position is shared. */
    callSite(caller: {
        filePath: string;
        language: Language;
    }, site: {
        line?: number;
        column?: number;
        callee?: string;
    }): Promise<CallSiteText | null>;
    /** The decorators / annotations / attributes on a definition, and on its class; null when unreadable. */
    decorators(definition: {
        filePath: string;
        language: Language;
        startLine: number;
    }): Promise<DefinitionDecorators | null>;
    /** The declared types of the members of the class a definition belongs to, by member name; empty when unreadable. */
    memberTypes(definition: {
        filePath: string;
        language: Language;
        startLine: number;
    }): Promise<Map<string, string>>;
    /** The `return`s a definition makes itself, with a same-class constant's value; empty when unreadable. */
    returns(definition: {
        filePath: string;
        language: Language;
        startLine: number;
    }): Promise<ReturnSite[]>;
    /**
     * The `'use server'` / `'use client'` directive a JS-family file opens with,
     * and whether the definition itself opens with `'use server'` (a server
     * action declared inline). Nothing for other languages or unreadable files.
     */
    directive(definition: {
        filePath: string;
        language: Language;
        startLine: number;
    }): Promise<{
        file: 'server' | 'client' | null;
        own: boolean;
    }>;
    /** A Swift `extension X {}` node — the index keeps it as a class, but it declares no type. */
    swiftExtension(definition: Pick<Node, 'filePath' | 'language' | 'kind' | 'startLine' | 'startColumn' | 'endLine'>): Promise<boolean>;
}
/**
 * Both readings of one call site — WHEN it runs and WITH WHAT — for the
 * endpoints that walk chains (Screens, Steps). One file resolution and one
 * parsed tree serve both; drifted files yield nothing; one site budget bounds
 * the whole pass.
 */
export declare function createSiteReader(cg: CodeGraph, projectRoot: string, maxSites?: number): SiteReader;
/** The `when` half of {@link createSiteReader}, for callers that read nothing else. */
export declare function createWhenReader(cg: CodeGraph, projectRoot: string, maxSites?: number): (caller: {
    filePath: string;
    language: Language;
}, site: {
    line?: number;
    column?: number;
}) => Promise<string>;
//# sourceMappingURL=when.d.ts.map