/**
 * Configuration for canvas layout calculation
 */
interface ChartLayoutConfig {
    /** Chart data to generate formatted labels from */
    data: Array<{
        label: string;
        value: number;
    }>;
    /** Denominator for percentage calculations, e.g., total or max value */
    denominator: number;
    /** Unit string to append to labels (e.g., '%', 'kW') */
    unit?: string;
    /** Whether to show the unit in labels */
    showUnit?: boolean;
    /** Maximum character length for label text */
    outerLabelMaxLength?: number;
    /** Number of decimal places in formatted values */
    decimalPlaces?: number;
}
/**
 * Result of canvas layout calculation
 */
interface ChartPaddingAndLabelsResult {
    padding: {
        top: number;
        right: number;
        bottom: number;
        left: number;
    };
    formattedLabels: string[];
}
/**
 * Format a numeric value as either a percentage or raw number
 * Returns only the numeric string without unit suffix
 *
 * @param value - The numeric value to format
 * @param denominator - The total/max value to calculate percentage against
 * @param asPercentage - Whether to calculate as percentage (true) or use raw value (false)
 * @param decimalPlaces - Number of decimal places to show (default: 0)
 * @returns Formatted numeric string (e.g., "45.0" or "30.5")
 */
export declare function formatNumericValue(value: number, denominator: number, asPercentage: boolean, decimalPlaces?: number): string;
/**
 * Format a complete chart label with value, unit, and truncation
 *
 * @param value - The numeric value to format
 * @param denominator - The total/max value for percentage calculation
 * @param config - Label configuration
 * @returns Fully formatted label string (with unit and truncation applied)
 */
export declare function formatSingleLabel(value: number, denominator: number, config: {
    unit?: string;
    showUnit?: boolean;
    decimalPlaces?: number;
    maxLength?: number;
}): string;
/**
 * Calculate canvas padding and formatted labels for charts
 *
 * @param host - The chart component element (for CSS variable access)
 * @param ctx - Canvas 2D rendering context (for text measurement)
 * @param showOuterLabels - Whether outer labels are enabled
 * @param config - Label configuration for padding calculation
 * @returns Padding values and formatted label strings
 */
export declare function calculateChartPaddingAndLabels(host: HTMLElement, ctx: CanvasRenderingContext2D, showOuterLabels: boolean, config: ChartLayoutConfig): ChartPaddingAndLabelsResult;
/**
 * Configuration for fixed height chart layout calculation
 */
export interface FixedHeightChartConfig {
    /** Fixed height in pixels (determines chart circumference, to match other circular components' circumference) */
    fixedHeight: number;
    /** Whether chart is in half mode (180° arc instead of 360°, applies to donut chart only) */
    isHalfMode: boolean;
    /** Whether to show outer labels */
    showOuterLabels: boolean;
    /** Canvas element for text measurement */
    canvasEl: HTMLCanvasElement | undefined;
    /** Chart layout configuration for label formatting */
    layoutConfig: ChartLayoutConfig;
    /** Host element for CSS variable access */
    host: HTMLElement;
}
/**
 * Result of fixed height chart layout calculation
 */
export interface FixedHeightChartDimensions {
    /** Whether chart is too small to show labels (height < MIN_HEIGHT_WITH_LABELS) */
    isTooSmall: boolean;
    /** Full circle diameter for Chart.js drawing */
    chartDiameter: number;
    /** Visible width (differs from chartDiameter in half mode) */
    visibleWidth: number;
    /** Actual rendered canvas height (differs from fixedHeight in half mode for donut chart only) */
    actualHeight: number;
    /** Calculated total canvas width including padding */
    calculatedWidth: number;
    /** Padding for left side */
    leftPadding: number;
    /** Padding for right side */
    rightPadding: number;
    /** Padding for top side */
    topPadding: number;
    /** Padding for bottom side */
    bottomPadding: number;
    /** Calculated aspect ratio (width / height) */
    aspectRatio: number;
    /** Formatted label strings for outer labels */
    formattedLabels: string[];
}
/**
 * Calculate all dimensions and layout properties for a fixed-height circular chart
 *
 * This is the centralized calculation function used by all circular charts (donut, pie, polar, radial-bar)
 * to ensure consistent behavior across chart types.
 *
 * Fixed Height Mode Calculation Flow:
 *
 * Step 1: Calculate chart diameter from fixed height
 *   - topBottomPadding = CANVAS_PADDING * 2 = 64px
 *   - For full circle: chartDiameter = fixedHeight - 64
 *   - For half circle: chartDiameter = (fixedHeight - 64) / 2 (full circle for Chart.js)
 *   - visibleWidth: For half mode = fixedHeight - 64, for full mode = chartDiameter
 *
 * Step 2: Measure label widths and calculate horizontal padding
 *   - Uses ctx.measureText() to get pixel width of formatted labels
 *   - leftRightPadding = max(CANVAS_PADDING, maxLabelWidth + labelGap)
 *
 * Step 3: Calculate total canvas width
 *   - calculatedWidth = leftPadding + visibleWidth + rightPadding
 *   - Important: Use visibleWidth (not chartDiameter) for half mode
 *
 * Step 4: Check threshold and hide labels if needed
 *   - if (fixedHeight < MIN_HEIGHT_WITH_LABELS) hide labels
 *
 * Step 5: Calculate actual rendered height and aspect ratio
 *   - For half circle: actualHeight = (fixedHeight - 64) / 2 + 64
 *     Example: fixedHeight=320 → actualHeight=192, visibleWidth=256
 *   - For full circle: actualHeight = fixedHeight
 *   - aspectRatio = calculatedWidth / actualHeight
 *
 * @param config - Configuration for the chart layout calculation
 * @returns Complete dimensions and padding for the chart
 */
export declare function calculateFixedHeightChartLayout(config: FixedHeightChartConfig): FixedHeightChartDimensions;
export {};
//# sourceMappingURL=canvas-layout.d.ts.map