import * as _siemens_element_translate_ng_translate from '@siemens/element-translate-ng/translate';
import { TranslatableString } from '@siemens/element-translate-ng/translate';
import * as _angular_core from '@angular/core';
import { PipeTransform, OnChanges, SimpleChanges } from '@angular/core';
import { DatepickerInputConfig, DateRange, DatepickerConfig } from '@siemens/element-ng/datepicker';

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */

/**
 * Simple DateRangeFilter preset based on offset from now
 */
interface DateRangePresetOffset {
    type?: 'offset';
    /** translation key for label */
    label: TranslatableString;
    /** offset from current in milliseconds */
    offset: number;
}
/**
 * Advanced DateRageFilter preset with custom calculation
 */
interface DateRangePresetCustom {
    type: 'custom';
    /** translation key for label */
    label: TranslatableString;
    /** calculation custom calculation function */
    calculate: (self: DateRangePresetCustom, currentRange: DateRangeFilter) => DateRangeFilter;
    /** Whether this should show only when time support is enabled */
    timeOnly?: boolean;
}
type DateRangePreset = DateRangePresetOffset | DateRangePresetCustom;
interface DateRangeFilter {
    point1: Date | 'now';
    point2: number | Date;
    range?: 'before' | 'after' | 'within';
}
interface ResolvedDateRange {
    start: Date;
    end: Date;
    valid: boolean;
}
declare const ONE_MINUTE: number;
declare const ONE_DAY: number;

declare class PresetMatchFilterPipe implements PipeTransform {
    transform(value: string, term: string): boolean;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<PresetMatchFilterPipe, never>;
    static ɵpipe: _angular_core.ɵɵPipeDeclaration<PresetMatchFilterPipe, "presetMatchFilter", true>;
}
declare class SiDateRangeFilterComponent implements OnChanges {
    private readonly service;
    private readonly mediaMatcher;
    protected readonly smallScreen: boolean;
    /** The filter range object */
    readonly range: _angular_core.ModelSignal<DateRangeFilter>;
    /** List of preset time ranges. When not present or empty, the preset section won't show */
    readonly presetList: _angular_core.InputSignal<DateRangePreset[] | undefined>;
    /**
     * Determines if there's a search field for the preset list
     *
     * @defaultValue true
     */
    readonly presetSearch: _angular_core.InputSignalWithTransform<boolean, unknown>;
    /**
     * Determines if time is selectable or only dates
     *
     * @defaultValue false
     */
    readonly enableTimeSelection: _angular_core.InputSignalWithTransform<boolean, unknown>;
    /**
     * Determines whether to show input fields or a date-range calendar in basic mode.
     * When time selection is enabled, this has no effect and input fields are always shown.
     *
     * @defaultValue 'calendar'
     */
    readonly basicMode: _angular_core.InputSignal<"input" | "calendar">;
    /**
     * Reverses the order of the from/to fields
     *
     * @defaultValue false
     */
    readonly reverseInputFields: _angular_core.InputSignalWithTransform<boolean, unknown>;
    /**
     * Determines whether to show the 'Apply' button
     *
     * @defaultValue false
     */
    readonly showApplyButton: _angular_core.InputSignalWithTransform<boolean, unknown>;
    /**
     * Hides the advanced mode if input allows
     *
     * @defaultValue false
     */
    readonly hideAdvancedMode: _angular_core.InputSignalWithTransform<boolean, unknown>;
    /**
     * label for the "Reference point" title
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.REF_POINT:Reference point`)
     * ```
     */
    readonly refLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "Reference point" title
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.FROM:From`)
     * ```
     */
    readonly fromLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "Reference point" title
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.TO:To`)
     * ```
     */
    readonly toLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "Range" title
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.RANGE:Range`)
     * ```
     */
    readonly rangeLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "Today" checkbox
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.TODAY:Today`)
     * ```
     */
    readonly todayLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "Now" checkbox
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.NOW:Now`)
     * ```
     */
    readonly nowLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for "Date" field / radio button
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.DATE:Date`)
     * ```
     */
    readonly dateLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "Preview" title
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.PREVIEW:Preview`)
     * ```
     */
    readonly previewLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * Placeholder for date fields
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.DATE_PLACEHOLDER:Select date`)
     * ```
     */
    readonly datePlaceholder: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "Before" toggle
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.BEFORE:Before`)
     * ```
     */
    readonly beforeLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "After" toggle
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.AFTER:After`)
     * ```
     */
    readonly afterLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "Within" toggle
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.WITHIN:Within`)
     * ```
     */
    readonly withinLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "value" number input
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.VALUE:Value`)
     * ```
     */
    readonly valueLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "Unit" select
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.UNIT:Unit`)
     * ```
     */
    readonly unitLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "search" input
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.SEARCH:Search`)
     * ```
     */
    readonly searchLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "search" input
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.PRESETS:Presets`)
     * ```
     */
    readonly presetLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "advanced" switch
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.ADVANCED:Advanced`)
     * ```
     */
    readonly advancedLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /**
     * label for the "apply" switch
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_DATE_RANGE_FILTER.APPLY:Apply`)
     * ```
     */
    readonly applyLabel: _angular_core.InputSignal<_siemens_element_translate_ng_translate.TranslatableString>;
    /** Event fired when the apply button has been clicked */
    readonly applyClicked: _angular_core.OutputEmitterRef<void>;
    /** Base configuration on how the dates should be displayed, parts of it may be overwritten internally. */
    readonly datepickerConfig: _angular_core.InputSignal<DatepickerInputConfig | undefined>;
    protected readonly icons: Record<"elementDown2", string>;
    protected readonly advancedMode: _angular_core.WritableSignal<boolean>;
    protected readonly dateRange: _angular_core.WritableSignal<DateRange>;
    protected readonly point1Now: _angular_core.WritableSignal<boolean>;
    protected readonly point2Mode: _angular_core.WritableSignal<"duration" | "date">;
    protected readonly point1date: _angular_core.WritableSignal<Date>;
    protected readonly point2date: _angular_core.WritableSignal<Date>;
    protected readonly point2offset: _angular_core.WritableSignal<number>;
    protected readonly point2range: _angular_core.WritableSignal<"before" | "after" | "within">;
    protected readonly calculatedRange: _angular_core.Signal<ResolvedDateRange>;
    protected readonly pipeFormat: _angular_core.Signal<string>;
    protected readonly datepickerConfigInternal: _angular_core.Signal<DatepickerConfig>;
    protected readonly dateRangeConfig: _angular_core.Signal<DatepickerConfig>;
    protected readonly filteredPresetList: _angular_core.Signal<DateRangePreset[]>;
    protected readonly focusedDate: _angular_core.Signal<Date | undefined>;
    protected readonly presetFilter: _angular_core.WritableSignal<string>;
    protected readonly presetOpen: _angular_core.WritableSignal<boolean>;
    protected readonly inputMode: _angular_core.Signal<boolean>;
    ngOnChanges(changes: SimpleChanges<this>): void;
    private getDateNow;
    private rangeChanged;
    private updateFromRange;
    private resolve;
    protected updateDateRange(range?: DateRangeFilter): void;
    protected updateOnModeChange(): void;
    private updateSimpleMode;
    private updateRange;
    protected updateFromDateRange(dateRange?: DateRange): void;
    protected point1Changed(): void;
    protected point2Changed(): void;
    protected selectPresetItem(event: Event, item: DateRangePreset): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiDateRangeFilterComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<SiDateRangeFilterComponent, "si-date-range-filter", never, { "range": { "alias": "range"; "required": true; "isSignal": true; }; "presetList": { "alias": "presetList"; "required": false; "isSignal": true; }; "presetSearch": { "alias": "presetSearch"; "required": false; "isSignal": true; }; "enableTimeSelection": { "alias": "enableTimeSelection"; "required": false; "isSignal": true; }; "basicMode": { "alias": "basicMode"; "required": false; "isSignal": true; }; "reverseInputFields": { "alias": "reverseInputFields"; "required": false; "isSignal": true; }; "showApplyButton": { "alias": "showApplyButton"; "required": false; "isSignal": true; }; "hideAdvancedMode": { "alias": "hideAdvancedMode"; "required": false; "isSignal": true; }; "refLabel": { "alias": "refLabel"; "required": false; "isSignal": true; }; "fromLabel": { "alias": "fromLabel"; "required": false; "isSignal": true; }; "toLabel": { "alias": "toLabel"; "required": false; "isSignal": true; }; "rangeLabel": { "alias": "rangeLabel"; "required": false; "isSignal": true; }; "todayLabel": { "alias": "todayLabel"; "required": false; "isSignal": true; }; "nowLabel": { "alias": "nowLabel"; "required": false; "isSignal": true; }; "dateLabel": { "alias": "dateLabel"; "required": false; "isSignal": true; }; "previewLabel": { "alias": "previewLabel"; "required": false; "isSignal": true; }; "datePlaceholder": { "alias": "datePlaceholder"; "required": false; "isSignal": true; }; "beforeLabel": { "alias": "beforeLabel"; "required": false; "isSignal": true; }; "afterLabel": { "alias": "afterLabel"; "required": false; "isSignal": true; }; "withinLabel": { "alias": "withinLabel"; "required": false; "isSignal": true; }; "valueLabel": { "alias": "valueLabel"; "required": false; "isSignal": true; }; "unitLabel": { "alias": "unitLabel"; "required": false; "isSignal": true; }; "searchLabel": { "alias": "searchLabel"; "required": false; "isSignal": true; }; "presetLabel": { "alias": "presetLabel"; "required": false; "isSignal": true; }; "advancedLabel": { "alias": "advancedLabel"; "required": false; "isSignal": true; }; "applyLabel": { "alias": "applyLabel"; "required": false; "isSignal": true; }; "datepickerConfig": { "alias": "datepickerConfig"; "required": false; "isSignal": true; }; }, { "range": "rangeChange"; "applyClicked": "applyClicked"; }, never, never, true, never>;
}

declare class SiDateRangeFilterModule {
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiDateRangeFilterModule, never>;
    static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SiDateRangeFilterModule, never, [typeof SiDateRangeFilterComponent], [typeof SiDateRangeFilterComponent]>;
    static ɵinj: _angular_core.ɵɵInjectorDeclaration<SiDateRangeFilterModule>;
}

interface ResolveDateRangeOptions {
    /**
     * Resolve time? When set to false, hours/minutes/seconds/ms are set to zero
     * @defaultValue true
     **/
    withTime?: boolean;
    /**
     * Skip normalization? When skipped, `point1` will always be `start`, `point2` will be `end`
     */
    skipNormalization?: boolean;
}
/**
 * Service to transform and calculate with DateRangeFilter objects.
 */
declare class SiDateRangeCalculationService {
    /**
     * Calculates the start and end dates of a DateRangeFilter.
     * @param filter - The date range filter object to be resolved.
     * @param options - Options for time handling
     * @returns The resolved result in form of a ResolvedDateRange object.
     */
    resolveDateRangeFilter(filter: DateRangeFilter, options?: ResolveDateRangeOptions): ResolvedDateRange;
    private datePlusOffset;
    private normalize;
    /**
     * Utility to reset the time attributes to 0 (hours/minutes/seconds/milliseconds).
     */
    removeTime(date: Date): Date;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<SiDateRangeCalculationService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<SiDateRangeCalculationService>;
}

export { ONE_DAY, ONE_MINUTE, PresetMatchFilterPipe, SiDateRangeCalculationService, SiDateRangeFilterComponent, SiDateRangeFilterModule };
export type { DateRangeFilter, DateRangePreset, DateRangePresetCustom, DateRangePresetOffset, ResolveDateRangeOptions, ResolvedDateRange };
