import type { AgInitialStateOptions } from './api/initialStateOptions'; import type { AgBaseCartesianChartOptions } from './chart/cartesianOptions'; import type { AgBaseChartOptions } from './chart/chartOptions'; import type { AgDataTransaction } from './chart/dataTransaction'; import type { AgSelectionItem, AgSelectionItemIds } from './chart/eventOptions'; import type { AgBasePolarChartOptions } from './chart/polarOptions'; import type { AgBaseChartThemeOptions, AgBaseGaugePresetThemeOptions, AgChartTheme, AgChartThemeName } from './chart/themeOptions'; import type { ContextDefault, DatumDefault, PixelSize } from './chart/types'; import type { AgFinancialChartPresets } from './presets/financial/financialOptions'; import type { AgGaugePresets } from './presets/gauge/gaugeOptions'; import type { AgLinearGaugePreset } from './presets/gauge/linearGaugeOptions'; import type { AgRadialGaugePreset } from './presets/gauge/radialGaugeOptions'; import type { AgSparklineBaseThemeableOptions, AgSparklinePresets } from './presets/sparkline/sparklineOptions'; import type { AgBaseFlowProportionChartOptions } from './series/standalone/flowProportionOptions'; import type { AgBaseHierarchyChartOptions } from './series/standalone/hierarchyOptions'; import type { AgBaseStandaloneChartOptions } from './series/standalone/standaloneOptions'; import type { AgBaseTopologyChartOptions } from './series/topology/topologyOptions'; export interface AgChartThemeOptions extends AgBaseChartThemeOptions { } export interface AgCartesianChartOptions extends AgBaseCartesianChartOptions, AgBaseChartOptions { /** * A predefined theme name or an object containing theme overrides. * * * See: [Themes Reference](/themes-api/) */ theme?: AgChartTheme | AgChartThemeName; } export interface AgPolarChartOptions extends AgBasePolarChartOptions, AgBaseChartOptions { theme?: AgChartTheme | AgChartThemeName; } export interface AgTopologyChartOptions extends AgBaseTopologyChartOptions, AgBaseChartOptions { theme?: AgChartTheme | AgChartThemeName; } export interface AgStandaloneChartOptions extends AgBaseStandaloneChartOptions, AgBaseChartOptions { theme?: AgChartTheme | AgChartThemeName; } export interface AgGaugeChartOptions extends AgBaseChartOptions { theme?: AgChartTheme | AgChartThemeName; } export interface AgHierarchyChartOptions extends AgBaseHierarchyChartOptions, AgBaseChartOptions { theme?: AgChartTheme | AgChartThemeName; } export interface AgFlowProportionChartOptions extends AgBaseFlowProportionChartOptions, AgBaseChartOptions { theme?: AgChartTheme | AgChartThemeName; } export type AgChartOptions = AgCartesianChartOptions | AgPolarChartOptions | AgTopologyChartOptions | AgStandaloneChartOptions; export type AgBaseFinancialPresetOptions = Pick, 'container' | 'width' | 'height' | 'minWidth' | 'minHeight' | 'theme' | 'title' | 'initialState' | 'data' | 'dataIdKey' | 'dataSource' | 'listeners' | 'formatter' | 'enableRtl'>; export type AgBaseSparklinePresetThemeOptions = AgSparklineBaseThemeableOptions & Pick, 'background' | 'container' | 'height' | 'listeners' | 'locale' | 'minHeight' | 'minWidth' | 'padding' | 'width' | 'data'>; export type AgFinancialChartOptions = AgBaseFinancialPresetOptions & AgFinancialChartPresets; export interface AgBaseGaugePresetOptions extends AgBaseGaugePresetThemeOptions { theme?: AgChartTheme | AgChartThemeName; /** The element to place the rendered chart into. */ container?: HTMLElement | null; } export type AgLinearGaugeOptions = AgBaseGaugePresetOptions & AgLinearGaugePreset; export type AgRadialGaugeOptions = AgBaseGaugePresetOptions & AgRadialGaugePreset; export type AgGaugeOptions = AgBaseGaugePresetOptions & AgGaugePresets; export interface AgBaseSparklinePresetOptions extends AgBaseSparklinePresetThemeOptions { theme?: AgChartTheme | AgChartThemeName; } export type AgSparklineOptions = AgBaseSparklinePresetOptions & AgSparklinePresets; export type AgPresetOptions = AgFinancialChartOptions | AgGaugeOptions | AgSparklineOptions; export type AgChartInstanceOptions = AgChartOptions | AgPresetOptions; type DeepPartial = T extends Array ? T : T extends object ? { [K in keyof T]?: DeepPartial; } : T; export interface AgTypedChartInstance> { /** * Update an existing `AgChartInstance`. Options provided should be complete and not * partial. * * @returns a `Promise` that resolves once the requested change has been rendered. * * __Note:__ As each call could trigger a chart redraw, multiple calls in * quick succession could result in undesirable flickering. Callers should batch up and/or * debounce changes to avoid unintended partial update renderings. */ update(options: O): Promise; /** * Update an existing `AgChartInstance` by applying a partial set of option changes. * * @returns a `Promise` that resolves once the requested change has been rendered. * * __Note:__ As each call could trigger a chart redraw, each individual delta options update * should leave the chart in a valid options state. * * Also, multiple calls in quick succession could result in undesirable flickering. Callers * should batch up and/or debounce changes to avoid unintended partial update renderings. */ updateDelta(deltaOptions: DeepPartial): Promise; /** * Apply a transaction to incrementally update the chart data without replacing the entire dataset. * * @returns a `Promise` that resolves once the transaction has been applied and rendered */ applyTransaction(transaction: AgDataTransaction): Promise; /** Get the `AgChartOptions` representing the current chart configuration. */ getOptions(): O; /** @returns a `Promise` that resolves once any pending changes have been rendered. */ waitForUpdate(): Promise; /** * Starts a browser-based image download for the given `AgChartInstance`. * * @returns a `Promise` that resolves once the download has been initiated. */ download(options?: DownloadOptions): Promise; /** Reset animation state; treat the next AgChartInstance.update() as-if the chart is being created from scratch. */ resetAnimations(): void; /** Skip animations on the next redraw. */ skipAnimations(): void; /** Returns a base64-encoded image data URL for the given `AgChartInstance`.*/ getImageDataURL(options?: ImageDataUrlOptions): Promise; /** Returns a representation of the current state of the given `AgChartInstance`. */ getState(): AgChartState; /** Sets the state of the given `AgChartInstance` to the state provided.*/ setState(state: AgChartState): Promise; /** * Retrieve the current selection. * An error may be thrown if the chart state mutates whilst the selection items are being iterated. * * @returns An iterable of all selected items. */ getSelection(): Iterable>; /** * Replaces the current selection. */ setSelection(items: Iterable): void; /** * Clear the entire selection state of all items on all series. */ clearSelection(): void; /** Destroy the chart instance and any allocated resources supporting its rendering. */ destroy(): void; } export interface AgChartInstance = AgChartOptions> extends AgTypedChartInstance { } export interface DownloadOptions extends ImageDataUrlOptions { /** Name of downloaded image file. Defaults to `image`. */ fileName?: string; } export interface ImageDataUrlOptions { /** Width of downloaded chart image in pixels. Defaults to current chart width. */ width?: PixelSize; /** Height of downloaded chart image in pixels. Defaults to current chart height. */ height?: PixelSize; /** A MIME-type string indicating the image format. The default format type is `image/png`. Options: `image/png`, `image/jpeg`. */ fileFormat?: string; } export interface AgChartState extends AgInitialStateOptions { version: string; } export {};