import { BBox, Group } from 'ag-charts-core'; import type { BoxBounds, CanvasPoint, CrossLine, CrossLineType, DynamicContext, NormalisedAxisCrossLineLabelOptions, NormalisedAxisCrossLineOptions, PointLabelDatum, PositionedLabelCandidate, Scale } from 'ag-charts-core'; import type { AgCartesianAxisPosition, AgCrossLineLabelPosition, AgCrossLineListeners } from 'ag-charts-types'; import type { CrossLinesRegistry } from './crossLinesRegistry'; export type CartesianCrossLineLabelOptions = NormalisedAxisCrossLineLabelOptions & { reserveSpace: boolean; }; export declare class CartesianCrossLine implements CrossLine { private readonly ctx; static readonly className = "CrossLine"; readonly internalId: string; id?: string; enabled?: boolean; type: CrossLineType; range?: [unknown, unknown]; value?: unknown; fill: string; fillOpacity?: number; stroke?: string; strokeWidth?: number; strokeOpacity?: number; lineDash?: number[]; label: CartesianCrossLineLabelOptions; listeners?: AgCrossLineListeners; scale?: Scale; clippedRange: [number, number]; gridLength: number; gridPadding: number; containerBox?: BoxBounds; readonly rangeGroup: Group; readonly lineGroup: Group; readonly labelGroup: Group; private readonly crossLineRange; private readonly crossLineLabel; private data; private startLine; private endLine; /** The last solve's verdict, which the next layout pads for. */ private labelHidden; private paddedSide; /** Hidden by a re-layout that padded for it, so later layouts keep that padding rather than flip again. */ private labelPadsHidden; private relayingOut; private labelHeld; private anchors; private anchorsResolvedFor; /** Index into {@link anchors} of the placement the label is drawn at. */ private chosen; private readonly candidateIndices; private labelBounds; private fitted; constructor(ctx: DynamicContext); get position(): AgCartesianAxisPosition; applyOptions(options: NormalisedAxisCrossLineOptions): void; /** * Hit-tests a canvas-space point against this cross line's rendered line/fill and its label, widened * by {@link crossLineHitTolerance}. The `crossLineRange` node holds the geometry for both the `line` * (stroke) and `range` (fill) variants; its bbox is transformed into canvas space to match the * pointer coordinates carried by pointer events. */ containsPoint(point: CanvasPoint): boolean; /** The canvas-space box enclosing both regions {@link containsPoint} tests, for the keyboard focus proxy. */ computeFocusBounds(): BBox | undefined; /** The rendered line/fill in canvas space, widened by {@link crossLineHitTolerance}. */ private getLineHitBox; private _isRange; update(visible: boolean): void; calculateLayout(visible: boolean): void; getLabelBox(): BBox | undefined; /** Taken from the drawn node, so whatever `positionLabel` and `clipLabelText` settled on is reserved. */ private labelFootprint; get keepsLabel(): boolean; getLabelDatum(seriesRect: BBox): PointLabelDatum | undefined; private labelRegion; /** A `'clip-text'` label shortens to the room at its anchor, so another placement is laid out to measure it. */ private footprintAt; /** Canvas offset of the label drawn at `anchor` from where it is drawn now. */ private labelOffset; /** Returns whether the last layout padded for a different verdict or placement, so the chart must lay out again. */ applyLabelPlacement(hidden: boolean, candidate?: PositionedLabelCandidate): boolean; private get padsForLabel(); /** A held hidden label sits the re-layout out, as it was laid out unpadded. */ holdLabelPlacement(hold: boolean): void; private updateNodes; private layoutLabel; private updateRangeNode; private updateLabel; /** * The label fitted to its own `maxWidth`/`maxHeight`, which do not depend on where it is placed. Keyed on * the measurer, which a web font load replaces. */ private fittedLabel; /** False once the fit has erased the text, as a `maxHeight` below one line does. */ private get hasFittedText(); private get horizontal(); /** The placements to try in order, resolved for the axis the cross line is on and the text direction. */ private get resolvedAnchors(); private anchorAt; private get anchor(); /** Offsets `positionLabel` applies to the anchor point, shared so both agree on where the box sits. */ private labelAnchorOffsets; /** * Ellipsises a `'clip-text'` label to the chart container. Bounded from the anchor point, not the drawn * box: a box-relative bound moves as the text shortens, so it would never settle. */ private clipLabelText; private labelPoint; private positionLabel; private computeLabelSize; private get labelPaddingSide(); private paddingSideOf; calculatePadding(into: Partial>): void; private paddingExtent; }