import { ChartOptions, AxisOptions, SeriesOptions, HeatmapOptions, SeriesUpdateData, ZoomOptions, CursorOptions, ChartEventMap, Bounds, FitOptions } from '../../types'; import { EventEmitter } from '../EventEmitter'; import { Series } from '../Series'; import { Scale } from '../../scales'; import { ChartTheme, ColorScheme } from '../../theme'; import { Annotation } from '../annotations'; import { SelectedPoint, SelectionMode, HitTestResult, SelectionConfig } from '../selection'; import { ResponsiveConfig, ResponsiveState } from '../responsive'; import { ChartState, SerializeOptions, DeserializeOptions } from '../../serialization'; import { Chart, ExportOptions } from './types'; import { ChartAnimationConfig } from '../animation'; import { ChartFeatureHooks } from './ChartFeatureHooks'; export declare class ChartImpl implements Chart { /** Optional hook for extended bundles (WebGPU, etc.). */ static afterConstruct: ((chart: ChartImpl, options: ChartOptions) => void) | null; private container; private webglCanvas; private overlayCanvas; private svgRoot; private overlayCtx; series: Map; events: EventEmitter; private viewBounds; private xAxisOptions; private yAxisOptionsMap; private primaryYAxisId; private dpr; /** * When set, overrides the device pixel ratio used by `resize()` instead of * recomputing it from `window.devicePixelRatio`. Used by high-resolution * export (snapshot) so the boosted DPR is not clobbered on the next resize. */ private dprOverride; private backgroundColor; private plotAreaBackground; private renderer; private activeRendererType; private overlay; private interaction; private xScale; private yScales; private get yScale(); theme: ChartTheme; baseTheme: ChartTheme; private colorScheme; private cursorOptions; private cursorPosition; private showLegend; private legend; private originalSeriesStyles; private hoveredSeriesId; private showControls; private toolbarOptions?; private controls; private layout; private _isDestroyed; /** When true, skip resize (stacked pane drag uses CSS scaling instead). */ private resizeSuspended; private autoScroll; private showStatistics; private initQueueId; private readonly chartId; private commandQueue; private annotationQueue; private annotationIdCounter; private tooltipConfigQueue; private fitLineQueue; /** Whether the chart has been destroyed */ get isDestroyed(): boolean; private selectionRect; private pluginManager; private initialOptions; private pluginBridge; private axisManager; private stateManager; private renderLoop; private resizeObserver; setXScale(scale: Scale): void; setYScale(yAxisId: string, scale: Scale): void; get analysis(): any; get tooltip(): any; get loading(): any; get deltaTool(): any; get peakTool(): any; get regression(): any; get radar(): any; get ml(): any; get snapshot(): any; get dataExport(): any; get roi(): any; get videoRecorder(): any; get offscreen(): any; get virtualization(): any; get themeEditor(): any; get sync(): any; get brokenAxis(): any; get forecasting(): any; get patterns(): any; get latex(): any; private animationEngine; private animationConfig; get animations(): ChartAnimationConfig; private selectionManager; private responsiveManager; private featureHooks; private timeScaleMapping; constructor(options: ChartOptions); /** * Start the chart initialization (called by queue system) * This performs the actual render startup that was deferred from constructor */ startInit(): Promise; /** * Mark this chart's initialization as complete in the queue */ completeInit(): Promise; private executeOrQueue; /** * Set the initialization queue ID (internal use) */ setInitQueueId(id: string): void; private initControls; private toggleLegend; private initLegend; setTheme(theme: string | ChartTheme): void; /** * Set the color scheme for multi-series charts * @param scheme - Color scheme name ('vibrant', 'pastel', 'neon', 'earth', 'ocean') or ColorScheme object */ setColorScheme(scheme: string | ColorScheme): void; /** * Get the current color scheme */ getColorScheme(): ColorScheme; getPlotArea(): { x: number; y: number; width: number; height: number; }; private getInteractedBounds; exportImage(type?: "png" | "jpeg"): string; setFeatureHooks(hooks: ChartFeatureHooks | null): void; exportSVG(_options?: import('./exporter/SVGExporter').SVGExportOptions): string; private getSeriesContext; addSeries(options: SeriesOptions | HeatmapOptions): void; addBar(options: Omit): void; addHeatmap(options: HeatmapOptions): void; removeSeries(id: string): void; updateSeries(id: string, data: SeriesUpdateData): void; appendData(id: string, x: number[] | Float32Array, y: number[] | Float32Array): void; setAutoScroll(enabled: boolean): void; setMaxPoints(id: string, maxPoints: number): void; /** * Add a line of best fit to a series */ addFitLine(seriesId: string, type: any, options?: any): string; private tradingRequired; addIndicator(_preset: import('../indicator/addIndicator').IndicatorPresetName, _options?: import('../indicator/addIndicator').AddIndicatorOptions): Promise; addAlert(_options: import('./ChartAlerts').PriceAlertOptions): string; removeAlert(_id: string): boolean; clearAlerts(): void; getAlerts(): import('./ChartAlerts').PriceAlertOptions[]; addPositionLine(_options: import('./positionLines').PositionLineOptions): string; setDrawingMode(_mode: import('../../plugins/drawing-tools').DrawingMode): void; getSeries(id: string): Series | undefined; getAllSeries(): Series[]; private getNavContext; private getAnimatedNavContext; zoom(options: ZoomOptions & { animate?: boolean; }): void; pan(deltaX: number, deltaY: number, axisId?: string): void; resetZoom(): void; fit(options?: FitOptions): void; getId(): string; getViewBounds(): Bounds; autoScale(animate?: boolean): void; /** * Auto-scale only Y-axes (keeps X-axis stable) * Used during streaming to prevent X-axis shifting */ autoScaleYOnly(): void; /** * Animate view bounds to specific target */ animateTo(options: { xRange?: [number, number]; yRange?: [number, number]; duration?: number; easing?: string; }): void; /** * Get animation configuration */ getAnimationConfig(): ChartAnimationConfig; /** * Set animation configuration */ setAnimationConfig(config: Partial): void; /** * Check if animations are currently running */ isAnimating(): boolean; private handleBoxZoom; enableCursor(options: CursorOptions): void; disableCursor(): void; addAnnotation(annotation: any): string; removeAnnotation(id: string): boolean; updateAnnotation(id: string, updates: Partial): void; getAnnotation(id: string): Annotation | undefined; getAnnotations(): Annotation[]; clearAnnotations(): void; /** * Get a plugin API by name */ getPlugin(name: string): T | null; getPluginNames(): string[]; private getPluginAPI; exportCSV(options?: ExportOptions): string; exportJSON(options?: ExportOptions): string; /** * Add a new Y axis dynamically */ addYAxis(options: AxisOptions): string; /** * Remove a Y axis by ID */ removeYAxis(id: string): boolean; /** * Update Y axis configuration */ updateYAxis(id: string, options: Partial): void; /** * Get current device pixel ratio */ getDPR(): number; getActiveRenderer(): "webgl" | "webgpu" | "svg"; /** Series id hovered from the legend — affects draw order in canvas and live SVG. */ getHoveredSeriesId(): string | null; /** @internal Vector frame for `renderer: 'svg'` — patched on extended bundles. */ buildSVGFrame(): string; /** * Set device pixel ratio and re-render */ setDPR(dpr: number): void; /** * Locks the device pixel ratio to an explicit value (or clears the lock with * `null`). Unlike {@link setDPR}, this survives subsequent `resize()` calls, * which is required for high-resolution export: the backing stores must stay * enlarged while the snapshot is captured. Pass `null` to restore automatic * DPR handling based on `window.devicePixelRatio`. */ setDevicePixelRatioOverride(dpr: number | null): void; /** * Update X axis configuration */ updateXAxis(options: Partial): void; updateLayout(options: Partial): void; /** * Get Y axis configuration by ID */ getYAxis(id: string): AxisOptions | undefined; /** * Get X axis configuration */ getXAxis(): AxisOptions; /** * Get all Y axes configurations */ getAllYAxes(): AxisOptions[]; /** * Get the primary Y axis ID */ getPrimaryYAxisId(): string; /** * Select data points programmatically */ selectPoints(points: Array<{ seriesId: string; indices: number[]; }>, mode?: SelectionMode): void; /** * Get all currently selected points */ getSelectedPoints(): SelectedPoint[]; /** * Clear all selections */ clearSelection(): void; /** * Hit-test at a pixel coordinate */ hitTest(pixelX: number, pixelY: number): HitTestResult | null; /** * Check if a specific point is selected */ isPointSelected(seriesId: string, index: number): boolean; /** * Get selection count */ getSelectionCount(): number; /** * Configure selection behavior */ configureSelection(config: Partial): void; /** * Set pan mode (true = pan, false = selection) * @deprecated Use setMode('pan') or setMode('select') instead. **Removed in v4.0.** */ setPanMode(enabled: boolean): void; /** * Set the interaction mode * @param mode - 'pan' for pan/drag, 'boxZoom' for rectangle zoom, 'select' for point selection, 'delta' for measurements */ setMode(mode: 'pan' | 'boxZoom' | 'select' | 'delta' | 'peak'): void; /** * Get the current interaction mode */ getMode(): 'pan' | 'boxZoom' | 'select' | 'delta' | 'peak'; /** * Get the Delta Tool instance for advanced measurements */ getDeltaTool(): any | null; /** * Get the Peak Tool instance for peak integration */ getPeakTool(): any | null; /** * Handle responsive state changes */ private handleResponsiveChange; /** * Get current responsive state */ getResponsiveState(): ResponsiveState; /** * Configure responsive behavior */ configureResponsive(config: Partial): void; /** * Check if responsive mode is enabled */ isResponsiveEnabled(): boolean; /** * Export complete chart state */ serialize(options?: SerializeOptions): ChartState; /** * Restore chart from saved state */ deserialize(state: ChartState, options?: DeserializeOptions): void; /** * Convert current state to URL-safe hash */ toUrlHash(compress?: boolean): string; /** * Load state from URL hash */ fromUrlHash(hash: string, compressed?: boolean): void; use(plugin: any): Promise; /** * Suspend canvas backing-store resize (inactive panes during stacked drag). */ setResizeSuspended(suspended: boolean): void; /** @deprecated Use CSS transform on pane wrapper during drag; canvas stays untouched. **Removed in v4.0.** */ syncDragLayout(width?: number, height?: number): void; isResizeSuspended(): boolean; resize(): void; requestRender(): void; requestOverlayRender(): void; /** * Trigger an immediate full render (public API compatibility) */ render(): void; private pixelToDataX; private pixelToDataY; private startRenderLoop; on(e: K, h: (d: ChartEventMap[K]) => void): void; off(e: K, h: (d: ChartEventMap[K]) => void): void; destroy(): void; private toggleSmoothing; private recalculateTools; } /** * Create a new chart. Charts are automatically queued for sequential * initialization when multiple charts are created on the same page. */ export declare function createChart(options: ChartOptions): Chart;