import { AdaptableIcon } from '../PredefinedConfig/Common/AdaptableIcon';
import { DateInputOptions } from './DateInputOptions';
import { ColumnScope } from '../PredefinedConfig/Common/ColumnScope';
import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
import { AdaptableObjectTag } from '../PredefinedConfig/Common/AdaptableObject';
import { AdaptableStyle } from '../PredefinedConfig/Common/AdaptableStyle';
import { AlternativeModuleName, BaseContext, GridCell } from '../../types';
/**
 * Options for managing the User Interface of AdapTable
 */
export interface UserInterfaceOptions<TData = any> {
    /**
     * Show Mac-like scrollbars; size is configurable via CSS variable `--ab-custom-scrollbar-size` (default: `10px`)
     *
     * @defaultValue false
     * @gridInfoItem
     */
    useCustomMacLikeScrollbars?: boolean;
    /**
     * The application icon to appear in Dashboard and elsewhere (e.g. in Notifications)
     *
     * @defaultValue null
     */
    applicationIcon?: AdaptableIcon;
    /**
     * Bespoke icons that can be used in AdapTable (e.g. Badge Styles and Buttons)
     */
    customIcons?: CustomIcon[];
    /**
     * Options for managing and customizing date inputs in AdapTable
     */
    dateInputOptions?: DateInputOptions;
    /**
     * List of Column values to display (e.g. in Filter, Custom Sort etc.)
     */
    permittedValues?: PermittedValues<TData>[];
    /**
     * Dropdown values displayed when column is being edited
     */
    editLookUpItems?: EditLookUpPermittedValues<TData>[];
    /**
     * Custom column values for Values Column Filter and Grid Filter Builder
     */
    filterPermittedValues?: FilterPermittedValues<TData>[];
    /**
     * Custom column values for defining Custom Sort
     */
    customSortPermittedValues?: CustomSortPermittedValues<TData>[];
    /**
     * Custom column values for editing via bulk-update
     */
    bulkUpdatePermittedValues?: BulkUpdatePermittedValues<TData>[];
    /**
     * Colours to display in Colour Picker (in place of AdapTable's default set); can be hardcoded list or function
     */
    colorPalette?: string[] | ((currentTheme: string) => string[]);
    /**
     * Style to set for editable Cells
     */
    editableCellStyle?: AdaptableStyle;
    /**
     * Style to set for non-editable Cells
     */
    readOnlyCellStyle?: AdaptableStyle;
    /**
      * Style to set for Cells which have been edited
      */
    editedCellStyle?: AdaptableStyle;
    /**
     * Optional list of CSS styles that can be used when creating Adaptable Styles in Adaptable (e.g. in Format Column and other Modules)
     *
     * @gridInfoItem
     */
    styleClassNames?: string[];
    /**
     * Optional list of AdaptableObjectTags that can be associated with AdaptableObjects
     */
    objectTags?: AdaptableObjectTag[] | ((context: ObjectTagsContext) => AdaptableObjectTag[]);
    /**
     * Provide links to AdapTable documentation (in Module popups and Expression Editor)
     *
     * @defaultValue true
     * @gridInfoItem
     */
    showDocumentationLinks?: boolean;
    /**
     * Displays the AdapTable version in Grid Info section of Settings Panel
     *
     * @defaultValue true
     * @gridInfoItem
     */
    showAdapTableVersion?: boolean;
    /**
     * English variant to use in AdapTable UI
     *
     * @defaultValue 'GB'
     * @gridInfoItem
     */
    englishVariant?: 'GB' | 'US';
    /**
     * Hides confirmation dialog which displays whenever an AdaptableObject is deleted
     * @defaultValue false
     * @noCodeItem
     */
    disableDeleteConfirmation?: boolean;
    /**
     * Alternative names to use for Adaptable Modules in the UI
     *
     * @defaultValue null
     */
    alternativeModuleNames?: AlternativeModuleName[];
    /**
     * Display Loading message when AdapTable starts
     * @defaultValue true
     * @noCodeItem
     */
    showLoadingScreen?: boolean;
    /**
     * Delay in milliseconds before Loading Screen appears. `showLoadingScreen` must be true for this to take effect
     *
     * @defaultValue 200
     */
    loadingScreenDelay?: number;
    /**
     * Title to display in Loading Screen.
     * @defaultValue 'Initialising Grid'
     */
    loadingScreenTitle?: string;
    /**
     * Text to display in Loading Screen.
     *
     * @defaultValue 'Retrieving your settings and setting up the grid...'
     */
    loadingScreenText?: string;
}
/**
 * Base class for all Permitted Values related objects
 */
export interface BasePermittedValues {
    /**
     * Scope where Values will appear (Mandatory property)
     */
    scope: ColumnScope;
}
/**
 * Permitted/possible values, when column values can be selected (e.g. sort, bulk-update)
 */
export interface PermittedValues<TData = any> extends BasePermittedValues {
    /**
     * Values to display: either hardcoded list or a function that returns a list
     */
    values?: any[] | ((context: PermittedValuesContext<TData>) => any[]);
}
/**
 * Used to define permitted values for inline column editor
 */
export interface EditLookUpPermittedValues<TData = any> extends BasePermittedValues {
    /**
     * Values to display in Edit Look Up: either hardcoded list or a function that returns a list
     */
    values?: any[] | ((context: EditLookUpContext<TData>) => any[]);
}
/**
 * Used to define values inside the Filter Bar and Filter Form
 */
export interface FilterPermittedValues<TData = any> extends BasePermittedValues {
    /**
     * Prevents AdapTable from filtering the list of values client-side; When true, values is called each time the search bar is changed
     * @defaultValue false
     */
    suppressFilterSearchBar?: boolean;
    /**
     * Function returning Values to display in 'IN' Filter - can be async
     */
    values: (context: FilterPermittedValuesContext<TData>) => any[] | Promise<any[]>;
}
/**
 * Custom column values for Custom Sort
 */
export interface CustomSortPermittedValues<TData = any> extends BasePermittedValues {
    /**
     * Function returning Values to display in Custom Sort Wizard - can be async
     */
    values: (context: PermittedValuesContext<TData>) => any[] | Promise<any[]>;
}
/**
 * User to define permitted values when updating cells via bulk update
 */
export interface BulkUpdatePermittedValues<TData = any> extends BasePermittedValues {
    /**
     * Function returning Values to display in Bulk Update Wizard - can be async
     */
    values: (context: BulkUpdatePermittedValuesContext<TData>) => any[] | Promise<any[]>;
}
/**
 * Context used when getting PermittedValues via a function
 */
export interface PermittedValuesContext<TData = any> extends BaseContext {
    /**
     * Column whose values are being displayed
     */
    column: AdaptableColumn<TData>;
}
/**
 * Context used when getting EditLookUpPermittedValues via a function
 */
export interface EditLookUpContext<TData = any> extends PermittedValuesContext {
    /**
     * Cell being edited
     */
    gridCell?: GridCell<TData>;
}
/**
 * Context used when getting FilterPermittedValues via a function
 */
export interface FilterPermittedValuesContext<TData = any> extends PermittedValuesContext<TData> {
    /**
     * A search string
     */
    searchFilter: string;
}
/**
 * Context used when getting BulkUpdatePermittedValues via a function
 */
export interface BulkUpdatePermittedValuesContext<TData = any> extends PermittedValuesContext<TData> {
    /**
     * Cells which will be modified in the Bulk Update
     */
    gridCells: GridCell<TData>[];
}
/**
 * Context used when evaluating Object Tags
 */
export interface ObjectTagsContext extends BaseContext {
}
/**
 * Defines a bespoke Icon provided by a developer
 */
export interface CustomIcon {
    /**
     * Name of Icon
     */
    name: string;
    /**
     * AdapTable Icon definition
     */
    icon: AdaptableIcon;
}
