import type { Diagnostic } from "./types.js"; /** Classifies the route role of a module used as a boundary graph entry. */ export type BoundaryGraphEntryKind = "module" | "route-layout" | "route-page" | "route-template"; /** Classifies how a module or export participates in client, server, and shared execution. */ export type BoundaryClassification = "client-boundary" | "client-route" | "server-action" | "server-only" | "server-render" | "shared" | "unknown"; /** Describes an entry module passed to boundary graph analysis. */ export interface BoundaryGraphEntry { file: string; kind: BoundaryGraphEntryKind; } /** Supplies entry modules and module loading hooks for boundary graph analysis. */ export interface BoundaryGraphInput { entries: readonly BoundaryGraphEntry[]; readModule(file: string): Promise | string | undefined; resolveModule(input: { importer: string; source: string; }): Promise | string | undefined; } /** Describes the boundary classification assigned to one named export. */ export interface BoundaryGraphExport { classification: BoundaryClassification; name: string; } /** Describes one analyzed module and the classifications for its exports. */ export interface BoundaryGraphModule { classification: BoundaryClassification; exports: BoundaryGraphExport[]; file: string; } /** Describes an import that crosses from server-rendered code into a client boundary. */ export interface BoundaryGraphClientBoundary { exportNames?: readonly string[]; importerFile: string; moduleFile: string; source: string; } /** Describes an inferred or explicit server action reference discovered in the graph. */ export interface BoundaryGraphServerActionSite { end: number; exportName: string; expression: string; expressionEnd: number; expressionStart: number; file: string; inferred: boolean; moduleFile: string; start: number; } /** Names the kind of boundary graph trace event. */ export type BoundaryGraphTraceKind = "client-boundary" | "export" | "module" | "server-action"; /** Names the analysis reason attached to a boundary graph trace event. */ export type BoundaryGraphTraceReason = "client-runtime-export" | "module-classification" | "node-builtin-import" | "rendered-import" | "server-action-expression" | "server-render-export" | "static-export" | "use-client-directive" | "unknown-module" | "use-server-directive"; /** Records one decision made while classifying a boundary graph. */ export interface BoundaryGraphTraceEvent { classification: BoundaryClassification; exportName?: string; exportNames?: readonly string[]; expression?: string; file: string; importerFile?: string; inferred?: boolean; kind: BoundaryGraphTraceKind; moduleFile?: string; reason: BoundaryGraphTraceReason; source?: string; viaExportName?: string; } /** Contains modules, client boundaries, server actions, diagnostics, and trace events for a graph analysis run. */ export interface BoundaryGraphResult { clientBoundaries: BoundaryGraphClientBoundary[]; diagnostics: Diagnostic[]; modules: BoundaryGraphModule[]; serverActions: BoundaryGraphServerActionSite[]; trace: BoundaryGraphTraceEvent[]; } /** Analyzes route modules and static imports to classify server, client, shared, and action boundaries. */ export declare function analyzeBoundaryGraph(input: BoundaryGraphInput): Promise; //# sourceMappingURL=boundary-graph.d.ts.map