import { ChartModel, ChartRef } from 'ag-grid-enterprise';
import { ExternalChartDefinition } from '../AdaptableState/ChartingState';
import { ChartContainer, ChartDefinition } from '../types';
import { ChartingOpenState } from './Events/ChartChanged';
/**
 * Provides run-time access to Charting Module and related State
 */
export interface ChartingApi {
    /**
     * Whether AdapTable's Charting functionality is available
     */
    isChartingEnabled(): boolean;
    /**
     * Retrieves current user-generated Charts
     */
    getCurrentChartModels(): ChartModel[];
    /**
     * Retrieves persisted Charts from Adaptable State
     */
    getPersistedCharts(): ChartModel[];
    /**
     * Retrieves all adaptable Chart definitions
     */
    getChartDefinitions(): ChartDefinition[];
    /**
     * Retrieves all adaptable external Chart definitions
     */
    getExternalChartDefinitions(): ExternalChartDefinition[];
    /**
     * Retrieves Chart definition by uuid
     * @param uuid Chart uuid
     */
    getChartDefinitionByUuid(uuid: string): ChartDefinition | undefined;
    /**
     * Retrieves Chart definition by name
     * @param name Chart name
     */
    getChartDefinitionByName(name: string): ChartDefinition | undefined;
    /**
     * Retrieves AG Grid ChartRef for given ChartId
     */
    getChartRef(chartId: string): ChartRef | undefined;
    /**
     * Saves all current Charts into Adaptable State
     */
    saveCurrentCharts(): void;
    /**
     * Displays all persisted Charts
     */
    showPersistedCharts(): ChartRef[];
    /**
     * Opens a Chart Definition
     *
     * @param chartDefinition Chart Definition
     * @param container container element or container name
     */
    showChartDefinition(chartDefinition: ChartDefinition, container?: HTMLElement | string): ChartRef;
    /**
     * Close Chart definition
     * @param chartDefinition Chart Definition
     */
    closeChartDefinition(chartDefinition: ChartDefinition): void;
    /**
     * Displays a Chart; if Chart is already open, 2nd Chart is not opened
     * @param chartDefinition Chart to show
     * @param container Container in which to display the Chart
     */
    showChartDefinitionOnce(chartDefinition: ChartDefinition, container?: HTMLElement): ChartRef;
    /**
     * Edit existing Chart
     * @param chartDefinition Chart to edit
     */
    editChartDefinition(chartDefinition: ChartDefinition): void;
    /**
     * Make a Chart Read-Only
     * @param chartDefinition Chart to make Read-Only
     */
    setChartReadOnly(chartDefinition: ChartDefinition): void;
    /**
     * Make a Chart Editable (i.e. not Read-Only)
     * @param chartDefinition Chart to make Editable
     */
    setChartEditable(chartDefinition: ChartDefinition): void;
    /**
     * Add new Chart
     * @param chartDefinition Chart to add
     */
    addChartDefinition(chartDefinition: ChartDefinition): void;
    /**
     * Get info about all saved charts, incl. their open state
     */
    getChartingOpenState(): ChartingOpenState;
    /**
     * Retrieve name of container in which Chart is open; returns null if Chart is not open
     * @param chartDefinition Chart to add
     */
    getOpenChartContainer(chartDefinition: ChartDefinition): ChartContainer | null;
    /**
     * Add new external chart definition
     *
     * @param chartDef external chart definition
     * @param options
     * @param options.saveChartBehaviour whether to ask the user to provide a name for the chart
     */
    addExternalChartDefinition(chartDef: ExternalChartDefinition, options?: {
        saveChartBehaviour: 'auto' | 'manual';
    }): void;
    /**
     * Edit existing external chart definition
     * @param chartDef external chart definition
     */
    editExternalChartDefinition(chartDef: ExternalChartDefinition): void;
    /**
     * Delete external chart definition
     * @param chartDefinition chart definition
     */
    deleteExternalChartDefinition(chartDefinition: ExternalChartDefinition): void;
    /**
     * Retrieves Chart definition by name
     * @param name Chart name
     */
    getExternalChartDefinitionByName(name: string): ExternalChartDefinition | undefined;
}
