import { AXIS_TYPES, CHART_RENDER_TYPES, CHART_LINE_TYPES, KPIDetails } from '@c8y/ngx-components/datapoint-selector';
import { Severity, AlarmStatusType, IMeasurement, aggregationType, ISeries } from '@c8y/client';
import { LineSeriesOption, ScatterSeriesOption, BarSeriesOption } from 'echarts';
import { AlarmDetails, EventDetails } from '@c8y/ngx-components/alarm-event-selector';
import { TooltipFormatterCallback, ECBasicOption } from 'echarts/types/src/util/types';
import { TopLevelFormatterParams } from 'echarts/types/src/component/tooltip/TooltipModel';
import { DateTimeContext, TimeInterval, RefreshOption, GlobalContextDisplayMode } from '@c8y/ngx-components/global-context';
import { WidgetDisplaySettings } from '@c8y/ngx-components';

type DatapointsGraphKPIDetails = KPIDetails & {
    lineType?: DatapointLineType;
    renderType?: DatapointChartRenderType;
};
type DatapointsGraphWidgetConfig = {
    eventSourceId?: string | null;
    activeAlarmTypesOutOfRange?: string[];
    aggregatedDatapoint?: DatapointsGraphKPIDetails | null;
    alarmsEventsConfigs?: AlarmOrEventExtended[];
    datapoints?: DatapointsGraphKPIDetails[] | null;
    dataPointLegendDisplay?: string | null;
    date?: DateTimeContext;
    dateFrom?: Date | string | null;
    dateTo?: Date | string | null;
    displayAggregationSelection?: boolean | null;
    displayDateSelection?: boolean | null;
    displayMarkedLine?: boolean;
    displayMarkedPoint?: boolean;
    displaySettings?: WidgetDisplaySettings;
    isGlobalContextReady?: boolean;
    mergeMatchingDatapoints?: boolean;
    forceMergeDatapoints?: boolean;
    setYaxisStartToZero?: boolean;
    smoothLines?: boolean;
    realtime?: boolean | null;
    showLabelAndUnit?: boolean;
    showSlider?: boolean | null;
    source?: string | null;
    sliderChange?: boolean | null;
    xAxisSplitLines?: boolean | null;
    yAxisSplitLines?: boolean | null;
    interval?: TimeInterval;
    dateTimeContext?: DateTimeContext;
    aggregation?: aggregationType | null;
    refreshOption?: RefreshOption;
    isAutoRefreshEnabled?: boolean;
    isRealtimeEnabled?: boolean;
    displayMode?: GlobalContextDisplayMode;
    refreshInterval?: number;
    numberOfDecimalPlaces?: number;
    showAdvancedChartOptions?: boolean;
    retrievalError?: object;
};
type GraphDisplayOptions = {
    displayMarkedLine: boolean;
    displayMarkedPoint: boolean;
    mergeMatchingDatapoints: boolean;
    forceMergeDatapoints: boolean;
    setYaxisStartToZero: boolean;
    showLabelAndUnit: boolean;
    showSlider: boolean;
    showOnlyAlarmsOrEvents?: boolean;
    numberOfDecimalPlaces?: number;
    sliderPositionMode?: 'compact' | 'default';
    axisColor?: string;
};
type AlarmDetailsExtended = AlarmDetails & {
    __hidden?: boolean;
    __severity?: SeverityType[];
    __status?: AlarmStatusType[];
};
type EventDetailsExtended = EventDetails & {
    __hidden?: boolean;
};
/**
 * @description: Extended AlarmOrEvent type which includes properties from the incoming alarms/events. This interface can be used when the expected data can be either events or alarms.
 */
type AlarmOrEventExtended = AlarmDetailsExtended | EventDetailsExtended;
type DatapointsGraphWidgetTimeProps = Partial<Pick<DatapointsGraphWidgetConfig, 'interval' | 'dateFrom' | 'dateTo' | 'aggregation' | 'realtime'>>;
declare enum DATE_SELECTION_EXTENDED {
    CONFIG = "config",
    DASHBOARD_CONTEXT = "dashboard_context"
}
type DatapointApiValues = ISeries['values'];
interface DpWithValues extends DatapointsGraphKPIDetails {
    values: DatapointApiValues;
}
type DataPointValues = {
    min: number;
    max: number;
};
type DpValuesItem = {
    time: number;
    values: DataPointValues[];
};
interface LegendDisplayOptionItem {
    value: string;
    label: string;
}
declare const LEGEND_DISPLAY_OPTIONS: LegendDisplayOptionItem[];
interface MarkPointData {
    coord: [string, number | DataPointValues | null];
    name: string;
    itemType: string;
    itemStyle: {
        color: string;
    };
    symbol?: string;
    symbolSize?: number;
}
interface MarkLineData {
    xAxis: string | undefined;
    itemType: string;
    label: {
        show: boolean;
        formatter: TooltipFormatterCallback<TopLevelFormatterParams> | string;
    };
    itemStyle: {
        color: string;
    };
}
interface TimeContextProps {
    temporaryUserSelectedFromDate?: string;
    temporaryUserSelectedToDate?: string;
    currentDateContextFromDate?: string;
    currentDateContextToDate?: string;
    realtime?: boolean;
    currentDateContextInterval?: 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'custom';
    aggregation?: aggregationType | null;
}
type DatapointLineType = (typeof CHART_LINE_TYPES)[number]['val'];
type EchartsSeriesOptions = LineSeriesOption | ScatterSeriesOption | BarSeriesOption;
type DatapointAxisType = (typeof AXIS_TYPES)[number]['val'];
type DatapointChartRenderType = (typeof CHART_RENDER_TYPES)[number]['val'];
declare const REALTIME_TEXTS: {
    readonly ACTIVE: "Realtime active";
    readonly INACTIVE: "Realtime inactive";
};
declare const PRODUCT_EXPERIENCE_DATA_EXPLORER_AND_GRAPH: {
    EVENTS: {
        DATA_EXPLORER_AND_GRAPH: string;
    };
    COMPONENTS: {
        DATA_EXPLORER_DETAILS: string;
    };
    ACTIONS: {
        DATA_EXPLORER_CONFIG_INIT: string;
        DATA_EXPLORER_CONFIG_CHANGE: string;
        DATA_GRAPH_WIDGET_CONFIG: string;
    };
};
type DateString = string;
type SeriesValue = [DateString, number];
type DatapointRealtimeMeasurements = {
    measurement: IMeasurement;
    datapoint: DatapointsGraphKPIDetails;
};
type YAxisOptions = {
    showSplitLines: boolean;
    mergeMatchingDatapoints: boolean;
    forceMergeDatapoints: boolean;
    setYaxisStartToZero: boolean;
    showLabelAndUnit: boolean;
    axisColor: string;
};
interface SeriesDatapointInfo {
    datapointId?: string;
    datapointLabel?: string;
    datapointUnit?: string;
}
declare const SEVERITY_LABELS: {
    readonly CRITICAL: "CRITICAL";
    readonly MAJOR: "MAJOR";
    readonly MINOR: "MINOR";
    readonly WARNING: "WARNING";
};
type SeverityType = keyof typeof Severity;
interface SelectableDatapoint {
    type: 'ALARM' | 'DATAPOINT' | 'EVENT';
    original: KPIDetails | AlarmDetailsExtended | EventDetailsExtended;
}

/**
 * @param typeOfSeries is used for formatter to distinguish between events/alarms series
 * @param isDpTemplateSelected is used to distinguish if the series have a specific dp template selected. E.g. for case when a device has 2 measurements and 2 series are created for each measurement
 * @param id is used to distinguish between series
 * @param data is used to store the data for the series
 * @param itemStyle is used to set the color of the series
 */
interface ModifiedCustomSeriesOptions extends echarts.EChartsOption {
    typeOfSeries?: 'alarm' | 'event' | null;
    isDpTemplateSelected?: boolean;
    id: string;
    data: SeriesValue[];
    itemStyle: {
        color: string;
    };
}
interface customSeriesMarkLineData {
    data: MarkLineData[];
}
interface customSeriesMarkPointData {
    data: MarkPointData[];
}
type CustomSeriesOptions = Omit<ModifiedCustomSeriesOptions, 'tooltip'>;
interface EchartsCustomOptions extends ECBasicOption {
    tooltip: {
        formatter: TooltipFormatterCallback<TopLevelFormatterParams> | string;
    }[];
}
interface MeasurementSeries {
    min: number | null;
    max: number | null;
}
declare enum CHART_VIEW_CONTEXT {
    WIDGET_VIEW = "widget_view",
    WIDGET_CONFIG = "widget_config",
    DATAPOINT_EXPLORER = "datapoint_explorer"
}

declare enum ICONS {
    ALARM = "path://M18.375 15.8462L20.4423 17.9135V18.9231H4V17.9135L6.06731 15.8462V10.75C6.06731 9.14744 6.47596 7.75321 7.29327 6.56731C8.11058 5.38141 9.24038 4.61218 10.6827 4.25962V3.53846C10.6827 3.12179 10.8269 2.76122 11.1154 2.45673C11.4038 2.15224 11.7724 2 12.2212 2C12.6699 2 13.0385 2.15224 13.3269 2.45673C13.6154 2.76122 13.7596 3.12179 13.7596 3.53846V4.25962C15.2019 4.61218 16.3317 5.38141 17.149 6.56731C17.9663 7.75321 18.375 9.14744 18.375 10.75V15.8462ZM12.2212 22C11.6442 22 11.1554 21.8077 10.7548 21.4231C10.3542 21.0385 10.1538 20.5577 10.1538 19.9808H14.2885C14.2885 20.5256 14.0801 20.9984 13.6635 21.399C13.2468 21.7997 12.766 22 12.2212 22Z",
    EVENT = "path://M97.3013 63L128.939 95.1315C79.296 134.335 47.7653 191.526 47.7653 255.276C47.7653 319.027 79.296 376.218 128.917 415.421L97.28 447.574C37.76 400.552 0 331.93 0 255.276C0 178.622 37.76 110.001 97.3013 63ZM414.72 63C474.24 110.001 512 178.622 512 255.276C512 331.93 474.24 400.552 414.72 447.574L383.083 415.421C432.704 376.218 464.235 319.027 464.235 255.276C464.235 191.526 432.704 134.335 383.083 95.1315L414.72 63ZM160.405 127.092L192 159.181C162.24 182.681 143.317 217.013 143.317 255.276C143.317 293.539 162.219 327.871 192 351.372L160.405 383.461C120.725 352.119 95.552 306.379 95.552 255.276C95.552 204.174 120.725 158.433 160.405 127.092ZM351.595 127.092C391.296 158.433 416.448 204.174 416.448 255.276C416.448 306.379 391.275 352.119 351.595 383.461L320 351.372C349.781 327.871 368.683 293.539 368.683 255.276C368.683 217.013 349.781 182.703 320 159.181L351.595 127.092ZM256 192.722C291.505 192.722 320.287 221.504 320.287 257.009C320.287 292.514 291.505 321.296 256 321.296C220.495 321.296 191.713 292.514 191.713 257.009C191.713 221.504 220.495 192.722 256 192.722Z",
    ACKNOWLEDGED = "path://M10.4795 2H13.4807V4.18054C14.1215 4.35248 14.7155 4.61821 15.2626 4.97773C15.8097 5.35287 16.2864 5.79836 16.6928 6.31419C17.0993 6.81438 17.4119 7.3771 17.6307 8.00234C17.8652 8.62759 17.9824 9.29191 17.9824 9.99531V13.7702L16.9742 12.762V12.7855L9.72919 5.54045C9.74482 5.54045 9.75264 5.54045 9.75264 5.54045L9.00234 4.79015C9.22118 4.64947 9.45565 4.53224 9.70574 4.43845C9.95584 4.34467 10.2138 4.25869 10.4795 4.18054V2ZM4.4068 3.03165L21.4291 20.0305L19.9988 21.4373L17.5604 18.9988H13.6917C13.7855 19.1551 13.8558 19.3193 13.9027 19.4912C13.9496 19.6475 13.973 19.8195 13.973 20.007C13.973 20.5541 13.7776 21.0231 13.3869 21.4138C12.9961 21.8046 12.5272 22 11.9801 22C11.4174 22 10.9406 21.8046 10.5498 21.4138C10.159 21.0231 9.96366 20.5541 9.96366 20.007C9.96366 19.8195 9.9871 19.6475 10.034 19.4912C10.0809 19.3193 10.1512 19.1551 10.245 18.9988H3.96131V17.9906L5.97773 15.9977V9.99531C5.97773 9.60453 6.00899 9.22939 6.07151 8.86987C6.14967 8.51036 6.25127 8.15866 6.37632 7.81477L3 4.43845L4.4068 3.03165Z",
    CLEARED = "path://M9.09375 19.5977C9.09375 20.2617 9.32812 20.8281 9.79688 21.2969C10.2786 21.7656 10.8516 22 11.5156 22C12.1927 22 12.7656 21.7656 13.2344 21.2969C13.7161 20.8281 13.957 20.2617 13.957 19.5977H9.09375ZM16.8672 10.418C16.3203 10.5091 15.7995 10.6784 15.3047 10.9258C14.8229 11.1732 14.3867 11.4922 13.9961 11.8828C13.5013 12.3776 13.1172 12.944 12.8438 13.582C12.5833 14.2201 12.4531 14.8841 12.4531 15.5742C12.4531 16.0299 12.5052 16.4727 12.6094 16.9023C12.7266 17.332 12.8958 17.7422 13.1172 18.1328H3V16.375C4.04167 16.0495 4.74479 15.3919 5.10938 14.4023C5.47396 13.4128 5.76693 12.3385 5.98828 11.1797C6.20964 10.0208 6.48958 8.88802 6.82812 7.78125C7.16667 6.6875 7.83724 5.85417 8.83984 5.28125C9.11328 5.125 9.32812 4.91667 9.48438 4.65625C9.64062 4.38281 9.71875 4.08984 9.71875 3.77734C9.71875 3.28255 9.88802 2.86589 10.2266 2.52734C10.5781 2.17578 11.0013 2 11.4961 2C11.9909 2 12.4076 2.17578 12.7461 2.52734C13.0977 2.86589 13.2734 3.28255 13.2734 3.77734C13.2734 4.08984 13.3516 4.38281 13.5078 4.65625C13.6771 4.91667 13.8984 5.125 14.1719 5.28125C15.0443 5.78906 15.6562 6.51172 16.0078 7.44922C16.3724 8.38672 16.6589 9.3763 16.8672 10.418ZM11.4961 4.48047C11.6914 4.48047 11.8607 4.41536 12.0039 4.28516C12.1471 4.14193 12.2188 3.97266 12.2188 3.77734C12.2188 3.56901 12.1471 3.39974 12.0039 3.26953C11.8607 3.1263 11.6914 3.05469 11.4961 3.05469C11.3008 3.05469 11.1315 3.1263 10.9883 3.26953C10.8451 3.39974 10.7734 3.56901 10.7734 3.77734C10.7734 3.97266 10.8451 4.14193 10.9883 4.28516C11.1315 4.41536 11.3008 4.48047 11.4961 4.48047ZM16.9062 17.6055L19.9922 14.5195L19.2305 13.7773L16.9062 16.1016L15.8906 15.0859L15.1289 15.8477L16.9062 17.6055ZM17.5312 11.8633C18.5599 11.8633 19.4388 12.2279 20.168 12.957C20.8971 13.6862 21.2617 14.5651 21.2617 15.5938C21.2617 16.6224 20.8971 17.5013 20.168 18.2305C19.4388 18.9596 18.5599 19.3242 17.5312 19.3242C16.5026 19.3242 15.6237 18.9596 14.8945 18.2305C14.1654 17.5013 13.8008 16.6224 13.8008 15.5938C13.8008 14.5651 14.1654 13.6862 14.8945 12.957C15.6237 12.2279 16.5026 11.8633 17.5312 11.8633Z",
    MINOR = "path://M21.9787 11.9894L11.9894 22L2 11.9894L11.9894 2L21.9787 11.9894ZM12.9052 16.5474V14.7157H11.0735V16.5474H12.9052ZM12.9052 12.9052V7.45261H11.0735V12.9052H12.9052Z",
    MAJOR = "path://M12.8936 13.8936V10.234H11.1064V13.8936H12.8936ZM12.8936 17.5106V15.6809H11.1064V17.5106H12.8936ZM2 20.234L12 3L22 20.234H2Z",
    CRITICAL = "path://M12.0117 22C10.6362 22 9.3388 21.7343 8.11958 21.2028C6.90035 20.687 5.83744 19.9758 4.93083 19.0692C4.02423 18.1626 3.31301 17.0996 2.79719 15.8804C2.26573 14.6768 2 13.3794 2 11.9883C2 10.6127 2.26573 9.31536 2.79719 8.09613C3.31301 6.89254 4.02423 5.83744 4.93083 4.93083C5.83744 4.02423 6.90035 3.3052 8.11958 2.77374C9.3388 2.25791 10.6362 2 12.0117 2C13.3873 2 14.6846 2.25791 15.9039 2.77374C17.1231 3.3052 18.186 4.02423 19.0926 4.93083C19.9992 5.83744 20.7104 6.89254 21.2263 8.09613C21.7577 9.31536 22.0234 10.6127 22.0234 11.9883C22.0234 13.3794 21.7577 14.6768 21.2263 15.8804C20.7104 17.0996 19.9992 18.1626 19.0926 19.0692C18.186 19.9758 17.1231 20.687 15.9039 21.2028C14.6846 21.7343 13.3873 22 12.0117 22ZM13.0199 6.99414H11.0035V12.9965H13.0199V6.99414ZM13.0199 14.9894H11.0035V17.0059H13.0199V14.9894Z",
    WARNING = "path://M12 2C13.3772 2 14.6761 2.25822 15.8967 2.77465C17.1174 3.29108 18.1815 4.00313 19.0892 4.9108C19.9969 5.81847 20.7089 6.88263 21.2254 8.10329C21.7418 9.32394 22 10.6228 22 12C22 13.3772 21.7418 14.6761 21.2254 15.8967C20.7089 17.1174 19.9969 18.1815 19.0892 19.0892C18.1815 19.9969 17.1174 20.7089 15.8967 21.2254C14.6761 21.7418 13.3772 22 12 22C10.6228 22 9.32394 21.7418 8.10329 21.2254C6.88263 20.7089 5.81847 19.9969 4.9108 19.0892C4.00313 18.1815 3.29108 17.1174 2.77465 15.8967C2.25822 14.6761 2 13.3772 2 12C2 10.6228 2.25822 9.32394 2.77465 8.10329C3.29108 6.88263 4.00313 5.81847 4.9108 4.9108C5.81847 4.00313 6.88263 3.29108 8.10329 2.77465C9.32394 2.25822 10.6228 2 12 2Z"
}
declare const ICONS_MAP: {
    ALARM: ICONS;
    EVENT: ICONS;
    ACKNOWLEDGED: ICONS;
    CLEARED: ICONS;
    MINOR: ICONS;
    MAJOR: ICONS;
    CRITICAL: ICONS;
    WARNING: ICONS;
};

export { CHART_VIEW_CONTEXT, DATE_SELECTION_EXTENDED, ICONS_MAP, LEGEND_DISPLAY_OPTIONS, PRODUCT_EXPERIENCE_DATA_EXPLORER_AND_GRAPH, REALTIME_TEXTS, SEVERITY_LABELS };
export type { AlarmDetailsExtended, AlarmOrEventExtended, CustomSeriesOptions, DatapointAxisType, DatapointChartRenderType, DatapointLineType, DatapointRealtimeMeasurements, DatapointsGraphKPIDetails, DatapointsGraphWidgetConfig, DatapointsGraphWidgetTimeProps, DateString, DpValuesItem, DpWithValues, EchartsCustomOptions, EchartsSeriesOptions, EventDetailsExtended, GraphDisplayOptions, LegendDisplayOptionItem, MarkLineData, MarkPointData, MeasurementSeries, SelectableDatapoint, SeriesDatapointInfo, SeriesValue, SeverityType, TimeContextProps, YAxisOptions, customSeriesMarkLineData, customSeriesMarkPointData };
//# sourceMappingURL=index.d.ts.map
