import type { ChartsTextAnchor, ChartsTextBaseline } from "./getWordsByLines.mjs"; interface EllipsizeConfig { width: number; height: number; /** Angle, in degrees, in which the text should be displayed */ angle: number; measureText: (text: string) => { width: number; height: number; }; } export declare function doesTextFitInRect(text: string, config: EllipsizeConfig): boolean; export interface RotatedTextBoundsConfig { /** Angle, in degrees, in which the text is displayed. */ angle: number; textAnchor?: ChartsTextAnchor; dominantBaseline?: ChartsTextBaseline; isRtl?: boolean; } export interface RotatedTextBounds { /** Width of the text bounding box once rotated. */ width: number; /** How far the text extends above its anchor point. */ above: number; /** How far the text extends below its anchor point. */ below: number; } /** * Returns the size of a rotated text, and how far it extends on each side of its anchor point. * * Which side of the anchor the text is drawn on depends on both the text anchoring and the rotation, * so `above` and `below` are not necessarily equal. Either of them is negative when the whole text * sits on the other side of the anchor point. * * @param textSize The size of the text before rotation. * @param config How the text is anchored and rotated. */ export declare function getRotatedTextBounds(textSize: { width: number; height: number; }, config: RotatedTextBoundsConfig): RotatedTextBounds; /** This function finds the best place to clip the text to add an ellipsis. * This function assumes that the {@link doesTextFit} never returns true for longer text after returning false for * shorter text. * * @param text Text to ellipsize if needed * @param doesTextFit a function that returns whether a string fits inside a container. */ export declare function ellipsize(text: string, doesTextFit: (text: string) => boolean): string; export {};