import { BaseProperties, type CollideWith, type RequireOptional } from 'ag-charts-core'; import type { AgChartLabelCollisionOptions, AgChartLabelCollisionPlacement, AgChartLabelFormatterParams, AgChartLabelOptions, AgChartLabelOrientation, AgChartLabelPlacementStyleOptions, AgChartLabelStyleOptions, AgChartLabelStylerParams, ContextDefault, FontStyle, FontWeight, Padding, PaddingOptions, RichFormatter, Styler, TextWrap } from 'ag-charts-types'; import type { ContextFormatter } from '../module/axisContext'; export declare class LabelBorder { enabled: boolean; stroke?: string; strokeWidth?: number; strokeOpacity?: number; } /** Placement-reactive border: its `enabled`, explicit or auto-enabled by a sibling, wins over the top level. */ export declare class LabelPlacementBorder { enabled?: boolean; stroke?: string; strokeWidth?: number; strokeOpacity?: number; } /** Undocumented per-category toggle for the obstacles a label avoids. */ declare class LabelCollideWith extends BaseProperties { markers?: boolean; labels?: boolean; seriesItems?: boolean; seriesArea?: boolean; } export declare class LabelCollision extends BaseProperties implements AgChartLabelCollisionOptions { threshold?: number; alwaysShow: boolean; collideWith: LabelCollideWith; /** * Resolved per-category obstacle toggles. Applies the global default profile: marker/label/seriesArea * avoidance default on, seriesItem defaults off; a per-series theme overrides these via `collideWith`. */ resolveCollideWith(): CollideWith; } export declare class LabelStyle extends BaseProperties implements AgChartLabelStyleOptions { border: LabelBorder; color?: string; cornerRadius?: number; fill?: string; fillOpacity?: number; fontStyle?: FontStyle; fontWeight?: FontWeight; fontSize: number; fontFamily: string; padding?: Padding; } /** Style overrides applied to a label for one resolved placement (inside or outside). */ export declare class LabelPlacementStyle extends BaseProperties implements AgChartLabelPlacementStyleOptions { color?: string; fill?: string; fillOpacity?: number; cornerRadius?: number; padding?: Padding; border: LabelPlacementBorder; } export declare class Label extends LabelStyle implements AgChartLabelOptions> { enabled: boolean; collision: LabelCollision; orientation?: AgChartLabelOrientation | AgChartLabelOrientation[]; maxWidth?: number; maxHeight?: number; wrapping?: TextWrap; truncate?: boolean; minimumFontSize?: number; formatter?: RichFormatter & RequireOptional>; format?: string; itemStyler?: Styler, AgChartLabelStyleOptions>; private _cachedFormatter; formatValue(formatWithContext: ContextFormatter & RequireOptional>, type: 'number' | 'date' | 'category', value: any, params: AgChartLabelFormatterParams & RequireOptional): string | import("ag-charts-core").NormalisedContentSegment[] | undefined; } /** Label for point-like series (line, area, scatter, bubble, map-marker) that resolve a directional placement. */ export declare class PlacedSeriesLabel extends Label { placement?: AgChartLabelCollisionPlacement | AgChartLabelCollisionPlacement[]; spacing?: number; insideStyle: LabelPlacementStyle; outsideStyle: LabelPlacementStyle; } type LabelBoxingMixin = { border?: { enabled?: boolean; stroke?: string; strokeWidth?: number; }; fill?: unknown; padding?: Padding; }; /** Whether the label draws a background box: it has a fill, or an enabled border with a stroke. */ export declare function labelHasBox(label: LabelBoxingMixin | undefined): boolean; export declare function expandLabelPadding(label: LabelBoxingMixin | undefined): Required; /** * Overlays the top-level label beneath a placement style so an explicit placement value wins and any * unset property falls back to the top-level label. `border` is merged field-wise because it is a * class instance `mergeDefaults` would otherwise copy by reference; each border field, including * `enabled`, wins from the placement style and falls through to the top-level label when unset. */ export declare function resolvePlacementLabelStyle(label: Label, placementStyle: LabelPlacementStyle | undefined): Label; /** * Per-side extent of the label's drawn box beyond its text: box padding plus the outward half of any * border stroke. This is the footprint collisions must reserve so labels avoid the box, not just the text. */ export declare function expandLabelBoxExtent(label: LabelBoxingMixin | undefined): Required; /** Reserves the larger of the two placements' box extent, as placement is not resolved until layout. */ export declare function expandPlacementLabelBoxExtent(label: Label & { insideStyle: LabelPlacementStyle; outsideStyle: LabelPlacementStyle; }): Required; /** * Resolved per-side box padding folded into a placement label's anchor offset. All-zero for a boxless * label, so its gap from the shape comes solely from `spacing`; the caller adds the side facing the * shape (known per datum) to keep the box edge — not the text — at `spacing`. */ export declare function resolvePlacementLabelPadding(label: Label, placementStyle: LabelPlacementStyle | undefined): Required; /** * Resolved per-side extent of a placement label's drawn box (padding plus the outward half of any border * stroke) folded into its anchor offset, so the box's outer edge — not just the padding boundary — sits * `spacing` from the shape. All-zero for a boxless label. */ export declare function resolvePlacementLabelBoxExtent(label: Label, placementStyle: LabelPlacementStyle | undefined): Required; /** * Offset from a placed label's reserved top-left to its text anchor. The reservation spans the larger of * the two placements' extents, so the surplus is split evenly to keep the drawn box centred on whatever * the placement engine centred the reservation on. */ export declare function placedLabelTextOffset(label: Label & { insideStyle: LabelPlacementStyle; outsideStyle: LabelPlacementStyle; }, placementStyle: LabelPlacementStyle | undefined): { x: number; y: number; }; /** * A reservation sized from the style resolved at the winning placement is filled exactly by the drawn box, * so the text sits one box extent in from its top-left. */ export declare function styledLabelTextOffset(style: LabelBoxingMixin): { x: number; y: number; }; export {};