import { dimensions as core } from '@synnaxlabs/x';
/**
 * Calculates the dimensions (width and height) of a text string when rendered with a specific font.
 * This function uses the canvas API to measure text dimensions accurately.
 *
 * @param {string} text - The text string to measure
 * @param {string} font - The CSS font string to use for measurement (e.g. "16px Arial")
 * @param {OffscreenCanvasRenderingContext2D | CanvasRenderingContext2D} [context] - Optional rendering context to use for measurement
 * @returns {core.Dimensions} An object containing the width and height of the text in pixels
 * @example
 * const dims = dimensions("Hello World", "16px Arial");
 * console.log(dims.width, dims.height);
 */
export declare const dimensions: (text: string, font: string, context?: OffscreenCanvasRenderingContext2D | CanvasRenderingContext2D) => core.Dimensions;
/**
 * Converts TextMetrics from the canvas API into a simplified dimensions object.
 * This function handles the calculation of actual text dimensions by considering
 * the bounding box metrics provided by the canvas API.
 *
 * @param {TextMetrics} metrics - The TextMetrics object from canvas.measureText()
 * @returns {core.Dimensions} An object containing the width and height of the text in pixels
 */
export declare const dimensionsFromMetrics: (metrics: TextMetrics) => core.Dimensions;
//# sourceMappingURL=dimensions.d.ts.map