import * as _angular_core from '@angular/core';
import { OnInit, PipeTransform, AfterViewInit, QueryList, ElementRef } from '@angular/core';
import { IEvent, IManagedObject, IEventBinary, IResultList, IManagedObjectBinary, IFetchResponse, EventService } from '@c8y/client';
import { EventDetails } from '@c8y/ngx-components/alarm-event-selector';
import { QueryParamsHandling } from '@angular/router';
import { DateTimeContext, CountdownIntervalComponent, LoadMoreMode, SplitViewListComponent, ListItemComponent, ContextData } from '@c8y/ngx-components';
import { AlarmFilterInterval } from '@c8y/ngx-components/interval-picker';
import { BsDropdownDirective } from 'ngx-bootstrap/dropdown';
import * as _angular_forms from '@angular/forms';
import { DateTimeContextPickerService } from '@c8y/ngx-components/global-context';
import { Subject } from 'rxjs';

declare class EventDetailsComponent implements OnInit {
    readonly CREATION_TIME_HELP_TEXT: "Time in which the event was created on the server. The time shown corresponds to the server's time.";
    readonly EVENT_ICON = "online1";
    readonly TIME_HELP_TEXT: "Time in which the event was created on the device. Device time can be different from server time.";
    binaryPreviewLoading: _angular_core.WritableSignal<boolean>;
    binaryPreviewUrl: _angular_core.WritableSignal<string>;
    binaryPreviewFailed: _angular_core.WritableSignal<boolean>;
    customFragments: _angular_core.WritableSignal<Record<string, unknown>>;
    isDownloading: _angular_core.WritableSignal<boolean>;
    isLoading: _angular_core.WritableSignal<boolean>;
    selectedEvent: _angular_core.WritableSignal<IEvent>;
    selectedEventSource: _angular_core.WritableSignal<IManagedObject>;
    typeColor: _angular_core.WritableSignal<string>;
    binaryInfo: _angular_core.Signal<IEventBinary>;
    hasBinary: _angular_core.Signal<boolean>;
    canDownload: _angular_core.Signal<boolean>;
    binaryIcon: _angular_core.Signal<string>;
    private activatedRoute;
    private alertService;
    private colorService;
    private destroyRef;
    private eventBinaryService;
    private eventService;
    private eventsService;
    private inventoryService;
    ngOnInit(): void;
    isComplexValue(value: unknown): boolean;
    downloadBinary(): Promise<void>;
    private loadEventDetails;
    private loadEventSource;
    private loadBinaryPreview;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EventDetailsComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EventDetailsComponent, "c8y-event-details", never, {}, {}, never, never, true, never>;
}

declare class EventIconPipe implements PipeTransform {
    private eventsService;
    transform(event: IEvent): string;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EventIconPipe, never>;
    static ɵpipe: _angular_core.ɵɵPipeDeclaration<EventIconPipe, "eventIcon", true>;
}

declare class EventIsImagePipe implements PipeTransform {
    private eventsService;
    transform(event: IEvent): boolean;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EventIsImagePipe, never>;
    static ɵpipe: _angular_core.ɵɵPipeDeclaration<EventIsImagePipe, "eventIsImage", true>;
}

declare class EventRouterLinkPipe implements PipeTransform {
    private activatedRoute;
    private contextRouteService;
    private eventsViewService;
    transform(event: IEvent, alwaysNavigateToAllEvents?: boolean): string;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EventRouterLinkPipe, never>;
    static ɵpipe: _angular_core.ɵɵPipeDeclaration<EventRouterLinkPipe, "eventRouterLink", true>;
}

interface EventsFilter {
    source?: string | number;
    type?: string;
    dateFrom?: Date;
    dateTo?: Date;
    pageSize?: number;
    withSourceChildren?: boolean;
}
declare const EVENT_RESERVED_KEYS: string[];
declare const EVENT_STANDARD_KEYS: {
    type: "Type";
    text: "Text";
    lastUpdated: "Last updated";
};
declare const EVENTS_PATH = "events";
/**
 * Extended interval titles with an additional title for the case when no date is selected.
 */
declare const INTERVAL_TITLES_EXTENDED: Record<AlarmFilterInterval['id'], string>;
declare const INTERVALS_EXTENDED: AlarmFilterInterval[];
type WidgetTimeContextStateExtended = {
    date: DateTimeContext;
    interval: AlarmFilterInterval['id'];
};
type EventListFormFilters = {
    selectedDates?: DateTimeContext;
    interval?: AlarmFilterInterval['id'];
};
/**
 * Represents the navigation options for the events list component.
 */
type EventNavigationOptions = {
    /**
     * Defines if the event should navigate to a detail view when clicked.
     */
    allowNavigationToEventsView: boolean;
    /**
     * Defines if the component should try to determine the context to navigate
     * to the correct event detail view or not. If set to true, the component will
     * not try to determine the context and will always navigate to the all events view.
     */
    alwaysNavigateToAllEvents: boolean;
    /**
     * Determines how query parameters should be handled during navigation.
     *
     * - `"merge"` : Merge new parameters with current parameters.
     * - `"preserve"` : Preserve current parameters.
     * - `""` : Replace current parameters with new parameters. This is the default behavior.
     */
    queryParamsHandling: QueryParamsHandling;
};

declare class EventsComponent implements OnInit {
    readonly TITLE: "Events";
    events: _angular_core.WritableSignal<IResultList<IEvent>>;
    isLoading: _angular_core.WritableSignal<boolean>;
    shouldShowIntervalToggle: _angular_core.WritableSignal<boolean>;
    contextSourceId: string | number | null;
    isListScrolled: _angular_core.WritableSignal<boolean>;
    typeFilter: EventDetails | null;
    private dateFilter;
    private dateInterval;
    private activatedRoute;
    private alertService;
    private contextRouteService;
    private destroyRef;
    private eventsViewService;
    constructor();
    ngOnInit(): void;
    refresh(): void;
    changeInterval(value?: boolean): void;
    onScrollingStateChange(isScrolling: boolean): void;
    onPreviewStateChange(isOpen: boolean): void;
    onEventSelected(): void;
    applyTypeFilter(filter: EventDetails | null): void;
    applyDateFilter(filter: EventListFormFilters): void;
    private setupEventListReload;
    private loadEvents;
    private resolveCurrentDateRange;
    private initializeContextSourceId;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EventsComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EventsComponent, "c8y-events", never, {}, {}, never, never, true, never>;
}

declare class EventsDateFilterComponent implements OnInit {
    readonly INTERVALS: AlarmFilterInterval[];
    readonly INTERVAL_TITLES: Record<"minutes" | "hours" | "days" | "weeks" | "months" | "custom" | "none", string>;
    readonly DATE_FORMAT = "short";
    readonly defaultInterval: _angular_core.InputSignal<"minutes" | "hours" | "days" | "weeks" | "months" | "custom" | "none">;
    readonly updateQueryParams: _angular_core.InputSignal<boolean>;
    date: _angular_core.WritableSignal<[string, string]>;
    noFilterLabel: "No date filter";
    dateFilterChange: _angular_core.OutputEmitterRef<EventListFormFilters>;
    dropdown: _angular_core.Signal<BsDropdownDirective>;
    private activatedRoute;
    private destroyRef;
    private eventsViewService;
    private formBuilder;
    private router;
    form: ReturnType<EventsDateFilterComponent['createForm']>;
    ngOnInit(): void;
    applyDateFilter(): void;
    private updateDateTime;
    private getDefaultContext;
    private subscribeToIntervalChange;
    private createForm;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EventsDateFilterComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EventsDateFilterComponent, "c8y-events-date-filter", never, { "defaultInterval": { "alias": "defaultInterval"; "required": false; "isSignal": true; }; "updateQueryParams": { "alias": "updateQueryParams"; "required": false; "isSignal": true; }; }, { "dateFilterChange": "dateFilterChange"; }, never, never, true, never>;
}

declare class EventsIntervalRefreshComponent implements AfterViewInit {
    readonly DEFAULT_INTERVAL_VALUES: number[];
    readonly DEFAULT_INTERVAL_VALUE = 30000;
    readonly DISABLE_AUTO_REFRESH: "Disable auto refresh";
    readonly ENABLE_AUTO_REFRESH: "Enable auto refresh";
    readonly SECONDS_UNTIL_REFRESH: "{{ seconds }} s";
    isLoading: _angular_core.InputSignal<boolean>;
    isDisabled: _angular_core.InputSignal<boolean>;
    isIntervalToggleEnabled: _angular_core.InputSignal<boolean>;
    onCountdownEnded: _angular_core.OutputEmitterRef<void>;
    countdownIntervalComponent: _angular_core.Signal<CountdownIntervalComponent>;
    private fb;
    toggleIntervalForm: _angular_forms.FormGroup<{
        intervalEnabled: _angular_forms.FormControl<boolean>;
        refreshInterval: _angular_forms.FormControl<number>;
    }>;
    private destroyRef;
    private doesUserCheckedIntervalToggle;
    constructor();
    get isToggleEnabled(): boolean;
    ngAfterViewInit(): void;
    resetCountdown(): void;
    trackUserClickOnIntervalToggle(target: EventTarget): void;
    getTooltip(): string;
    private startCountdown;
    private onIntervalToggleChange;
    private initForm;
    private listenToRefreshIntervalChange;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EventsIntervalRefreshComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EventsIntervalRefreshComponent, "c8y-events-interval-refresh", never, { "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "isDisabled": { "alias": "isDisabled"; "required": false; "isSignal": true; }; "isIntervalToggleEnabled": { "alias": "isIntervalToggleEnabled"; "required": false; "isSignal": true; }; }, { "onCountdownEnded": "onCountdownEnded"; }, never, never, true, never>;
}

declare class EventsListComponent implements AfterViewInit {
    readonly EMPTY_STATE_TITLE: "No events to display.";
    readonly LIST_TITLE: "Events list";
    /**
     * The paginated result list of events to display.
     */
    events: _angular_core.InputSignal<IResultList<IEvent>>;
    /**
     * Whether the events are currently being fetched.
     */
    isLoading: _angular_core.InputSignal<boolean>;
    /**
     * Controls the "load more" button behavior at the bottom of the list.
     */
    loadMoreMode: _angular_core.InputSignal<LoadMoreMode>;
    /**
     * Whether to show a file preview button for image events.
     */
    showPreview: _angular_core.InputSignal<boolean>;
    /**
     * Defines options for how the events list should navigate when a user clicks on an event.
     */
    navigationOptions: _angular_core.InputSignal<EventNavigationOptions>;
    /**
     * Emits `true` when the list is scrolled past the threshold, `false` when scrolled back.
     * Used to hide the countdown interval refresh control.
     */
    onScrollingStateChange: _angular_core.OutputEmitterRef<boolean>;
    /**
     * Emits `true` when a file preview is opened, `false` when closed.
     */
    onPreviewStateChange: _angular_core.OutputEmitterRef<boolean>;
    /**
     * Emits the event that was clicked by the user.
     */
    onSelectedEvent: _angular_core.OutputEmitterRef<IEvent>;
    activeEvent: _angular_core.WritableSignal<IEvent>;
    activeChildParamId: _angular_core.WritableSignal<string>;
    pendingActiveCheck: _angular_core.WritableSignal<boolean>;
    showEmptyState: _angular_core.Signal<boolean>;
    showFilterWarning: _angular_core.Signal<boolean>;
    svListComponent: _angular_core.Signal<SplitViewListComponent>;
    private isPreviewOpen;
    /** Scroll threshold in pixels after which the countdown interval is hidden. */
    private readonly HIDE_INTERVAL_COUNTDOWN_SCROLL;
    private readonly activatedRoute;
    private readonly bsModalService;
    private readonly destroyRef;
    private readonly eventBinaryService;
    private readonly router;
    constructor();
    ngAfterViewInit(): void;
    onEventClick(event: IEvent): void;
    activeRouteChanged(isActive: boolean, scrollAnchor: ListItemComponent, event: IEvent): void;
    onPreviewClick(mouseEvent: MouseEvent): void;
    toBinaryMo(event: IEvent): IManagedObjectBinary;
    getEventDownloadFn(event: IEvent): () => Promise<IFetchResponse>;
    private setupPreviewModalCloseListener;
    private setupActiveChildParamTracking;
    private setupScrollListener;
    private shouldCountdownIntervalBeHidden;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EventsListComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EventsListComponent, "c8y-events-list", never, { "events": { "alias": "events"; "required": false; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; "loadMoreMode": { "alias": "loadMoreMode"; "required": false; "isSignal": true; }; "showPreview": { "alias": "showPreview"; "required": false; "isSignal": true; }; "navigationOptions": { "alias": "navigationOptions"; "required": false; "isSignal": true; }; }, { "onScrollingStateChange": "onScrollingStateChange"; "onPreviewStateChange": "onPreviewStateChange"; "onSelectedEvent": "onSelectedEvent"; }, never, ["*"], true, never>;
}

declare class EventsService {
    private filesService;
    private fileIconPipe;
    resolveFileIcon(fileName: string): string;
    getStandardKeys(event: IEvent): any;
    getNonStandardKeys(event: IEvent, excluding?: string[]): any;
    isImageBinary(binaryInfo: IEventBinary): boolean;
    getCustomFragments(event: IEvent): Record<string, unknown> | null;
    arrayBufferToBase64(buffer: ArrayBuffer): string;
    private getKeys;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EventsService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<EventsService>;
}

declare class EventsTypeFilterComponent implements OnInit {
    optionItems: QueryList<ElementRef>;
    /** The latest page of events used to derive available filter types. */
    events: _angular_core.InputSignal<IResultList<IEvent>>;
    /** Emits the selected {@link EventDetails} when the active filter changes, or `null` when cleared. */
    onFilterChanged: _angular_core.OutputEmitterRef<EventDetails>;
    possibleFilters: _angular_core.WritableSignal<EventDetails[]>;
    activeFilter: _angular_core.WritableSignal<EventDetails>;
    customEventTypeInput: _angular_core.WritableSignal<string>;
    isCustomEventTypeInputInvalid: _angular_core.Signal<boolean>;
    readonly queryParamName = "eventTypeFilter";
    /**
     * localStorage key storing user-added custom event types.
     * Schema: `EventDetails[]` serialised as JSON (only entries where `__target === null`).
     */
    readonly STORAGE_ACCESS_KEY = "customEventTypes";
    private activatedRoute;
    private alarmEventSelectorService;
    private colorService;
    private destroyRef;
    private router;
    private currentQueryParam;
    constructor();
    ngOnInit(): void;
    setQueryParameterObservable(): void;
    selectEventType(eventType: EventDetails): void;
    /** Selects an event type, applies the filter, and closes the dropdown in one action. */
    selectAndClose(eventType: EventDetails, dropdown: BsDropdownDirective): void;
    deselect(): void;
    applyFilterChange(): void;
    restoreActiveFilter(): void;
    removeCustomEvent(eventDetails: EventDetails): void;
    navigateOption(event: KeyboardEvent, step: 1 | -1): void;
    confirmWithEnter(event: KeyboardEvent): void;
    addCustomEventType(): Promise<void>;
    private storeCustomEventTypes;
    private getCustomEventTypeFromStorage;
    private setPossibleFilters;
    private setActiveEventFiltersFromQueryParameter;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EventsTypeFilterComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EventsTypeFilterComponent, "c8y-events-type-filter", never, { "events": { "alias": "events"; "required": false; "isSignal": true; }; }, { "onFilterChanged": "onFilterChanged"; }, never, never, true, never>;
}

interface BuildEventsFilterParams {
    source?: string | number | null;
    type?: string | null;
    dateRange?: DateTimeContext | null;
    dateTimeContext?: {
        dateFrom?: Date | string | null;
        dateTo?: Date | string | null;
    } | null;
    withSourceChildren?: boolean;
}
declare class EventsViewService {
    private eventService;
    private dateTimeContextPickerService;
    readonly DEFAULT_PAGE_SIZE = 50;
    readonly DEFAULT_REFRESH_INTERVAL = 30000;
    reloadEventsList$: Subject<void>;
    constructor(eventService: EventService, dateTimeContextPickerService: DateTimeContextPickerService);
    /**
     * Emits a subject to trigger events list reload.
     */
    updateEventsList(): void;
    /**
     * Retrieves a list of events with optional filters.
     */
    retrieveEvents(filter?: EventsFilter): Promise<IResultList<IEvent>>;
    /**
     * Returns the correct link based on the provided context data.
     */
    getRouterLink(contextData?: ContextData, event?: IEvent): string;
    /**
     * Returns the correct from and to dates based on the selected interval
     * @param intervalId the selected interval. E.g. 'none', 'hours', 'custom' ...
     * @returns The calculated date context based on the selected interval.
     */
    buildEventsFilter(params: BuildEventsFilterParams): EventsFilter;
    getDateTimeContextByInterval(intervalId: AlarmFilterInterval['id']): DateTimeContext;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EventsViewService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<EventsViewService>;
}

export { EVENTS_PATH, EVENT_RESERVED_KEYS, EVENT_STANDARD_KEYS, EventDetailsComponent, EventIconPipe, EventIsImagePipe, EventRouterLinkPipe, EventsComponent, EventsDateFilterComponent, EventsIntervalRefreshComponent, EventsListComponent, EventsService, EventsTypeFilterComponent, EventsViewService, INTERVALS_EXTENDED, INTERVAL_TITLES_EXTENDED };
export type { BuildEventsFilterParams, EventListFormFilters, EventNavigationOptions, EventsFilter, WidgetTimeContextStateExtended };
//# sourceMappingURL=index.d.ts.map
