import { BaseCodeOptions, FileContents, LineAnnotation, PrePropertiesConfig, RenderFileMetadata, RenderRange, ThemeTypes } from "../types.js";
import { WorkerPoolManager } from "../worker/WorkerPoolManager.js";
import "../worker/index.js";
import { LineSelectionManager, LineSelectionOptions, SelectedLineRange } from "../managers/LineSelectionManager.js";
import { GetHoveredLineResult, MouseEventManager, MouseEventManagerBaseOptions } from "../managers/MouseEventManager.js";
import { ResizeManager } from "../managers/ResizeManager.js";
import { FileRenderer } from "../renderers/FileRenderer.js";

//#region src/components/File.d.ts
interface FileRenderProps<LAnnotation> {
  file: FileContents;
  fileContainer?: HTMLElement;
  containerWrapper?: HTMLElement;
  forceRender?: boolean;
  lineAnnotations?: LineAnnotation<LAnnotation>[];
  renderRange?: RenderRange;
}
interface FileHyrdateProps<LAnnotation> extends Omit<FileRenderProps<LAnnotation>, 'fileContainer'> {
  fileContainer: HTMLElement;
  prerenderedHTML?: string;
}
interface FileOptions<LAnnotation> extends BaseCodeOptions, MouseEventManagerBaseOptions<'file'>, LineSelectionOptions {
  disableFileHeader?: boolean;
  renderCustomMetadata?: RenderFileMetadata;
  /**
   * 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: LineAnnotation<LAnnotation>): HTMLElement | undefined;
  renderHoverUtility?(getHoveredRow: () => GetHoveredLineResult<'file'> | undefined): HTMLElement | null;
}
interface AnnotationElementCache<LAnnotation> {
  element: HTMLElement;
  annotation: LineAnnotation<LAnnotation>;
}
declare class File<LAnnotation = undefined> {
  options: FileOptions<LAnnotation>;
  private workerManager?;
  private isContainerManaged;
  static LoadedCustomComponent: boolean;
  readonly __id: string;
  protected fileContainer: HTMLElement | undefined;
  protected spriteSVG: SVGElement | undefined;
  protected pre: HTMLPreElement | undefined;
  protected code: HTMLElement | undefined;
  protected bufferBefore: HTMLElement | undefined;
  protected bufferAfter: HTMLElement | undefined;
  protected unsafeCSSStyle: HTMLStyleElement | undefined;
  protected hoverContent: HTMLElement | undefined;
  protected errorWrapper: HTMLElement | undefined;
  protected placeHolder: HTMLElement | undefined;
  protected lastRenderedHeaderHTML: string | undefined;
  protected appliedPreAttributes: PrePropertiesConfig | undefined;
  protected lastRowCount: number | undefined;
  protected headerElement: HTMLElement | undefined;
  protected headerMetadata: HTMLElement | undefined;
  protected fileRenderer: FileRenderer<LAnnotation>;
  protected resizeManager: ResizeManager;
  protected mouseEventManager: MouseEventManager<'file'>;
  protected lineSelectionManager: LineSelectionManager;
  protected annotationCache: Map<string, AnnotationElementCache<LAnnotation>>;
  protected lineAnnotations: LineAnnotation<LAnnotation>[];
  protected file: FileContents | undefined;
  protected renderRange: RenderRange | undefined;
  constructor(options?: FileOptions<LAnnotation>, workerManager?: WorkerPoolManager | undefined, isContainerManaged?: boolean);
  private handleHighlightRender;
  rerender(): void;
  setOptions(options: FileOptions<LAnnotation> | undefined): void;
  private mergeOptions;
  setThemeType(themeType: ThemeTypes): void;
  getHoveredLine: () => {
    lineNumber: number;
  } | undefined;
  setLineAnnotations(lineAnnotations: LineAnnotation<LAnnotation>[]): void;
  setSelectedLines(range: SelectedLineRange | null): void;
  cleanUp(): void;
  hydrate(props: FileHyrdateProps<LAnnotation>): void;
  getOrCreateLineCache(file?: FileContents | undefined): string[];
  render({
    file,
    fileContainer,
    forceRender,
    containerWrapper,
    lineAnnotations,
    renderRange
  }: FileRenderProps<LAnnotation>): boolean;
  private canPartiallyRender;
  renderPlaceholder(height: number): boolean;
  private cleanChildNodes;
  private renderAnnotations;
  private renderHoverUtility;
  private injectUnsafeCSS;
  private applyFullRender;
  private applyPartialRender;
  private getColumns;
  private trimDOMToOverlap;
  private getDOMBoundaryIndices;
  private getLineIndexFromDOMNode;
  private applyBuffers;
  private applyHeaderToDOM;
  protected getOrCreateFileContainerNode(fileContainer?: HTMLElement, parentNode?: HTMLElement): HTMLElement;
  private getOrCreatePreNode;
  private applyPreNodeAttributes;
  private applyErrorToDOM;
  private cleanupErrorWrapper;
}
//#endregion
export { File, FileHyrdateProps, FileOptions, FileRenderProps };
//# sourceMappingURL=File.d.ts.map