import { TextStyleModel } from './tooltip-model'; /** * Internal cache + scratch state for `measureText`. * * Encapsulated as a private (non-exported) class with static members to match the * codebase convention of holding mutable state on classes (see `SvgRenderer`, * `CanvasRenderer`, `Tooltip`) rather than as free module-level variables. * * - `cache` : memoized [width, height] keyed by font + text (avoids reflow). * - `count` / `LIMIT` : bounded eviction guard for long-running applications. * - `lastStyle` : last font styles written to the shared measurement node, * so identical consecutive misses skip redundant style writes. * * @private */ export declare class TextMeasureCache { static cache: { [key: string]: [number, number]; }; static count: number; static readonly LIMIT: number; static clear(): void; } /** * Function to measure the height and width of the text. * * @private * @param {string} text To get a text * @param {TextStyleModel} font To get a font of the text * @param {TextStyleModel} themeFontStyle Theme defaults used when font fields are unset * @param {boolean} isHeader Whether the text is rendered as the tooltip header * @returns {Size} measureText */ export declare function measureText(text: string, font: TextStyleModel, themeFontStyle?: TextStyleModel, isHeader?: boolean): Size; /** @private */ export declare function withInAreaBounds(x: number, y: number, areaBounds: Rect, width?: number, height?: number): boolean; /** @private */ export declare function findDirection(rX: number, rY: number, rect: Rect, arrowLocation: TooltipLocation, arrowPadding: number, top: boolean, bottom: boolean, left: boolean, tipX: number, tipY: number, controlName?: string): string; /** @private */ export declare class Size { height: number; width: number; constructor(width: number, height: number); } /** @private */ export declare class Rect { x: number; y: number; height: number; width: number; constructor(x: number, y: number, width: number, height: number); } export declare class Side { isRight: boolean; isBottom: boolean; constructor(bottom: boolean, right: boolean); } /** @private */ export declare class CustomizeOption { id: string; constructor(id?: string); } /** @private */ export declare class TextOption extends CustomizeOption { anchor: string; text: string | string[]; transform: string; x: number; y: number; baseLine: string; labelRotation: number; constructor(id?: string, x?: number, y?: number, anchor?: string, text?: string | string[], transform?: string, baseLine?: string, labelRotation?: number); } /** @private */ export declare function getElement(id: string): Element; /** @private */ export declare function removeElement(id: string): void; /** @private */ export interface IShapes { renderOption?: Object; functionName?: string; } /** @private */ export declare function drawSymbol(location: TooltipLocation, shape: string, size: Size, url: string, options: PathOption, role: string, label: string): Element; /** @private */ export declare function calculateShapes(location: TooltipLocation, size: Size, shape: string, options: PathOption, url: string): IShapes; /** @private */ export declare class PathOption extends CustomizeOption { opacity: number; fill: string; stroke: string; ['stroke-width']: number; ['stroke-dasharray']: string; d: string; constructor(id: string, fill: string, width: number, color: string, opacity?: number, dashArray?: string, d?: string); } /** @private */ export declare function textElement(options: TextOption, font: TextStyleModel, color: string, parent: HTMLElement | Element, themeStyle?: TextStyleModel): Element; export declare class TooltipLocation { x: number; y: number; constructor(x: number, y: number); }