import { FontMetrics } from './font-metrics'; import { Paragraph } from './paragraph'; export type LineMetrics = Pick; export type AddLineOptions = { seq: number; text: string; width: number; hasEllipsis: boolean; lineMetrics: LineMetrics; }; type AddLineFunction = (options: AddLineOptions) => void; export declare class TextWrapper { private readonly paragraph; constructor(paragraph: Paragraph); /** * 当前行序号 */ private seq; /** * 当前行 text */ private text; /** * 当前行 width */ private width; /** * 最大行数 */ private maxLines; breakTextIntoLines(tokens: string[], maxWidth: number, callback: AddLineFunction): void; breakWord(text: string, font: string, breakWidth: number, atLeast?: 0 | 1): number; private measureWidthCache; private measureWidth; get isLastLine(): boolean; getLineMaxWidth(maxWidth: number): number; /** * 结束当前行 */ private endLine; /** * 当前行是否可以 commit */ get canCommit(): boolean; get textOverflow(): string; private _textOverflowWidth; get textOverflowWidth(): number; } export {};