import type { FileDiffMetadata } from '@pierre/diffs'; import { Component, type ReactNode } from 'react'; import { type PierreDiffSurfaceInput } from './diffOptions'; interface DiffBoundaryProps { /** * Compact identity of the rendered content; a change clears a previous * failure. Never the raw patch text — that would retain large strings and * make React keys enormous. */ contentKey: string; fallback: ReactNode; children: ReactNode; } /** * Pierre renders into a shadow DOM subtree and throws on patches it cannot * resolve to a singular file diff. An unexpected failure must degrade to the * caller's fallback instead of tearing down the surrounding panel or thread. */ export declare class PierreDiffBoundary extends Component { state: { failedKey: string | null; }; static getDerivedStateFromProps(props: DiffBoundaryProps, state: { failedKey: string | null; }): { failedKey: any; }; componentDidCatch(): void; render(): ReactNode; } export interface PierreFileContents { name: string; contents: string; /** Stable identity for the worker AST cache. */ cacheKey?: string; } interface PierreFileDiffProps extends PierreDiffSurfaceInput { /** Already-parsed metadata; avoids reparsing the patch string. */ fileDiff: FileDiffMetadata; fallback: ReactNode; className?: string; } /** * Renders one already-parsed file diff. Preferred over {@link PierrePatchDiff} * because the payload is parsed once during normalization and the metadata * carries a stable `cacheKey`. */ export declare function PierreFileDiff({ fileDiff, fallback, className, variant, hideFileHeader, style, }: PierreFileDiffProps): import("react/jsx-runtime").JSX.Element; interface PierrePatchDiffProps extends PierreDiffSurfaceInput { /** A single well-formed unified patch describing exactly one file. */ patch: string; fallback: ReactNode; className?: string; } /** * Renders one unified patch through Pierre's purpose-built patch surface. * Prefer {@link PierreFileDiff} when the caller already has parsed metadata. */ export declare function PierrePatchDiff({ patch, fallback, className, variant, hideFileHeader, style, }: PierrePatchDiffProps): import("react/jsx-runtime").JSX.Element; interface PierreFileComparisonProps extends PierreDiffSurfaceInput { /** * `null` represents a missing old side (a newly created file). An existing * but empty file must be passed as `{ name, contents: '' }`. */ oldFile: PierreFileContents | null; newFile: PierreFileContents; fallback: ReactNode; className?: string; } /** * Compares two file versions directly, which gives correct language detection * from the filename and a true "added file" rendering when `oldFile` is null. */ export declare function PierreFileComparison({ oldFile, newFile, fallback, className, variant, hideFileHeader, style, }: PierreFileComparisonProps): import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=PierreDiff.d.ts.map