import type { Font } from '../pdf.js/src/core/fonts';
import type { PDFPageProxy, StructTreeContent } from '../pdf.js/src/display/api';
import { type AnnotationData } from './AnnotationData';
import type { StructTreeNodeWithAttrs } from './StructTreePage';
import { type SvgRoot } from './Svg';
export interface TextLayerNode {
    id?: string;
    role: string;
    attrs?: {
        dir?: string;
        [key: string]: unknown;
    };
}
export interface TextLayerElement extends TextLayerNode {
    children: 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;
}
export interface TextLayerText extends TextLayerNode {
    role: 'text';
    text: TextLayerChunk[];
    top: number;
    left: number;
    fontSize: number;
    fontWeight: number;
    fontStyle: string;
    fontFamily: string;
    fontFallback: string;
    scale?: number;
    angle?: number;
}
export interface TextLayerFigure extends TextLayerNode {
    role: 'figure';
    href: string;
    x: number;
    y: number;
    width: number;
    height: number;
    alt?: string;
}
export interface Glyph {
    unicode: string;
    isSpace: boolean;
}
export type TextItem = {
    glyphs: [Glyph, number, number][];
    font: Font;
    fontSize: number;
    top: number;
    left: number;
    angle: number;
    scaleX: number;
};
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 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) => TextLayerNode[];
export declare const renderTextLayer: (root: TextLayerRoot, options?: {
    classes?: boolean;
    styles?: boolean;
    font?: string;
}) => string;
export declare const decorateStructTree: (node: StructTreeNodeWithAttrs | StructTreeContent, rootContainer: TextLayerRoot, graphics?: SvgRoot, annotations?: AnnotationData[], parents?: TextLayerElement[]) => void;
export declare const measure: (text: string, font: string, fontSize: number, lang?: string) => TextMetrics;
export declare function createTextLayer(page: PDFPageProxy, { graphics, annotations: _annotations, }?: {
    graphics?: SvgRoot;
    annotations?: AnnotationData[];
}): Promise<TextLayerRoot>;
