/** * Truncates text to fit within a given width using binary search for optimal performance. * @param ctx The canvas rendering context used for text measurement * @param text The text to truncate * @param maxWidth The maximum width the text should occupy * @param ellipsis The ellipsis string to append (default: "...") * @returns The truncated text with ellipsis if needed */ export declare function truncateText(ctx: CanvasRenderingContext2D, text: string, maxWidth: number, ellipsis?: string): string;