/** * Properties describing how a piece of text is formatted. * @internal */ export type Font = { fontStyle?: string; fontWeight?: string; fontSize: string; fontFamily: string; }; /** * The Unicode character representing an ellipsis. * @internal */ export declare const ELLIPSIS_CHARACTER = "\u2026"; /** * Max iterations for finding the perfect truncated text for a given width * @internal */ export declare const ELLIPSIS_APPROXIMATION_THRESHOLD = 15; /** * Calculates the width of formatted text in pixels. * * @param text - The text to calculate the width of * @param textFont - The font settings for the text * @internal */ export declare function getTextWidth(text: string, textFont: Font): number; /** * Calculates the height of formatted text in pixels. * @param text - The text to calculate the height of * @param textFont - The font settings for the text * @internal */ export declare function getTextHeight(text: string, textFont: Font): number; /** * Cuts off text that exceeds the maximum width in the center and * concatenates both shortened ends of the text with an ellipsis. * * @param originalText - The text to be truncated if its width exceeds maxWidthInPx * @param textFont - Different font settings to be considered when determining the width of the text * @param maxWidthInPx - If the text's width exceeds this value, the text will be truncated to a string whose width is guaranteed to be below it * @internal */ export declare function centerEllipsizeText(originalText: string, textFont: Font, maxWidthInPx: number): string; /** * Returns an object containing the width of a given formatted text and the * width of an ellipsis character with the same text format or `null` * if the text width does not exceed its maximum available width. * @internal */ export declare function calculateEllipsisInfo(originalText: string, textFont: Font, maxWidthInPx: number): { ellipsisWidth: number; avgLetterWidth: number; } | null;