import * as _c8y_ngx_components_echart from '@c8y/ngx-components/echart';
import { DatapointsGraphWidgetConfig, CHART_VIEW_CONTEXT, DatapointsGraphWidgetTimeProps, EventDetailsExtended, AlarmDetailsExtended, DatapointsGraphKPIDetails, AlarmOrEventExtended, SelectableDatapoint, ChartsComponent } from '@c8y/ngx-components/echart';
import * as i0 from '@angular/core';
import { OnInit, OnChanges, OnDestroy, TemplateRef, SimpleChanges, ChangeDetectorRef } from '@angular/core';
import { OnBeforeSave, DynamicComponentAlertAggregator, DynamicComponentService, SelectableItem, WidgetTimeContextDateRangeService } from '@c8y/ngx-components';
import { SelectedDatapoint } from '@c8y/ngx-components/alarm-event-selector';
import { WidgetConfigComponent, ContextDashboardComponent } from '@c8y/ngx-components/context-dashboard';
import { DatapointAttributesFormConfig, DatapointSelectorModalOptions } from '@c8y/ngx-components/datapoint-selector';
import { WidgetControls, GlobalContextWidgetWrapperComponent, WidgetConfigMigrationService, GlobalContextEvent } from '@c8y/ngx-components/global-context';
import { Observable } from 'rxjs/internal/Observable';
import * as _c8y_client from '@c8y/client';
import { TranslateService } from '@ngx-translate/core';
import { BehaviorSubject } from 'rxjs';

declare class DatapointsGraphWidgetConfigComponent implements OnInit, OnChanges, OnBeforeSave, OnDestroy {
    private widgetConfig;
    private dashboardContextComponent;
    private dynamicComponentService;
    private _config;
    private isFirstConfigSet;
    set config(value: DatapointsGraphWidgetConfig | undefined);
    get config(): DatapointsGraphWidgetConfig | undefined;
    set previewMapSet(template: TemplateRef<any>);
    private readonly formBuilder;
    private readonly form;
    private readonly widgetConfigService;
    private readonly chartHelpersService;
    private readonly gainsightService;
    private readonly measurementService;
    alerts: DynamicComponentAlertAggregator | undefined;
    formGroup: ReturnType<DatapointsGraphWidgetConfigComponent['initForm']>;
    datapointSelectDefaultFormOptions: Partial<DatapointAttributesFormConfig>;
    datapointSelectionConfig: Partial<DatapointSelectorModalOptions>;
    activeDatapointsExists: boolean;
    alarmsOrEventsHaveNoMatchingDps: boolean;
    widgetControls: WidgetControls;
    chartViewContext: CHART_VIEW_CONTEXT;
    legendDisplayOptions: _c8y_ngx_components_echart.LegendDisplayOptionItem[];
    private destroy$;
    private isInitialized;
    constructor(widgetConfig: WidgetConfigComponent, dashboardContextComponent: ContextDashboardComponent, dynamicComponentService: DynamicComponentService);
    ngOnInit(): Promise<void>;
    ngOnChanges(changes: SimpleChanges): void;
    ngOnDestroy(): void;
    onBeforeSave(config?: DatapointsGraphWidgetConfig): boolean | Promise<boolean> | Observable<boolean>;
    updateTimeRangeOnRealtime(timeRange: Pick<DatapointsGraphWidgetConfig, 'dateFrom' | 'dateTo'>): void;
    updateDashboardTimeContext(timeProps: DatapointsGraphWidgetTimeProps): void;
    updateAggregatedSliderDatapoint(selectedDatapoint: SelectedDatapoint | null): void;
    /**
     * DEPRECATED: to be removed when there is another way to identify time series migration.
     * This method checks if the tenant is migrated to time series by making a call to measurement detail endpoint.
     * If the endpoint returns 405, it means the tenant is migrated. This is a workaround for now until we have a
     * better way to identify time series migration.
     */
    private detectTimeSeriesMigration;
    private assignContextFromContextDashboard;
    private checkForMatchingDatapoints;
    private initForm;
    private setActiveDatapointsExists;
    static ɵfac: i0.ɵɵFactoryDeclaration<DatapointsGraphWidgetConfigComponent, [{ optional: true; }, { optional: true; }, null]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DatapointsGraphWidgetConfigComponent, "c8y-datapoints-graph-widget-config", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
}

declare class DatapointsGraphWidgetViewComponent implements OnDestroy {
    private translate;
    private dashboardContextComponent;
    private dynamicComponentService;
    private widgetConfigMigrationService;
    private widgetTimeContextDateRangeService;
    private cdr;
    events: EventDetailsExtended[];
    alarms: AlarmDetailsExtended[];
    AGGREGATION_ICONS: Record<"undefined" | _c8y_client.aggregationType, string>;
    AGGREGATION_TEXTS: Record<"undefined" | _c8y_client.aggregationType | "disabled", string>;
    alerts: DynamicComponentAlertAggregator | undefined;
    datapointsOutOfSync: Map<DatapointsGraphKPIDetails, boolean>;
    hasAtLeastOneDatapointActive: boolean;
    hasAtLeastOneAlarmActive: boolean;
    isMarkedAreaEnabled: boolean;
    loadedDatapoints: DatapointsGraphKPIDetails[];
    loadedAlarmsOrEvents: AlarmOrEventExtended[];
    isLoading$: BehaviorSubject<boolean>;
    isSliderBeingDragged$: BehaviorSubject<boolean>;
    enabledMarkedAreaAlarmType: string | undefined;
    chartViewContext: CHART_VIEW_CONTEXT;
    widgetControls: WidgetControls;
    /** Combined number of datapoints, alarms, and events */
    totalLegendItems: number;
    /** Selectable items for the datapoints, alarms, events dropdown */
    selectableItems: SelectableItem<SelectableDatapoint>[];
    /** Selected items from the dropdown */
    selectedItems: SelectableItem<SelectableDatapoint>[];
    set config(value: DatapointsGraphWidgetConfig);
    get config(): never;
    wrapper?: GlobalContextWidgetWrapperComponent;
    chartComponent: ChartsComponent;
    displayConfig: DatapointsGraphWidgetConfig | undefined;
    legendHelp: any;
    readonly disableZoomInLabel: "Disable zoom in";
    readonly enableZoomInLabel: "Click to enable zoom, then click and drag on the desired area in the chart.";
    readonly hideDatapointLabel: "Hide data point";
    readonly showDatapointLabel: "Show data point";
    private destroy$;
    private readonly widgetInstanceId;
    constructor(translate: TranslateService, dashboardContextComponent: ContextDashboardComponent, dynamicComponentService: DynamicComponentService, widgetConfigMigrationService: WidgetConfigMigrationService, widgetTimeContextDateRangeService: WidgetTimeContextDateRangeService, cdr: ChangeDetectorRef);
    ngOnInit(): Promise<void>;
    onGlobalContextChange(event: GlobalContextEvent): void;
    ngOnDestroy(): void;
    updateDashboardTimeContext(timeProps: DatapointsGraphWidgetTimeProps): void;
    buildSelectableItems(): SelectableItem<SelectableDatapoint>[];
    onItemSelected(item: SelectableItem<SelectableDatapoint>): void;
    onItemDeselected(item: SelectableItem<SelectableDatapoint>): void;
    toggleChart(datapoint: DatapointsGraphKPIDetails): void;
    handleDatapointOutOfSync(dpOutOfSync: DatapointsGraphKPIDetails): void;
    handleDatapointBackInSync(dpBackInSync: DatapointsGraphKPIDetails): void;
    toggleMarkedArea(alarm: AlarmDetailsExtended): void;
    toggleAlarmEventType(alarmOrEvent: AlarmOrEventExtended): void;
    updateAlarmsAndEvents(alarmsEventsConfigs: AlarmOrEventExtended[]): void;
    filterSeverity(eventTarget: any): void;
    isLastActiveDatapoint(selectedItem: SelectableItem<SelectableDatapoint>): boolean;
    private updateSelectedItems;
    private assignContextFromContextDashboard;
    /**
     * Remove hidden items from loaded cache so they will be reloaded when toggled visible.
     * Called when context changes (time range, aggregation, etc.) to mark hidden items data as stale.
     */
    private invalidateHiddenItemsCache;
    static ɵfac: i0.ɵɵFactoryDeclaration<DatapointsGraphWidgetViewComponent, [null, { optional: true; }, null, null, null, null]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DatapointsGraphWidgetViewComponent, "c8y-datapoints-graph-widget-view", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
}

export { DatapointsGraphWidgetConfigComponent, DatapointsGraphWidgetViewComponent };
//# sourceMappingURL=index.d.ts.map
