import { type ViewStatistics } from './analytics';
import { type DateZoom } from './api/paginatedQuery';
import { type ConditionalFormattingConfig } from './conditionalFormatting';
import { type ChartSourceType } from './content';
import { type CompactOrAlias, type FieldId } from './field';
import { type KnexPaginatedData } from './knex-paginate';
import { type MetricQuery, type MetricQueryRequest } from './metricQuery';
import { type ParametersValuesMap } from './parameters';
import type { SchedulerAndTargets } from './scheduler';
import { type SpaceShare } from './space';
import { type LightdashUser, type UpdatedByUser } from './user';
import { type ValidationSummary } from './validation';
export declare enum ChartKind {
    LINE = "line",
    HORIZONTAL_BAR = "horizontal_bar",
    VERTICAL_BAR = "vertical_bar",
    SCATTER = "scatter",
    AREA = "area",
    MIXED = "mixed",
    PIE = "pie",
    TABLE = "table",
    BIG_NUMBER = "big_number",
    FUNNEL = "funnel",
    CUSTOM = "custom",
    TREEMAP = "treemap",
    GAUGE = "gauge",
    MAP = "map"
}
export declare enum ChartType {
    CARTESIAN = "cartesian",
    TABLE = "table",
    BIG_NUMBER = "big_number",
    PIE = "pie",
    FUNNEL = "funnel",
    TREEMAP = "treemap",
    GAUGE = "gauge",
    CUSTOM = "custom",
    MAP = "map"
}
export declare enum ComparisonFormatTypes {
    RAW = "raw",
    PERCENTAGE = "percentage"
}
export declare enum ComparisonDiffTypes {
    POSITIVE = "positive",
    NEGATIVE = "negative",
    NONE = "none",
    NAN = "NaN",
    UNDEFINED = "undefined"
}
export type BigNumber = {
    label?: string;
    style?: CompactOrAlias;
    selectedField?: string;
    showBigNumberLabel?: boolean;
    showTableNamesInLabel?: boolean;
    showComparison?: boolean;
    comparisonFormat?: ComparisonFormatTypes;
    flipColors?: boolean;
    comparisonLabel?: string;
};
export declare const PieChartValueLabels: {
    readonly hidden: "Hidden";
    readonly inside: "Inside";
    readonly outside: "Outside";
};
export type PieChartValueLabel = keyof typeof PieChartValueLabels;
export type PieChartValueOptions = {
    valueLabel: PieChartValueLabel;
    showValue: boolean;
    showPercentage: boolean;
};
export declare const PieChartLegendPositions: {
    readonly horizontal: "Horizontal";
    readonly vertical: "Vertical";
};
export type PieChartLegendPosition = keyof typeof PieChartLegendPositions;
export declare const PieChartLegendPositionDefault: PieChartLegendPosition;
export declare const PieChartLegendLabelMaxLengthDefault = 30;
export declare const PieChartTooltipLabelMaxLength = 40;
export type SeriesMetadata = {
    color: string;
};
export type PieChart = {
    groupFieldIds?: string[];
    metricId?: string;
    isDonut?: boolean;
    valueLabel?: PieChartValueOptions['valueLabel'];
    showValue?: PieChartValueOptions['showValue'];
    showPercentage?: PieChartValueOptions['showPercentage'];
    groupLabelOverrides?: Record<string, string>;
    groupColorOverrides?: Record<string, string>;
    groupValueOptionOverrides?: Record<string, Partial<PieChartValueOptions>>;
    groupSortOverrides?: string[];
    showLegend?: boolean;
    legendPosition?: PieChartLegendPosition;
    legendMaxItemLength?: number;
    metadata?: Record<string, SeriesMetadata>;
};
export type TreemapChart = {
    visibleMin?: number;
    leafDepth?: number;
    groupFieldIds?: string[];
    sizeMetricId?: string;
    colorMetricId?: string;
    startColor?: string;
    endColor?: string;
    useDynamicColors?: boolean;
    startColorThreshold?: number;
    endColorThreshold?: number;
};
export type GaugeSection = {
    min: number;
    max: number;
    minFieldId?: string;
    maxFieldId?: string;
    color: string;
};
export type GaugeChart = {
    selectedField?: string;
    min?: number;
    max?: number;
    maxFieldId?: string;
    showAxisLabels?: boolean;
    sections?: GaugeSection[];
    customLabel?: string;
    showPercentage?: boolean;
    customPercentageLabel?: string;
};
export declare enum MapChartLocation {
    USA = "USA",
    WORLD = "world",
    EUROPE = "europe",
    CUSTOM = "custom"
}
export declare enum MapChartType {
    SCATTER = "scatter",
    AREA = "area",
    HEATMAP = "heatmap"
}
export declare enum MapTileBackground {
    NONE = "none",
    OPENSTREETMAP = "openstreetmap",
    LIGHT = "light",
    DARK = "dark",
    SATELLITE = "satellite"
}
export type MapFieldConfig = {
    visible?: boolean;
    label?: string;
};
export type MapChart = {
    mapType?: MapChartLocation;
    customGeoJsonUrl?: string;
    locationType?: MapChartType;
    latitudeFieldId?: string;
    longitudeFieldId?: string;
    locationFieldId?: string;
    geoJsonPropertyKey?: string;
    valueFieldId?: string;
    showLegend?: boolean;
    colorRange?: string[];
    defaultZoom?: number;
    defaultCenterLat?: number;
    defaultCenterLon?: number;
    minBubbleSize?: number;
    maxBubbleSize?: number;
    sizeFieldId?: string;
    heatmapConfig?: {
        radius?: number;
        blur?: number;
        opacity?: number;
    };
    tileBackground?: MapTileBackground;
    backgroundColor?: string;
    noDataColor?: string;
    fieldConfig?: Record<string, MapFieldConfig>;
    saveMapExtent?: boolean;
};
export declare enum FunnelChartDataInput {
    ROW = "row",
    COLUMN = "column"
}
export declare enum FunnelChartLabelPosition {
    INSIDE = "inside",
    LEFT = "left",
    RIGHT = "right",
    HIDDEN = "hidden"
}
export declare enum FunnelChartLegendPosition {
    HORIZONTAL = "horizontal",
    VERTICAL = "vertical"
}
export type FunnelChart = {
    dataInput?: FunnelChartDataInput;
    fieldId?: string;
    metadata?: Record<string, SeriesMetadata>;
    labelOverrides?: Record<string, string>;
    colorOverrides?: Record<string, string>;
    labels?: {
        position?: FunnelChartLabelPosition;
        showValue?: boolean;
        showPercentage?: boolean;
    };
    showLegend?: boolean;
    legendPosition?: FunnelChartLegendPosition;
};
export type ColumnProperties = {
    visible?: boolean;
    name?: string;
    frozen?: boolean;
    displayStyle?: 'text' | 'bar';
    color?: string;
};
export type TableChart = {
    showColumnCalculation?: boolean;
    showRowCalculation?: boolean;
    showTableNames?: boolean;
    hideRowNumbers?: boolean;
    showResultsTotal?: boolean;
    showSubtotals?: boolean;
    columns?: Record<string, ColumnProperties>;
    conditionalFormattings?: ConditionalFormattingConfig[];
    metricsAsRows?: boolean;
};
export declare enum CartesianSeriesType {
    LINE = "line",
    BAR = "bar",
    SCATTER = "scatter",
    AREA = "area"
}
export type PivotValue = {
    field: string;
    value: unknown;
};
export type PivotReference = {
    field: string;
    pivotValues?: PivotValue[];
};
export declare const isPivotReferenceWithValues: (value: PivotReference) => value is Required<PivotReference>;
export type MarkLineData = {
    yAxis?: string;
    xAxis?: string;
    name?: string;
    value?: string;
    type?: string;
    uuid: string;
    lineStyle?: {
        color: string;
    };
    label?: {
        formatter?: string;
        position?: 'start' | 'middle' | 'end';
    };
    dynamicValue?: 'average';
};
export type MarkLine = {
    data: MarkLineData[];
    symbol?: string;
    lineStyle?: {
        color: string;
        width: number;
        type: string;
    };
    label?: {
        formatter?: string;
    };
};
export type Series = {
    encode: {
        xRef: PivotReference;
        yRef: PivotReference;
        x?: string;
        y?: string;
    };
    type: CartesianSeriesType;
    stack?: string;
    stackLabel?: {
        show?: boolean;
    };
    name?: string;
    color?: string;
    yAxisIndex?: number;
    label?: {
        show?: boolean;
        position?: 'left' | 'top' | 'right' | 'bottom' | 'inside';
        showOverlappingLabels?: boolean;
    };
    hidden?: boolean;
    areaStyle?: Record<string, unknown>;
    showSymbol?: boolean;
    smooth?: boolean;
    markLine?: MarkLine;
    isFilteredOut?: boolean;
};
export type EchartsLegend = {
    show?: boolean;
    type?: 'plain' | 'scroll';
    orient?: 'horizontal' | 'vertical';
    top?: string;
    right?: string;
    bottom?: string;
    left?: string;
    width?: string;
    height?: string;
    align?: 'auto' | 'left' | 'right';
    icon?: 'circle' | 'rect' | 'roundRect' | 'triangle' | 'diamond' | 'pin' | 'arrow' | 'none';
};
export type EchartsGrid = {
    containLabel?: boolean;
    top?: string;
    right?: string;
    bottom?: string;
    left?: string;
    width?: string;
    height?: string;
};
export declare const TooltipSortByOptions: {
    readonly DEFAULT: "default";
    readonly ALPHABETICAL: "alphabetical";
    readonly VALUE_ASCENDING: "value_ascending";
    readonly VALUE_DESCENDING: "value_descending";
};
export type TooltipSortBy = (typeof TooltipSortByOptions)[keyof typeof TooltipSortByOptions];
export type CompleteEChartsConfig = {
    legend?: EchartsLegend;
    grid?: EchartsGrid;
    series: Series[];
    xAxis: XAxis[];
    yAxis: Axis[];
    tooltip?: string;
    tooltipSort?: TooltipSortBy;
    showAxisTicks?: boolean;
    axisLabelFontSize?: number;
    axisTitleFontSize?: number;
};
export type EChartsConfig = Partial<CompleteEChartsConfig>;
type Axis = {
    name?: string;
    min?: string | undefined;
    max?: string | undefined;
    minOffset?: string | undefined;
    maxOffset?: string | undefined;
    inverse?: boolean;
    rotate?: number;
};
export type XAxis = Axis & {
    sortType?: XAxisSortType;
    enableDataZoom?: boolean;
};
export declare enum XAxisSortType {
    DEFAULT = "default",
    CATEGORY = "category",
    BAR_TOTALS = "bar_totals"
}
export declare enum XAxisSort {
    DEFAULT = "default",
    DEFAULT_REVERSED = "default_reversed",
    ASCENDING = "ascending",
    DESCENDING = "descending",
    BAR_TOTALS_ASCENDING = "bar_totals_ascending",
    BAR_TOTALS_DESCENDING = "bar_totals_descending"
}
export declare function getXAxisSort(xAxis: Pick<XAxis, 'sortType' | 'inverse'> | undefined): XAxisSort;
export type CompleteCartesianChartLayout = {
    xField: string;
    yField: string[];
    flipAxes?: boolean | undefined;
    showGridX?: boolean | undefined;
    showGridY?: boolean | undefined;
    showXAxis?: boolean | undefined;
    showYAxis?: boolean | undefined;
    stack?: boolean | string | undefined;
};
export type CartesianChartLayout = Partial<CompleteCartesianChartLayout>;
export type CustomVis = {
    spec?: Record<string, unknown>;
};
export type CartesianChart = {
    layout: CartesianChartLayout;
    eChartsConfig: EChartsConfig;
    metadata?: Record<string, SeriesMetadata>;
};
export type BigNumberConfig = {
    type: ChartType.BIG_NUMBER;
    config?: BigNumber;
};
export type CartesianChartConfig = {
    type: ChartType.CARTESIAN;
    config?: CartesianChart;
};
export type CustomVisConfig = {
    type: ChartType.CUSTOM;
    config?: CustomVis;
};
export type PieChartConfig = {
    type: ChartType.PIE;
    config?: PieChart;
};
export type FunnelChartConfig = {
    type: ChartType.FUNNEL;
    config?: FunnelChart;
};
export type TableChartConfig = {
    type: ChartType.TABLE;
    config?: TableChart;
};
export type TreemapChartConfig = {
    type: ChartType.TREEMAP;
    config?: TreemapChart;
};
export type GaugeChartConfig = {
    type: ChartType.GAUGE;
    config?: GaugeChart;
};
export type MapChartConfig = {
    type: ChartType.MAP;
    config?: MapChart;
};
export type ChartConfig = BigNumberConfig | CartesianChartConfig | CustomVisConfig | PieChartConfig | FunnelChartConfig | TableChartConfig | TreemapChartConfig | GaugeChartConfig | MapChartConfig;
export type SavedChartType = ChartType;
export type SavedChartDAO = Omit<SavedChart, 'isPrivate' | 'access'>;
export type SavedChart = {
    uuid: string;
    projectUuid: string;
    name: string;
    description?: string;
    tableName: string;
    metricQuery: MetricQuery;
    pivotConfig?: {
        columns: string[];
    };
    chartConfig: ChartConfig;
    tableConfig: {
        columnOrder: string[];
    };
    parameters?: ParametersValuesMap;
    updatedAt: Date;
    updatedByUser?: UpdatedByUser;
    organizationUuid: string;
    spaceUuid: string;
    spaceName: string;
    pinnedListUuid: string | null;
    pinnedListOrder: number | null;
    dashboardUuid: string | null;
    dashboardName: string | null;
    colorPalette: string[];
    isPrivate: boolean;
    access: SpaceShare[];
    slug: string;
};
type CreateChartBase = Pick<SavedChart, 'name' | 'description' | 'tableName' | 'metricQuery' | 'pivotConfig' | 'chartConfig' | 'tableConfig' | 'parameters'>;
export type CreateChartInSpace = CreateChartBase & {
    spaceUuid?: string;
    dashboardUuid?: null;
};
export type CreateChartInDashboard = CreateChartBase & {
    dashboardUuid: string;
    spaceUuid?: null;
};
export type CreateSavedChart = CreateChartInSpace | CreateChartInDashboard;
export type CreateSavedChartVersion = Omit<SavedChart, 'uuid' | 'name' | 'updatedAt' | 'projectUuid' | 'organizationUuid' | 'spaceUuid' | 'spaceName' | 'pinnedListUuid' | 'pinnedListOrder' | 'views' | 'firstViewedAt' | 'dashboardUuid' | 'dashboardName' | 'colorPalette' | 'isPrivate' | 'access' | 'slug'> & Partial<Pick<SavedChart, 'dashboardUuid' | 'dashboardName'>>;
export type UpdateSavedChart = Partial<Pick<SavedChart, 'name' | 'description' | 'spaceUuid'>>;
export type UpdateMultipleSavedChart = Pick<SavedChart, 'uuid' | 'name' | 'description' | 'spaceUuid'>;
export declare const isCompleteLayout: (value: CartesianChartLayout | undefined) => value is CompleteCartesianChartLayout;
export declare const isCompleteEchartsConfig: (value: EChartsConfig | undefined) => value is CompleteEChartsConfig;
export declare const isCartesianChartConfig: (value: ChartConfig["config"]) => value is CartesianChart;
export declare const isBigNumberConfig: (value: ChartConfig["config"]) => value is BigNumber;
export declare const isTableChartConfig: (value: ChartConfig["config"]) => value is TableChart;
export declare const isPieChartConfig: (value: ChartConfig["config"]) => value is PieChart;
export declare const getCustomLabelsFromColumnProperties: (columns: Record<string, ColumnProperties> | undefined) => Record<string, string> | undefined;
export declare const getCustomLabelsFromTableConfig: (config: ChartConfig["config"] | undefined) => Record<string, string> | undefined;
export declare const hashFieldReference: (reference: PivotReference) => string;
export declare const getSeriesId: (series: Series) => string;
export declare const ECHARTS_DEFAULT_COLORS: string[];
export declare const getDefaultSeriesColor: (index: number) => string;
export declare const isSeriesWithMixedChartTypes: (series: Series[] | undefined) => boolean;
export declare const getChartType: (chartKind: ChartKind | undefined) => ChartType;
export declare const getChartKind: (chartType: ChartType, value: ChartConfig["config"]) => ChartKind | undefined;
export declare const getEChartsChartTypeFromChartKind: (chartKind: ChartKind) => CartesianSeriesType;
export type ChartSummary = Pick<SavedChart, 'uuid' | 'name' | 'description' | 'spaceName' | 'spaceUuid' | 'projectUuid' | 'organizationUuid' | 'pinnedListUuid' | 'dashboardUuid' | 'dashboardName' | 'slug'> & {
    chartType?: ChartType | undefined;
    chartKind?: ChartKind | undefined;
    source?: ChartSourceType;
};
export type SpaceQuery = ChartSummary & Pick<SavedChart, 'updatedAt' | 'updatedByUser' | 'pinnedListOrder'> & ViewStatistics & {
    validationErrors?: ValidationSummary[];
};
export type ApiChartSummaryListResponse = {
    status: 'ok';
    results: ChartSummary[];
};
export type ApiChartListResponse = {
    status: 'ok';
    results: SpaceQuery[];
};
export type ChartHistory = {
    history: ChartVersionSummary[];
};
export type ChartVersion = {
    chartUuid: string;
    versionUuid: string;
    createdAt: Date;
    createdBy: Pick<LightdashUser, 'userUuid' | 'firstName' | 'lastName'> | null;
    chart: SavedChart;
};
export type ChartVersionSummary = Pick<ChartVersion, 'chartUuid' | 'versionUuid' | 'createdAt' | 'createdBy'>;
export type ApiGetChartHistoryResponse = {
    status: 'ok';
    results: ChartHistory;
};
export type ApiGetChartVersionResponse = {
    status: 'ok';
    results: ChartVersion;
};
export declare const getHiddenTableFields: (config: ChartConfig) => string[];
export type CalculateTotalFromQuery = {
    metricQuery: MetricQueryRequest;
    explore: string;
    parameters?: ParametersValuesMap;
};
export type ApiCalculateTotalResponse = {
    status: 'ok';
    results: Record<string, number>;
};
export type CalculateSubtotalsFromQuery = CalculateTotalFromQuery & {
    columnOrder: string[];
    pivotDimensions?: string[];
    parameters?: ParametersValuesMap;
    dateZoom?: DateZoom;
};
export type ApiCalculateSubtotalsResponse = {
    status: 'ok';
    results: {
        [subtotalDimensions: string]: {
            [key: string]: number;
        }[];
    };
};
export type ReplaceableFieldMatchMap = {
    [fieldId: string]: {
        fieldId: string;
        label: string;
        match: {
            fieldId: FieldId;
            fieldLabel: string;
        } | null;
        suggestedMatches: Array<{
            fieldId: FieldId;
            fieldLabel: string;
        }>;
    };
};
export type ReplaceableCustomFields = {
    [chartUuid: string]: {
        uuid: string;
        label: string;
        customMetrics: ReplaceableFieldMatchMap;
    };
};
export type ReplaceCustomFields = {
    [chartUuid: string]: {
        customMetrics: {
            [customMetricId: string]: {
                replaceWithFieldId: string;
            };
        };
    };
};
export type SkippedReplaceCustomFields = {
    [chartUuid: string]: {
        customMetrics: {
            [customMetricId: string]: {
                replaceWithFieldId: string;
                reason: string;
            };
        };
    };
};
export type ApiSavedChartSchedulersResponse = {
    status: 'ok';
    results: SchedulerAndTargets[];
};
export type ApiSavedChartPaginatedSchedulersResponse = {
    status: 'ok';
    results: KnexPaginatedData<SchedulerAndTargets[]>;
};
export type ApiCreateSavedChartSchedulerResponse = {
    status: 'ok';
    results: SchedulerAndTargets;
};
export {};
//# sourceMappingURL=savedCharts.d.ts.map