import { DeletableEntity } from "../../../Core/DeletableEntity";
import type { IDeletable } from "../../../Core/IDeletable";
import { Rect } from "../../../Core/Rect";
import { Thickness } from "../../../Core/Thickness";
import { EAxisAlignment } from "../../../types/AxisAlignment";
import { ELabelAlignment } from "../../../types/LabelAlignment";
import type { SCRTFont, SCRTPen, TSciChart, TSRTextBounds } from "../../../types/TSciChart";
import type { WebGlRenderContext2D } from "../../Drawing/WebGlRenderContext2D";
import { TextureManager } from "../TextureManager/TextureManager";
import type { AxisBase2D } from "./AxisBase2D";
import type { TTextStyle, TTickLineStyle } from "./AxisCore";
import type { LabelInfo, LabelProviderBase2D } from "./LabelProvider/LabelProviderBase2D";
/**
 * Draws an axis using our WebGL Rendering engine.
 * Base class that provides shared layout/loop logic via a template method pattern.
 * Subclasses ({@link NativeAxisRenderer}, {@link TextureAxisRenderer}) override the
 * hooks {@link onBeginDrawLabels}, {@link drawSingleLabel}, and {@link onEndDrawLabels}
 * to provide rendering-path-specific behaviour.
 */
export declare class AxisRenderer extends DeletableEntity implements IDeletable {
    /**
     * The viewRect of the axis for ticks and labels.  Does not include the axis Title.
     */
    viewRect: Rect;
    drawDebug: boolean;
    textureManager: TextureManager;
    protected parentAxis: AxisBase2D;
    protected webAssemblyContext: TSciChart;
    protected desiredLabelsSize: number;
    protected desiredTicksSize: number;
    private desiredHeightProperty;
    private desiredWidthProperty;
    private axisThicknessProperty;
    protected measureTextCanvas: HTMLCanvasElement;
    private keepLabelsWithinAxisProperty;
    private hideOverlappingLabelsProperty;
    protected currentViewRect: Rect;
    protected currentTextColor: number;
    protected currentRotationRad: number;
    protected currentLineHeight: number;
    /**
     * Creates an instance of a {@link AxisRenderer}
     * @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and
     * access to our WebGL2 Engine and WebAssembly numerical methods
     */
    constructor(webAssemblyContext: TSciChart);
    /** @inheritDoc */
    delete(): void;
    /**
     * Called when the {@link AxisRenderer} is attached to an {@link AxisBase2D | Axis}
     * @param axis The Axis we are attached to.
     */
    attachedToAxis(axis: AxisBase2D): void;
    /**
     * Called internally - measures the axis label area as part of the layout phase
     */
    measure(isHorizontalAxis: boolean, labelStyle: TTextStyle, majorTickLabels: string[], ticksSize: number, labelProvider: LabelProviderBase2D, drawLabels: boolean, drawTicks: boolean, labelInfos?: LabelInfo[]): void;
    /**
     * Called internally - calculates desired labels size
     */
    calcDesiredLabelsSize(isHorizontalAxis: boolean, labelProvider: LabelProviderBase2D, labelStyle: TTextStyle, majorTickLabels: string[], labelInfos?: LabelInfo[]): number;
    /**
     * Called internally - Gets or sets desired height during the layout process
     */
    get desiredHeight(): number;
    set desiredHeight(height: number);
    /**
     * Called internally - Gets or sets desired width during the layout process
     */
    get desiredWidth(): number;
    set desiredWidth(width: number);
    /**
     * Gets or sets keepLabelsWithinAxis property.
     * When true (default), first and last labels will be shifted to stay within axis bounds.
     * If set to false, these labels will stay aligned to their ticks
     */
    get keepLabelsWithinAxis(): boolean;
    set keepLabelsWithinAxis(value: boolean);
    /**
     * Gets or sets hideOverlappingLabels property.
     * Default (true) is to not show labels that would overlap. When using rotation you may want to set this false,
     * as the bounding box of rotated text may overlap even if the text itself does not.
     */
    get hideOverlappingLabels(): boolean;
    set hideOverlappingLabels(value: boolean);
    /**
     * Gets or sets axis label area thickness, by default the size is calculated to have enough space for labels.
     * However, this property allows to set minimal width/height for vertical/horizontal axes.
     * Useful to align seriesViewRects for different charts
     */
    get axisThickness(): number;
    set axisThickness(value: number);
    /**
     * Called internally as a part of the layout process
     */
    layout(rect: Rect): void;
    /**
     * Gets the clip rect
     */
    getClipRect(): Rect;
    /**
     * Called before the label draw loop. Subclasses create rendering resources and return
     * the line height for label positioning.
     */
    protected onBeginDrawLabels(renderContext: WebGlRenderContext2D, labelProvider: LabelProviderBase2D, labelStyle: TTextStyle): number;
    /**
     * Render a single label at the computed position.
     * Subclasses override to provide native or texture rendering.
     */
    protected drawSingleLabel(renderContext: WebGlRenderContext2D, labelProvider: LabelProviderBase2D, labelText: string, labelInfo: LabelInfo | undefined, xCoord: number, yCoord: number, tickCoord: number, labelWidth: number, labelHeight: number, index: number, labelStyle: TTextStyle, clipRect: Rect, isHorizontal: boolean): void;
    /**
     * Called after the label draw loop. Subclasses clean up resources.
     */
    protected onEndDrawLabels(): void;
    /**
     * Measures label widths and heights. Subclasses may override for
     * rendering-path-specific measurement (e.g. native CalculateStringBounds).
     */
    protected measureLabels(tickLabels: string[], labelProvider: LabelProviderBase2D, ctx: CanvasRenderingContext2D, labelStyle: TTextStyle, labelInfos?: LabelInfo[]): {
        labelHeights: number[];
        labelWidths: number[];
    };
    /**
     * Called internally - draws labels
     */
    drawLabels(renderContext: WebGlRenderContext2D, axisAlignment: EAxisAlignment, isInnerAxis: boolean, tickLabels: string[], tickCoords: number[], axisOffset: number, labelStyle: TTextStyle, isVerticalChart: boolean, isFlippedCoordinates: boolean, labelProvider: LabelProviderBase2D, labelInfos?: LabelInfo[]): void;
    /**
     * Called internally - adjusts labels for label alignment
     */
    adjustForLabelAlignment(xCoord: number, labelWidth: number, labelAlignment: ELabelAlignment, axisAlignment: EAxisAlignment, isInnerAxis: boolean, axisWidth: number, tickSize: number): number;
    /**
     * Called internally
     */
    layoutLabels(size: number, tickCoords: number[], labelSizes: number[], isFlippedCoordinates: boolean, padBefore?: number, padAfter?: number): {
        labelCoords: number[];
        labelIndexes: number[];
    };
    /**
     * Called internally
     */
    drawTicks(renderContext: WebGlRenderContext2D, axisAlignment: EAxisAlignment, isInnerAxis: boolean, tickCoords: number[], axisOffset: number, pen: SCRTPen, tickStyle: TTickLineStyle): void;
    /**
     * Used to get the offset from either edge of the seriesViewRect up until the axis labels
     */
    getAxisReservedSpace(isDomAnnotation?: boolean): number;
    /**
     * Measures modifier-axis-label content for the active renderer path.
     * Subclasses override to provide native or texture-specific sizing.
     */
    protected measureModifierAxisLabel(renderContext: WebGlRenderContext2D, displayValue: string, textStyle: TTextStyle, fill: string, effectivePadding: Thickness, cornerRadius?: number): {
        textureWidth: number;
        textureHeight: number;
    };
    /**
     * Draws modifier-axis-label content for the active renderer path.
     * Subclasses override to provide native or texture-specific drawing.
     */
    protected drawModifierAxisLabelSpecific(renderContext: WebGlRenderContext2D, displayValue: string, textStyle: TTextStyle, fill: string, effectivePadding: Thickness, cornerRadius: number | undefined, xPosition: number, yPosition: number, textureWidth: number, textureHeight: number, _clipRect: Rect): void;
    /**
     * Called internally - draws axis labels when needed, for example for line annotations
     */
    drawModifiersAxisLabel(renderContext: WebGlRenderContext2D, displayValue: string, coord: number, axisAlignment: EAxisAlignment, textStyle: TTextStyle, fill: string, padding: Thickness, cornerRadius?: number): Rect;
    /**
     * Called internally - used for {@link AxisMarkerAnnotation}
     */
    createAxisMarker(axisAlignment: EAxisAlignment, text: string, textStyle: TTextStyle, backgroundColor?: string, opacity?: number): import("../TextureManager/TextureManager").TTextureObject;
    /**
     * Called internally - used for custom {@link AxisMarkerAnnotation}
     */
    createAxisMarkerFromImage(image: HTMLImageElement, imageWidth: number, imageHeight: number): import("../TextureManager/TextureManager").TTextureObject;
    /**
     * Called internally
     */
    createAnnotationLabelTexture(text: string, textStyle: TTextStyle, backgroundColor?: string, displayVertically?: boolean, displayMirrored?: boolean, opacity?: number, cornerRadius?: number): import("../TextureManager/TextureManager").TTextureObject;
    protected invalidateParent(): void;
    protected drawLabelViewRects(renderContext: WebGlRenderContext2D, axisRect: Rect, rects: Rect[]): void;
    protected calculateLineHightForNativeFont(nativeFont: SCRTFont, textBounds: TSRTextBounds): number;
    protected getMeasureContext(): CanvasRenderingContext2D;
}
/** @ignore */
export declare const layoutLabelsHelper: (keepLabelsWithinAxis: boolean, hideOverlappingLabels: boolean, size: number, tickCoords: number[], labelSizes: number[], isFlippedCoordinates: boolean, prioritiseFirstWideLabel?: boolean) => {
    labelCoords: number[];
    labelIndexes: number[];
};
