import { BaseState } from './BaseState';
import { Schedule } from './Common/Schedule';
import { ColumnScope } from './Common/ColumnScope';
import { AdaptableColumnBase } from './Common/AdaptableColumn';
import { AdaptableObject } from './Common/AdaptableObject';
import { AdaptableBooleanQuery } from './Common/AdaptableQuery';
import { TypeHint } from './Common/Types';
import { ExportDestinationType } from '../AdaptableOptions/ExportOptions';
import { SuspendableObject } from './Common/SuspendableObject';
/**
 * Adaptable State Section for Export Module with Schedules
 */
export interface ExportState extends BaseState {
    /**
     * Selected Report Type - in Export Toolbar & Tool Panel
     */
    CurrentReport?: ReportNameType;
    /**
     * Selected Report Format  - in Export Toolbar & Tool Panel
     */
    CurrentFormat?: ReportFormatType;
    /**
     * User-created Reports; each has Name and Row and Column Scope
     */
    Reports?: Report[];
    /**
     * Scheduled Exports for System and Custom Reports
     */
    ReportSchedules?: ReportSchedule[];
}
/**
 * A Report which can export data from AdapTable
 */
export interface Report extends AdaptableObject {
    /**
     * Name of the Report as displayed in the Export toolbar and tool panel
     */
    Name: ReportNameType;
    /**
     * Columns to display: `AllColumns`, `VisibleColumns`, `SelectedColumns`, `ScopeColumns`
     */
    ReportColumnScope: ReportColumnScope;
    /**
     * Rows to export: `AllRows`, `VisibleRows`,  `SelectedRows`, `ExpressionRows`
     */
    ReportRowScope: ReportRowScope;
    /**
     * Columns Scope; only required if `ReportColumnScope` is 'ScopeColumns'
     */
    Scope?: ColumnScope;
    /**
     * Query to use; only required if `ReportRowScope` is 'ExpressionRows'
     */
    Query?: AdaptableBooleanQuery;
}
/**
 * A timed export for a report — when to run, format and destination
 */
export interface ReportSchedule extends SuspendableObject {
    /**
     * Unique display name for this scheduled report
     */
    Name: string;
    /**
     * Name of Report to export
     */
    ReportName: ReportNameType;
    /**
     * Format of Report to run on Schedule
     */
    ReportFormat: ReportFormatType;
    /**
     * Destination of Report to run on Schedule
     */
    ExportDestination?: ExportDestinationType;
    /**
     * When the export should run
     */
    Schedule: Schedule;
}
/**
 * A Column exported in a Report
 */
export interface ReportColumn extends AdaptableColumnBase {
    /**
     * Field in the row to get cell data from; defaults to `columnId`
     */
    field?: string;
}
/**
 * Defines the data in a Report run by AdapTable
 */
export interface ReportData {
    /**
     * Row Data in the Report
     */
    rows: Record<string, any>[];
    /**
     * Columns in the Report
     */
    columns: ReportColumn[];
    /**
     * Group columns IDs in the Report
     */
    groupColumnIds?: string[];
    /**
     * Pivot columns IDs in the Report
     */
    pivotColumnIds?: string[];
}
/**
 * System report names provided by AdapTable
 */
export type SystemReportName = 
/**
 * Report includes all data, exporting all rows and columns, regardless of filtering/sorting etc.
 */
'All Data'
/**
 * Report includes current Layout, exporting only currently visible columns and rows with the current sorting/filtering applied.
 */
 | 'Current Layout'
/**
 * Report includes only selected data
 */
 | 'Selected Data';
/**
 * System report formats provided by AdapTable
 */
export type SystemReportFormat = 
/**
 * Export report in Excel(XLSX) format
 */
'Excel'
/**
 * Export report in standard Excel/XLSX format, including all the AdapTable Styles and Formats (ConditionalStyles, ColumnFormats, etc.)
 */
 | 'VisualExcel'
/**
 * Export report in CSV format
 */
 | 'CSV'
/**
 * Export report in JSON format
 */
 | 'JSON';
/**
 * Columns to be included in a Report
 */
export type ReportColumnScope = 'AllColumns' | 'VisibleColumns' | 'ScopeColumns' | 'SelectedColumns';
/**
 * AG Grid Row Data to be included in a Report
 */
export type ReportRowScope = 'AllRows' | 'VisibleRows' | 'ExpressionRows' | 'SelectedRows';
/**
 * Array containing all System Report names
 */
export type SystemReportNames = SystemReportName[];
/**
 * Type of Report Name
 */
export type ReportNameType = TypeHint<string, SystemReportName>;
/**
 * Type of Report Format
 */
export type ReportFormatType = TypeHint<string, SystemReportFormat>;
