import type { PDFPageProxy, StructTreeContent } from '../pdf.js/src/display/api';
import type { BaseCanvasFactory } from '../pdf.js/src/display/canvas_factory';
import type { PageViewport } from '../pdf.js/src/display/display_utils';
import { type AnnotationData } from './AnnotationData';
import type { StructTreeNodeWithAttrs } from './StructTreePage';
import { type SvgRoot } from './Svg';
export interface TextLayerNode {
    id?: string;
    role: string;
    attrs?: Record<string, unknown>;
}
export interface TextLayerElement extends TextLayerNode {
    children: (string | TextLayerNode)[];
}
export interface TextLayerRoot extends TextLayerElement {
    width: number;
    height: number;
}
export interface TextLayerAnchor extends TextLayerElement {
    role: 'a';
    href: string;
}
export interface TextLayerChunk {
    text: string;
    width: number;
    margin: number;
    scale?: number;
}
export interface TextLayerText extends TextLayerNode {
    role: 'text';
    text: /* v1 */ string | /* v2 */ TextLayerChunk[];
    top: number;
    left: number;
    fontSize: number;
    fontWeight: number;
    fontStyle: string;
    fontFamily: string;
    fontFallback: string;
    dir: string;
    hyphen?: boolean;
    scale?: number;
    angle?: number;
}
export interface TextLayerFigure extends TextLayerNode {
    role: 'figure';
    href: string;
    x: number;
    y: number;
    width: number;
    height: number;
    alt?: string;
}
export declare function isTextNode(node: TextLayerNode): node is TextLayerText;
export declare function isAnchorNode(node: TextLayerNode): node is TextLayerAnchor;
export declare function isFigureNode(node: TextLayerNode): node is TextLayerFigure;
export declare function isElementNode(node: TextLayerNode): node is TextLayerElement;
export declare const TEXT_LAYER_FONT_FAMILY = "Liberation Sans";
export interface Glyph {
    unicode: string;
    isSpace: boolean;
}
export declare const fontLoader: (bold?: boolean, italic?: boolean) => Promise<Uint8Array<ArrayBuffer>>;
export declare function loadTextLayerFonts(document?: Document): Promise<void>;
/**
 * @deprecated Use `loadTextLayerFonts` instead.
 */
export declare const loadDefaultFonts: typeof loadTextLayerFonts;
export declare const normalizeMarkedContentId: (idRef: unknown) => string | null;
export declare const getNodeContents: (node: TextLayerNode) => string;
export declare const findNode: (root: TextLayerElement, callback: (node: TextLayerNode, parent: TextLayerElement) => boolean | null | undefined) => TextLayerNode | null;
export declare const findNodes: (node: TextLayerElement, callback: (node: TextLayerNode, parent: TextLayerElement) => boolean | null | undefined) => TextLayerNode[];
export declare const flattenNodes: (node: TextLayerNode | string) => TextLayerNode[];
export declare const renderTextLayer: (root: TextLayerRoot, options?: {
    classes?: boolean;
    styles?: boolean;
}) => string;
export declare const decorateStructTree: (node: StructTreeNodeWithAttrs | StructTreeContent, rootContainer: TextLayerRoot, graphics?: SvgRoot, annotations?: AnnotationData[], parents?: TextLayerElement[]) => void;
export declare function createTextLayer(page: PDFPageProxy, { canvasFactory, viewport, outputScale, annotations, graphics, }: {
    canvasFactory: BaseCanvasFactory;
    viewport?: PageViewport;
    outputScale?: number;
    annotations?: AnnotationData[];
    graphics?: SvgRoot;
}): Promise<TextLayerRoot>;
