/// import type { ParsedTextStyleProps } from '../display-objects'; import { Rectangle } from '../shapes'; export interface TextMetrics { font: string; width: number; height: number; lines: string[]; lineWidths: number[]; lineHeight: number; maxLineWidth: number; fontProperties: IFontMetrics; lineMetrics: Rectangle[]; } interface IFontMetrics { ascent: number; descent: number; fontSize: number; } export declare class TextService { private cache; private offscreenCanvas; measureFont(font: string, offscreenCanvas: HTMLCanvasElement | OffscreenCanvas): IFontMetrics; measureText(text: string, parsedStyle: ParsedTextStyleProps, offscreenCanvas: HTMLCanvasElement | OffscreenCanvas): TextMetrics; private wordWrap; private isBreakingSpace; private isNewline; private trimToBreakable; private shouldBreakByKinsokuShorui; private trimByKinsokuShorui; private canBreakInLastChar; private sumTextWidthByCache; private findBreakableIndex; private getFromCache; } export {};