import { TextStyle } from './TextStyle'; interface IFontMetrics { ascent: number; descent: number; fontSize: number; } export declare class TextMetrics { text: string; style: TextStyle; width: number; height: number; lines: string[]; lineWidths: number[]; lineHeight: number; maxLineWidth: number; fontProperties: IFontMetrics; static METRICS_STRING: string; static BASELINE_SYMBOL: string; static BASELINE_MULTIPLIER: number; static _canvas: HTMLCanvasElement | OffscreenCanvas; static _context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D; static _fonts: { [font: string]: IFontMetrics; }; static _newlines: number[]; static _breakingSpaces: number[]; constructor(text: string, style: TextStyle, width: number, height: number, lines: string[], lineWidths: number[], lineHeight: number, maxLineWidth: number, fontProperties: IFontMetrics); static measureText(text: string, style: TextStyle, wordWrap?: boolean, canvas?: HTMLCanvasElement | OffscreenCanvas): TextMetrics; private static wordWrap; private static addLine; private static getFromCache; private static collapseSpaces; private static collapseNewlines; private static trimRight; private static isNewline; static isBreakingSpace(char: string, _nextChar?: string): boolean; private static tokenize; static canBreakWords(_token: string, breakWords: boolean): boolean; static canBreakChars(_char: string, _nextChar: string, _token: string, _index: number, _breakWords: boolean): boolean; static wordWrapSplit(token: string): string[]; static measureFont(font: string): IFontMetrics; /** * Clear font metrics in metrics cache. * * @static * @param {string} [font] - font name. If font name not set then clear cache for all fonts. */ static clearMetrics(font?: string): void; } export {};