import * as i0 from '@angular/core';
import { OnInit, SimpleChanges } from '@angular/core';
import * as _angular_forms from '@angular/forms';
import { FormBuilder } from '@angular/forms';
import { DateTimeContext, DateAndTimeOptions, WidgetTimeContextDateRangeService } from '@c8y/ngx-components';
import { Interval } from '@c8y/ngx-components/interval-picker';
import { BsDropdownDirective } from 'ngx-bootstrap/dropdown';
import { aggregationType } from '@c8y/client';

interface TimeContext {
    date: DateTimeContext;
    interval: Interval['id'];
    realtime: boolean;
    aggregation: aggregationType;
}

declare class DatapointExplorerService {
    readonly DEFAULT_INTERVAL: Interval['id'];
    getDefaultContext(overrides?: Partial<TimeContext>): TimeContext;
    calculateAggregation([dateFrom, dateTo]: DateTimeContext, requestedAggregation: aggregationType | null): {
        selectedAggregation: aggregationType | null;
        disabledAggregations: Partial<Record<aggregationType, boolean>>;
    };
    getDateTimeContextByInterval(intervalId: Interval['id']): DateTimeContext;
    private getTimeRangeInMs;
    private validateTimeRanges;
    private getDisabledAggregations;
    private determineAggregation;
    static ɵfac: i0.ɵɵFactoryDeclaration<DatapointExplorerService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<DatapointExplorerService>;
}

declare class TimeContextComponent implements OnInit {
    #private;
    private widgetTimeContextDateRangeService;
    changedDateContext: {
        dateFrom?: Date;
        dateTo?: Date;
        interval?: Interval['id'];
        realtime?: boolean;
        aggregation?: string;
    };
    controlsAvailable: any;
    timeContext: Partial<TimeContext>;
    timePickerConfig: DateAndTimeOptions;
    dropdown: BsDropdownDirective;
    datapointExplorerService: DatapointExplorerService;
    formBuilder: FormBuilder;
    readonly DATE_FORMAT = "short";
    readonly INTERVAL_TITLES: Record<"minutes" | "hours" | "days" | "weeks" | "months" | "custom", string>;
    readonly REALTIME_INTERVAL = 1000;
    form: _angular_forms.FormGroup<{
        temporaryUserSelectedFromDate: _angular_forms.FormControl<string>;
        temporaryUserSelectedToDate: _angular_forms.FormControl<string>;
        currentDateContextFromDate: _angular_forms.FormControl<string>;
        currentDateContextToDate: _angular_forms.FormControl<string>;
        currentDateContextInterval: _angular_forms.FormControl<unknown>;
        realtime: _angular_forms.FormControl<unknown>;
        aggregation: _angular_forms.FormControl<unknown>;
    }>;
    disabledAggregations: any;
    readonly valuesSignal: i0.Signal<string>;
    context: i0.ModelSignal<Partial<{
        temporaryUserSelectedFromDate: string;
        temporaryUserSelectedToDate: string;
        currentDateContextFromDate: string;
        currentDateContextToDate: string;
        currentDateContextInterval: unknown;
        realtime: unknown;
        aggregation: unknown;
    }>>;
    private realtimeSubscription;
    constructor(widgetTimeContextDateRangeService: WidgetTimeContextDateRangeService);
    ngOnInit(): void;
    ngOnChanges(changes: SimpleChanges): void;
    applyDatetimeContext(): void;
    stopRealtime(): void;
    private subscribeToIntervalChange;
    private subscribeToRealtimeChange;
    private subscribeToAggregationChange;
    private onRealtimeValueChange;
    private startRealtime;
    private update;
    private createForm;
    private updateFormValues;
    static ɵfac: i0.ɵɵFactoryDeclaration<TimeContextComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<TimeContextComponent, "c8y-time-context", never, { "changedDateContext": { "alias": "changedDateContext"; "required": false; }; "controlsAvailable": { "alias": "controlsAvailable"; "required": false; }; "timeContext": { "alias": "timeContext"; "required": false; }; "timePickerConfig": { "alias": "timePickerConfig"; "required": false; }; "context": { "alias": "context"; "required": false; "isSignal": true; }; }, { "context": "contextChange"; }, never, never, true, never>;
}

export { DatapointExplorerService, TimeContextComponent };
export type { TimeContext };
//# sourceMappingURL=index.d.ts.map
