import type { BoxBounds, CanvasPoint, ChartAxisDirection, Forbid, RequireOptional, Scale } from 'ag-charts-core'; import type { AgBaseCrossLineLabelOptions, AgCrossLineClickEvent, AgCrossLineClickParams, AgCrossLineDoubleClickEvent, AgCrossLineLabelPosition, AgCrossLineListeners, AgMatchedParams, AgTimeInterval, AgTimeIntervalUnit } from 'ag-charts-types'; import type { PolarAxisLayout } from '../../module/axisContext'; import type { Group } from '../../scene/group'; type Caller = { context?: unknown; }; export type CrossLineType = 'line' | 'range'; export type CrossLineValuePick = RequireOptional; interface ICrossLine { type: CrossLineType; range?: [unknown, unknown]; value?: unknown; } interface PendingCallback { callers: Caller[]; fn: (params: any) => void; params: PendingCrossLineCallbackParam; } export type PendingCrossLineCallbackParam = Forbid | Forbid; export interface PendingCrossLineCallbacks { allMatchedParams: AgCrossLineClickParams[]; chart?: PendingCallback; axes: Map; crossLines: Map; } export declare function getCrossLineValue(crossLine: ICrossLine): unknown; export declare function validateCrossLineValue(crossLine: ICrossLine, scale: Scale): boolean; export declare function fireAllPendingCrossLineCallbacks(pending: PendingCrossLineCallbacks, otherHitParams: AgMatchedParams[]): void; export interface CrossLine { calculateLayout?(visible: boolean, reversedAxis?: boolean): void; calculatePadding?(padding: Partial>): void; /** * Hit-tests a canvas-space point against the cross line's rendered line, fill or label, widened * by a small fixed pixel tolerance. Returns `false` when the cross line is not currently visible. */ containsPoint?(point: CanvasPoint): boolean; clippedRange: [number, number]; enabled?: boolean; defaultColorRange: string[]; fill?: string; fillOpacity?: number; gridLength: number; gridPadding: number; /** Whether the label reserves its space from other labels. Cartesian cross lines only. */ readonly reservesLabelSpace?: boolean; /** The drawn label's footprint in canvas coordinates, or `undefined` when it draws no label. */ getLabelBox?(): BoxBounds | undefined; /** * Chart container in canvas coordinates, bounding where a `'clip-text'` label may draw. Set on every * update, since the canvas can resize without the axis relaying out. */ containerBox?: BoxBounds; lineGroup: Group; rangeGroup: Group; /** Internally generated, always present and unique per instance. */ internalId: string; /** User-supplied identifier, when the cross line's options set one. */ id?: string; label: LabelType; labelGroup: Group; /** User-supplied pointer listeners, when the cross line's options set any. */ listeners?: AgCrossLineListeners; lineDash?: number[]; range?: [any, any]; scale?: Scale; stroke?: string; strokeOpacity?: number; strokeWidth?: number; type: CrossLineType; update(visible: boolean): void; value?: any; set(properties: object): void; } export interface PolarCrossLine extends CrossLine { direction: ChartAxisDirection; parallelFlipRotation: number; regularFlipRotation: number; sideFlag: 1 | -1; /** * Applies polar-axis layout state (radius/inner-radius/shape/ticks/gridAngles) to the * cross-line. The plugin calls this once per update phase on polar axes. */ applyPolarLayout(layout: PolarAxisLayout): void; } export {};