import { type ThemeId } from '@ottocode/themes'; import type { ThemeTypes } from '@pierre/diffs'; import type { CSSProperties } from 'react'; /** * Hunk separator treatments we allow. * * `line-info`/`line-info-basic` are deliberately excluded: they render a large * rounded "N unmodified lines" expansion control that does not belong in Otto's * UI, and they are the only variants that mark the code element with * `data-container-size` (`container-type: inline-size`), which collapses the * diff grid inside narrow inline flex containers. */ type OttoHunkSeparators = 'metadata' | 'simple'; /** Options accepted by every `@pierre/diffs` React surface we render. */ export interface PierreDiffOptions { theme: { dark: string; light: string; }; themeType: ThemeTypes; diffStyle: 'unified' | 'split'; diffIndicators: 'bars' | 'classic' | 'none'; disableBackground: boolean; disableLineNumbers: boolean; disableFileHeader: boolean; overflow: 'scroll' | 'wrap'; lineDiffType: 'word-alt'; hunkSeparators: OttoHunkSeparators; /** Expansion controls are never offered; the payloads are partial diffs. */ expandUnchanged: false; tokenizeMaxLineLength: number; unsafeCSS: string; } /** * `full` is the Git/session pane: standard `@@` patch metadata separators, * matching the hunk headers Otto's previous viewer displayed. * `inline` is a chat/tool card: the most minimal built-in separator, with no * unmodified-line banner or expand affordance. */ export type PierreDiffVariant = 'full' | 'inline'; /** * Preserve Otto's quiet emerald/red line and word fills. The official Pierre * treatment keeps the number gutter neutral and draws a 4px solid/striped * change rail at its leading edge; declare it here as well so Otto's final CSS * layer cannot lose it to theme or hydration ordering. */ export declare const OTTO_DIFF_COLORS_CSS = "\n[data-background] [data-line][data-line-type=\"change-addition\"] {\n\t--diffs-computed-diff-line-bg: rgb(16 185 129 / 0.12);\n}\n[data-background] [data-line][data-line-type=\"change-deletion\"] {\n\t--diffs-computed-diff-line-bg: rgb(239 68 68 / 0.11);\n}\n[data-background][data-indicators=\"bars\"] [data-column-number][data-line-type=\"change-addition\"]::before,\n[data-background][data-indicators=\"bars\"] [data-column-number][data-line-type=\"change-deletion\"]::before {\n content: \"\";\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n width: 4px;\n}\n[data-background][data-indicators=\"bars\"] [data-column-number][data-line-type=\"change-addition\"]::before {\n background-color: rgb(16 185 129);\n}\n[data-background][data-indicators=\"bars\"] [data-column-number][data-line-type=\"change-deletion\"]::before {\n background-color: rgb(239 68 68 / 0.2);\n background-image: linear-gradient(0deg, transparent 50%, rgb(239 68 68) 50%);\n background-repeat: repeat;\n background-size: 2px 2px;\n}\n[data-line-type=\"change-addition\"] [data-diff-span] {\n\tbackground-color: rgb(16 185 129 / 0.18);\n}\n[data-line-type=\"change-deletion\"] [data-diff-span] {\n\tbackground-color: rgb(239 68 68 / 0.16);\n}\n"; /** * Keeps minified/generated single-line files from stalling the surface. * Exported because the worker pool owns this option once mounted and must be * initialised with the same value the components would otherwise use. */ export declare const DIFF_TOKENIZE_MAX_LINE_LENGTH = 1000; /** Inline word-level highlighting; also worker-managed once a pool exists. */ export declare const DIFF_LINE_DIFF_TYPE: "word-alt"; export interface PierreDiffSurface { options: PierreDiffOptions; style: CSSProperties; /** Changes whenever the palette changes, for remount/cache-key purposes. */ themeId: ThemeId; } export interface PierreDiffSurfaceInput { variant?: PierreDiffVariant; /** * Hide Pierre's own file header when the surrounding panel already renders * the filename and status chrome. */ hideFileHeader?: boolean; /** Extra inherited CSS custom properties or layout styles. */ style?: CSSProperties; } export declare function createPierreDiffSurface(themeId: ThemeId, input?: PierreDiffSurfaceInput): PierreDiffSurface; /** * Resolves the shared Pierre options/styles for the currently active Otto * theme. Re-renders (and therefore recolors) whenever the theme changes. */ export declare function usePierreDiffSurface(input?: PierreDiffSurfaceInput): PierreDiffSurface; export {}; //# sourceMappingURL=diffOptions.d.ts.map