import { type Vec2, type Vec4 } from '../../math'; import type { DecorationScene, DecorationSolution, ReferenceAnnotationBaseline, ReferenceAnnotationCandidate, ReferenceAnnotationTextAnchor } from './decorations'; import type { Rect } from './layout'; import type { AxisKey, RefLine, RefLineAnnotation, RefLineValue } from './types'; export type IndexedRefLine = RefLine & { idx: number; }; type Scale = (val: number) => number; export type ReferenceLineAxes = { ranges: Record; scales: Record; }; export type RefLineAxes = { x_min: number; x_max: number; y_min: number; y_max: number; x_scale: Scale; y_scale: Scale; }; export declare const index_ref_lines: (ref_lines: RefLine[] | undefined) => IndexedRefLine[]; export declare function resolve_ref_line_axes(line: RefLine, { ranges, scales }: ReferenceLineAxes): RefLineAxes; export declare function normalize_value(value: RefLineValue): number; export declare const normalize_point: (point: [RefLineValue, RefLineValue]) => Vec2; export declare function resolve_line_endpoints(ref_line: RefLine, axes: RefLineAxes): Vec4 | null; interface AnnotationPosition { x: number; y: number; text_anchor: ReferenceAnnotationTextAnchor; dominant_baseline: ReferenceAnnotationBaseline; rotation?: number; } export declare function calculate_annotation_position(x1: number, y1: number, x2: number, y2: number, annotation: { position?: `start` | `center` | `end`; side?: `above` | `below` | `left` | `right`; offset?: { x?: number; y?: number; }; gap?: number; edge_padding?: number; rotate?: boolean; }): AnnotationPosition; interface ReferenceAnnotationMetrics { text_width: number; font_size: number; text_ascent: number; text_descent: number; padding: number; } export declare const estimate_reference_annotation_metrics: (annotation: RefLineAnnotation) => ReferenceAnnotationMetrics; export declare const reference_annotation_text_rect: (anchor: AnnotationPosition, metrics: ReferenceAnnotationMetrics) => Rect; export declare function create_reference_annotation_candidates(endpoints: Vec4, annotation: RefLineAnnotation, metrics?: ReferenceAnnotationMetrics): ReferenceAnnotationCandidate[]; export declare function solve_reference_annotations({ base_solution, exclusion_rects, lines, ranges, scales, clearance, ...scene }: Omit & ReferenceLineAxes & { base_solution: DecorationSolution; lines: readonly IndexedRefLine[]; clearance?: number; }): DecorationSolution; export declare const get_reference_annotation_placement: (solution: DecorationSolution, line_idx: number) => ReferenceAnnotationCandidate | undefined; export {};