import { AnnotationSide, BaseDiffOptions, DiffLineAnnotation, ExpansionDirections, FileContents, FileDiffMetadata, HunkData, HunkSeparators, PrePropertiesConfig, RenderHeaderMetadataCallback, RenderHeaderPrefixCallback, RenderRange, ThemeTypes } from "../types.js";
import { WorkerPoolManager } from "../worker/WorkerPoolManager.js";
import "../worker/index.js";
import { GetLineIndexUtility, LineSelectionManager, LineSelectionOptions, SelectedLineRange } from "../managers/LineSelectionManager.js";
import { GetHoveredLineResult, MouseEventManager, MouseEventManagerBaseOptions } from "../managers/MouseEventManager.js";
import { ResizeManager } from "../managers/ResizeManager.js";
import { ScrollSyncManager } from "../managers/ScrollSyncManager.js";
import { DiffHunksRenderer } from "../renderers/DiffHunksRenderer.js";
import "../index.js";

//#region src/components/FileDiff.d.ts
interface FileDiffRenderProps<LAnnotation> {
  fileDiff?: FileDiffMetadata;
  oldFile?: FileContents;
  newFile?: FileContents;
  forceRender?: boolean;
  fileContainer?: HTMLElement;
  containerWrapper?: HTMLElement;
  lineAnnotations?: DiffLineAnnotation<LAnnotation>[];
  renderRange?: RenderRange;
}
interface FileDiffHydrationProps<LAnnotation> extends Omit<FileDiffRenderProps<LAnnotation>, 'fileContainer'> {
  fileContainer: HTMLElement;
  prerenderedHTML?: string;
}
interface FileDiffOptions<LAnnotation> extends Omit<BaseDiffOptions, 'hunkSeparators'>, MouseEventManagerBaseOptions<'diff'>, LineSelectionOptions {
  hunkSeparators?: Exclude<HunkSeparators, 'custom'> /**
                                                     * @deprecated Custom hunk separator functions are deprecated and will be
                                                     * removed in a future version.
                                                     */ | ((hunk: HunkData, instance: FileDiff<LAnnotation>) => HTMLElement | DocumentFragment);
  disableFileHeader?: boolean;
  /**
   * @deprecated Use `enableGutterUtility` instead.
   */
  enableHoverUtility?: boolean;
  renderHeaderPrefix?: RenderHeaderPrefixCallback;
  renderHeaderMetadata?: RenderHeaderMetadataCallback;
  /**
   * When true, errors during rendering are rethrown instead of being caught
   * and displayed in the DOM. Useful for testing or when you want to handle
   * errors yourself.
   */
  disableErrorHandling?: boolean;
  renderAnnotation?(annotation: DiffLineAnnotation<LAnnotation>): HTMLElement | undefined;
  renderGutterUtility?(getHoveredRow: () => GetHoveredLineResult<'diff'> | undefined): HTMLElement | null;
  /**
   * @deprecated Use `renderGutterUtility` instead.
   */
  renderHoverUtility?(getHoveredRow: () => GetHoveredLineResult<'diff'> | undefined): HTMLElement | null;
}
interface AnnotationElementCache<LAnnotation> {
  element: HTMLElement;
  annotation: DiffLineAnnotation<LAnnotation>;
}
interface CustomHunkElementCache {
  element: HTMLElement;
  hunkData: HunkData;
}
declare class FileDiff<LAnnotation = undefined> {
  options: FileDiffOptions<LAnnotation>;
  protected workerManager?: WorkerPoolManager | undefined;
  protected isContainerManaged: boolean;
  static LoadedCustomComponent: boolean;
  readonly __id: string;
  protected fileContainer: HTMLElement | undefined;
  protected spriteSVG: SVGElement | undefined;
  protected pre: HTMLPreElement | undefined;
  protected codeUnified: HTMLElement | undefined;
  protected codeDeletions: HTMLElement | undefined;
  protected codeAdditions: HTMLElement | undefined;
  protected bufferBefore: HTMLElement | undefined;
  protected bufferAfter: HTMLElement | undefined;
  protected unsafeCSSStyle: HTMLStyleElement | undefined;
  protected gutterUtilityContent: HTMLElement | undefined;
  protected headerElement: HTMLElement | undefined;
  protected headerPrefix: HTMLElement | undefined;
  protected headerMetadata: HTMLElement | undefined;
  protected separatorCache: Map<string, CustomHunkElementCache>;
  protected errorWrapper: HTMLElement | undefined;
  protected placeHolder: HTMLElement | undefined;
  protected hunksRenderer: DiffHunksRenderer<LAnnotation>;
  protected resizeManager: ResizeManager;
  protected scrollSyncManager: ScrollSyncManager;
  protected mouseEventManager: MouseEventManager<'diff'>;
  protected lineSelectionManager: LineSelectionManager;
  protected annotationCache: Map<string, AnnotationElementCache<LAnnotation>>;
  protected lineAnnotations: DiffLineAnnotation<LAnnotation>[];
  protected deletionFile: FileContents | undefined;
  protected additionFile: FileContents | undefined;
  protected fileDiff: FileDiffMetadata | undefined;
  protected renderRange: RenderRange | undefined;
  protected appliedPreAttributes: PrePropertiesConfig | undefined;
  protected lastRenderedHeaderHTML: string | undefined;
  protected lastRowCount: number | undefined;
  protected enabled: boolean;
  constructor(options?: FileDiffOptions<LAnnotation>, workerManager?: WorkerPoolManager | undefined, isContainerManaged?: boolean);
  private handleHighlightRender;
  getLineIndex: GetLineIndexUtility;
  setOptions(options: FileDiffOptions<LAnnotation> | undefined): void;
  private mergeOptions;
  setThemeType(themeType: ThemeTypes): void;
  getHoveredLine: () => {
    lineNumber: number;
    side: AnnotationSide;
  } | undefined;
  setLineAnnotations(lineAnnotations: DiffLineAnnotation<LAnnotation>[]): void;
  private canPartiallyRender;
  setSelectedLines(range: SelectedLineRange | null): void;
  cleanUp(recycle?: boolean): void;
  virtualizedSetup(): void;
  hydrate(props: FileDiffHydrationProps<LAnnotation>): void;
  rerender(): void;
  handleExpandHunk: (hunkIndex: number, direction: ExpansionDirections) => void;
  expandHunk(hunkIndex: number, direction: ExpansionDirections): void;
  render({
    oldFile,
    newFile,
    fileDiff,
    forceRender,
    lineAnnotations,
    fileContainer,
    containerWrapper,
    renderRange
  }: FileDiffRenderProps<LAnnotation>): boolean;
  private removeRenderedCode;
  private clearAuxiliaryNodes;
  renderPlaceholder(height: number): boolean;
  private cleanChildNodes;
  private renderSeparators;
  private renderAnnotations;
  private renderGutterUtility;
  protected getOrCreateFileContainer(fileContainer?: HTMLElement, parentNode?: HTMLElement): HTMLElement;
  protected getFileContainer(): HTMLElement | undefined;
  private getOrCreatePreNode;
  private syncCodeNodesFromPre;
  private applyHeaderToDOM;
  private injectUnsafeCSS;
  private applyHunksToDOM;
  private applyPartialRender;
  private insertPartialHTML;
  private renderPartialColumn;
  private mergeBuffersIfNecessary;
  private applyRowSpan;
  private trimColumnRows;
  private trimColumns;
  private getBufferSize;
  private updateBufferSize;
  private getCodeColumns;
  private applyBuffers;
  private applyPreNodeAttributes;
  private applyErrorToDOM;
  private cleanupErrorWrapper;
}
//#endregion
export { FileDiff, FileDiffHydrationProps, FileDiffOptions, FileDiffRenderProps };
//# sourceMappingURL=FileDiff.d.ts.map