import { z } from "zod";
import type { BlockMdxConfig } from "../types.js";
/**
* Pure (React-free) part of the PLAN-SPECIFIC diff block: its data schema and MDX
* round-trip config. Shared by the server MDX adapter (`plan-mdx.ts` via
* `plan-block-registry.ts`) and the client spec (`planBlocks.tsx`). Keeping this
* React-free means importing it into a server module never pulls React (or the
* `diff` line-differ used only by the renderer) into the Nitro/SSR bundle.
*
* The schema MUST stay data-compatible with the `diff` branch of `planBlockSchema`
* (`plan-content.ts`), and the MDX `tag` + flat attribute shape MUST match the
* `` self-closing encoding so stored
* `.mdx` round-trips. The `before`/`after` source lives in ATTRIBUTES (not MDX
* children) — the shared `prop()` encoder round-trips multiline strings cleanly,
* and keeping them attributes avoids the code being reflowed as prose.
*/
/** Rendering layout for the diff body. */
export type DiffMode = "unified" | "split";
/**
* One line-anchored note attached to a diff, mirroring the `annotated-code`
* annotation shape but adding `side`. The `lines` ref is 1-based against the
* chosen side's source: `side: "after"` (the default) targets the new file's
* line numbers, `side: "before"` the old file's. Optional ⇒ a diff without
* annotations renders exactly as before.
*/
export interface DiffAnnotation {
/** Which side the line ref targets; defaults to "after". */
side?: "before" | "after";
/** 1-based line ref against that side's text: "13" or "13-15" (inclusive). */
lines: string;
/** Optional short label shown before the note (e.g. "Validation"). */
label?: string;
/** The note prose (markdown), rendered through `ctx.renderMarkdown`. */
note: string;
}
export interface DiffData {
/** Optional file path shown in the header (e.g. `src/add.ts`). */
filename?: string;
/** Optional language label rendered as a chip (e.g. `ts`). Purely cosmetic. */
language?: string;
/** Original ("before") source. */
before: string;
/** New ("after") source. */
after: string;
/** Layout: split (default, side-by-side) or unified (one column). */
mode?: DiffMode;
/** Line-anchored notes over the before/after sides. */
annotations?: DiffAnnotation[];
}
export declare const diffSchema: z.ZodType;
/**
* MDX config: `filename`, `language`, `mode`, `before`, `after`, and
* `annotations` are flat attributes — the
* `` self-closing
* form. Insertion order of `toAttrs` is the on-disk attribute order. `before`/
* `after` are multiline string attributes (round-trip through the shared `prop()`
* encoder); `annotations` is a JSON array attribute, encoded the same way as the
* `annotated-code` block. `fromAttrs` mirrors a forgiving parse (`before ?? ""`,
* `after ?? ""`, optional `filename`/`language`/`mode`/`annotations` undefined
* when absent) so a plan missing an attribute still parses without re-emitting
* unauthored empty arrays.
*/
export declare const diffMdx: BlockMdxConfig;
//# sourceMappingURL=diff.config.d.ts.map