import { ChartOptions } from './options'; import { ChartState } from '../../features/chart-state'; import { DownloadOptions } from '../../features/export'; import { DomainAnchor, ImperativeOptions, NodeRef, SelectedNode, ZoomWindow } from '../../shared/kernel'; import { DeepPartial } from '../../shared/options'; export interface ChartInstance { update(options: ChartOptions): Promise; updateDelta(patch: DeepPartial): Promise; getOptions(): ChartOptions; getState(): ChartState; setState(state: ChartState): Promise; /** Resolves after the scheduled render — including the redraw a still-loading web font triggers. */ waitForUpdate(): Promise; /** * Everything the pointer does, addressed by datum. These are the interactions * themselves, not fake events: they run the same code a real hover or click * does, so the listeners fire — pass `{ silent: true }` to keep them quiet, * which is what an app driving the chart from its own state usually wants. * * They render on the same schedule as the rest: await `waitForUpdate()` when * the next line depends on the frame being on screen. */ showTooltip(target: NodeRef): boolean; hideTooltip(): void; /** Runs a click on a node: nodeClick plus the selection it would cause. */ clickNode(target: NodeRef, options?: ImperativeOptions): boolean; getSelection(): SelectedNode[]; setSelection(targets: NodeRef[], options?: ImperativeOptions): void; clearSelection(options?: ImperativeOptions): void; isZoomed(): boolean; /** Zoom window per axis, as fractions of the full domain. */ zoomTo(window: { x?: ZoomWindow; y?: ZoomWindow; }, options?: ImperativeOptions): void; /** Window sized to a number of items, the way zoom.visibleCount sizes it at startup. */ zoomToCount(count: number, options?: ImperativeOptions & { anchor?: DomainAnchor; }): void; resetZoom(options?: ImperativeOptions): void; getImageDataURL(options?: DownloadOptions): string; download(options?: DownloadOptions): void; destroy(): void; } export declare function createChart(options: ChartOptions): ChartInstance;