import { ExternalChartDefinition } from '../AdaptableState/ChartingState';
import { BaseContext } from '../types';
/**
 * Options for managing AG Grid's Charts
 */
export interface ChartingOptions {
    /**
     * Behaviour for saving Charts: auto, manual (via popup) or none
     * @defaultValue 'none'
     * @noCodeItem
     */
    saveChartBehaviour?: SaveChartBehaviour;
    /**
     * Locations to display saved Charts
     */
    chartContainers?: ChartContainer[];
    /**
     * Name of AG Grid Chart Container
     * @defaultValue 'AG Grid Window'
     */
    agGridContainerName?: string;
    /**
     * Set of properties for managing behaviour of external (i.e non AG Grid) charts
     */
    externalChartingOptions?: ExternalChartingOptions;
}
/**
 * Describes Location to display an AG Grid Chart
 */
export interface ChartContainer {
    /**
     * Name of Container's Location - used in Dropdowns
     */
    name: string;
    /**
     * Whether 1 or more Charts can be displayed in same location
     * @defaultValue 'single'
     */
    chartsDisplay?: 'single' | 'multiple';
    /**
     * Location - can be HTMLElement or CSS Selector
     */
    element: HTMLElement | string;
}
/**
 * Options for managing External (i.e. non AG Grid) Charts
 */
export interface ExternalChartingOptions {
    /**
     * Called when User clicks on Show button next to Chart
     */
    onShowChart?: (context: ExternalChartingContext) => void;
    /**
     * Called when User clicks on Hide button next to Chart
     */
    onHideChart?: (context: ExternalChartingContext) => void;
    /**
     * Called when User deletes a persisted Chart
     */
    onDeleteChart?: (context: ExternalChartingContext) => void;
    /**
     * Needs to be implemented to specify if Chart is opened; used to set Show Button's highlighting
     */
    isChartOpened?: (context: ExternalChartingContext) => boolean;
    /**
     * Shows Chart in Settings Panel preview (not saved into State); returned definition will be passed to 'onHideChart' when Preview closes
     * @returns transient chart definition that is not saved in state, and sent back when hiding the Chart
     */
    onPreviewChart?: (context: ExternalChartingContext) => ExternalChartDefinition;
}
/**
 * Context passed to External Charting Options functions
 */
export interface ExternalChartingContext<T = unknown> extends BaseContext {
    /**
     * Definition of External Chart
     */
    chartDefinition: ExternalChartDefinition<T>;
    /**
     * Chart's Container
     */
    container?: ChartContainer;
}
/**
 * How Charts are saved
 */
export type SaveChartBehaviour = 'auto' | 'manual' | 'none';
