import type { DownstreamEdge } from 'pipework-flow-parser'; import type { FlowStepSite } from '../check/flow-step-site.js'; import { type BranchKind } from './branch-context.js'; /** * The analyzer's structural verdict for a `@downstream` edge. * * - `step` — every located call site is linear; traversed at most once. * - `branch` — at least one call site is reached through a loop, an iteration * method, a Promise-combinator fan-out, or recursion. * - `ambiguous` — no call site could be located. The edge is reached through * indirection the analyzer does not follow (a bare callback, dynamic * dispatch), so its cardinality must be declared by hand. See Q1. */ export type StructuralCardinality = 'step' | 'branch' | 'ambiguous'; export interface EdgeClassification { /** Source path of the flow step the edge is declared on, relative to `cwd`. */ readonly file: string; /** Name of the flow step the edge is declared on. */ readonly from: string; /** The declared edge, verbatim from the annotation. */ readonly edge: DownstreamEdge; /** The analyzer's structural verdict. */ readonly structural: StructuralCardinality; /** The branching construct, when `structural` is `branch`; otherwise `null`. */ readonly branchKind: BranchKind | null; /** 1-based file line of the call site driving the verdict; `null` when none was located. */ readonly line: number | null; } /** Classifies one `@downstream` edge of `site` against the flow-step body. */ export declare function classifyEdge(file: string, site: FlowStepSite, edge: DownstreamEdge): EdgeClassification; //# sourceMappingURL=classify-edge.d.ts.map