import { AppliedThemeStyleCache, BaseCodeOptions, FileContents, LineAnnotation, PrePropertiesConfig, RenderFileMetadata, RenderRange, ThemeTypes } from "../types.js";
import { WorkerPoolManager } from "../worker/WorkerPoolManager.js";
import "../worker/index.js";
import { GetHoveredLineResult, InteractionManager, InteractionManagerBaseOptions, SelectedLineRange } from "../managers/InteractionManager.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;
  preventEmit?: boolean;
  lineAnnotations?: LineAnnotation<LAnnotation>[];
  renderRange?: RenderRange;
}
interface FileHydrateProps<LAnnotation> extends Omit<FileRenderProps<LAnnotation>, 'fileContainer'> {
  fileContainer: HTMLElement;
  prerenderedHTML?: string;
}
interface FileOptions<LAnnotation> extends BaseCodeOptions, InteractionManagerBaseOptions<'file'> {
  disableFileHeader?: boolean;
  /**
   * @deprecated Use `enableGutterUtility` instead.
   */
  enableHoverUtility?: boolean;
  renderHeaderPrefix?: RenderFileMetadata;
  renderCustomMetadata?: RenderFileMetadata;
  renderCustomHeader?: 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;
  renderGutterUtility?(getHoveredRow: () => GetHoveredLineResult<'file'> | undefined): HTMLElement | null | undefined;
  /**
   * @deprecated Use `renderGutterUtility` instead.
   */
  renderHoverUtility?(getHoveredRow: () => GetHoveredLineResult<'file'> | undefined): HTMLElement | null | undefined;
  onPostRender?(node: HTMLElement, instance: File<LAnnotation>): unknown;
}
interface AnnotationElementCache<LAnnotation> {
  element: HTMLElement;
  annotation: LineAnnotation<LAnnotation>;
}
interface HydrationSetup<LAnnotation> {
  file: FileContents;
  lineAnnotations: LineAnnotation<LAnnotation>[] | undefined;
}
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 themeCSSStyle: HTMLStyleElement | undefined;
  protected appliedThemeCSS: AppliedThemeStyleCache | undefined;
  protected unsafeCSSStyle: HTMLStyleElement | undefined;
  protected appliedUnsafeCSS: string | undefined;
  protected gutterUtilityContent: 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 headerCustom: HTMLElement | undefined;
  protected headerPrefix: HTMLElement | undefined;
  protected headerMetadata: HTMLElement | undefined;
  protected fileRenderer: FileRenderer<LAnnotation>;
  protected resizeManager: ResizeManager;
  protected interactionManager: InteractionManager<'file'>;
  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: FileHydrateProps<LAnnotation>): void;
  protected hydrateElements(fileContainer: HTMLElement, prerenderedHTML: string | undefined): void;
  protected hydrationSetup({
    file,
    lineAnnotations
  }: HydrationSetup<LAnnotation>): void;
  getOrCreateLineCache(file?: FileContents | undefined): string[];
  render({
    file,
    fileContainer,
    forceRender,
    preventEmit,
    containerWrapper,
    lineAnnotations,
    renderRange
  }: FileRenderProps<LAnnotation>): boolean;
  private emitPostRender;
  private removeRenderedCode;
  private clearAuxiliaryNodes;
  private canPartiallyRender;
  renderPlaceholder(height: number): boolean;
  private cleanChildNodes;
  private renderAnnotations;
  private renderGutterUtility;
  private injectUnsafeCSS;
  private applyThemeState;
  private applyFullRender;
  private applyPartialRender;
  private getColumns;
  private trimDOMToOverlap;
  private getDOMBoundaryIndices;
  private getLineIndexFromDOMNode;
  private applyBuffers;
  private applyHeaderToDOM;
  private clearHeaderSlots;
  private upsertHeaderSlotElement;
  private replaceHeaderSlotContent;
  private createHeaderSlotElement;
  protected getOrCreateFileContainerNode(fileContainer?: HTMLElement, parentNode?: HTMLElement): HTMLElement;
  private getOrCreatePreNode;
  private syncCodeNodeFromPre;
  private applyPreNodeAttributes;
  private applyErrorToDOM;
  private cleanupErrorWrapper;
}
//#endregion
export { File, FileHydrateProps, FileOptions, FileRenderProps };
//# sourceMappingURL=File.d.ts.map