ag-charts-enterprise
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
44 lines (43 loc) • 1.44 kB
TypeScript
import { _ModuleSupport } from 'ag-charts-community';
import { type DynamicContext, type Point } from 'ag-charts-core';
import type { TextAlign, TextOptions } from 'ag-charts-types';
import type { AnnotationTextPosition } from '../annotations/text/util';
interface Layout {
getTextInputCoords: (height: number) => Point;
getTextPosition: () => AnnotationTextPosition;
alignment: 'left' | 'center' | 'right';
textAlign: TextAlign;
width?: number;
}
export declare class TextInput {
private readonly ctx;
private readonly cleanup;
private readonly element;
private layout;
private visible;
constructor(ctx: DynamicContext<_ModuleSupport.ChartRegistry>);
setKeyDownHandler(handler: (e: KeyboardEvent) => unknown): void;
show(opts: {
anchor?: {
x: number;
y: number;
};
text?: string;
placeholderText?: string;
styles?: TextOptions & {
placeholderColor?: string;
};
layout?: Layout;
onChange?: (text: string, bbox: _ModuleSupport.BBox) => void;
onClose?: (text: string) => void;
}): void;
hide(): void;
isVisible(): boolean;
updateColor(color: string): void;
updateFontSize(fontSize: number): _ModuleSupport.BBox | undefined;
getValue(): string | undefined;
private updatePosition;
getBBox(): _ModuleSupport.BBox;
destroy(): void;
}
export {};