import type { TextSegment } from 'ag-charts-types';
import { type FontOptions, type ITextMeasurer, type LegacyTextMetrics, type MultilineSegmentsMetricsBox, type MultilineTextMetricsBox, type TextMetricsBox } from '../types/text';
export declare class TextMeasurer implements ITextMeasurer {
    private readonly ctx;
    private readonly measureTextCached?;
    private readonly baselineMap;
    private readonly charMap;
    private lineHeightCache;
    constructor(ctx: CanvasRenderingContext2D, measureTextCached?: ((text: string, useCache?: boolean) => LegacyTextMetrics) | undefined);
    baselineDistance(textBaseline: CanvasTextBaseline): number;
    lineHeight(): number;
    measureText(text: string): TextMetricsBox;
    measureLines(text: string | string[]): MultilineTextMetricsBox;
    textWidth(text: string, estimate?: boolean): number;
    private charWidth;
}
export declare function cachedTextMeasurer(font: string | FontOptions): TextMeasurer;
export declare namespace cachedTextMeasurer {
    var clear: () => void;
}
export declare function measureTextSegments(textSegments: TextSegment[], defaultFont: FontOptions): MultilineSegmentsMetricsBox;
export type { ITextMeasurer, LineMetricsBox, MeasuredSegment, MultilineSegmentsMetricsBox, MultilineTextMetricsBox, SegmentsLineMetrics, TextMetricsBox, } from '../types/text';
