import * as _angular_core from '@angular/core';
import { OnInit, OnChanges, AfterViewInit, ChangeDetectorRef, EventEmitter, SimpleChanges, TemplateRef } from '@angular/core';
import { DropdownOverlay } from '@agorapulse/ui-components/dropdown-base';
import dayjs from 'dayjs';
import { SymbolRegistry } from '@agorapulse/ui-symbol';
import { DaterangepickerComponent } from '@agorapulse/ngx-daterangepicker-material';
import { ControlValueAccessor } from '@angular/forms';

declare enum DatepickerMode {
    Single = "Single",
    Multiple = "Multiple",
    Range = "Range"
}
interface Period {
    startDate?: dayjs.Dayjs;
    endDate?: dayjs.Dayjs;
}
interface StartDate {
    startDate: dayjs.Dayjs;
}
interface I18nDatePicker {
    ranges: {
        yesterday: string;
        lastWeek: string;
        last30Days: string;
        lastMonth: string;
        thisMonth: string;
        [other: string]: string;
    };
}
type FirstDayOfWeek = 'sunday' | 'monday';
type Locale = 'en' | 'fr' | 'es' | 'de';
type RangesConfigPresetType = {
    [periodText: string]: [dayjs.Dayjs, dayjs.Dayjs];
};
declare const RangesConfigPreset: {
    yesterday: [dayjs.Dayjs, dayjs.Dayjs];
    lastWeek: [dayjs.Dayjs, dayjs.Dayjs];
    last30Days: [dayjs.Dayjs, dayjs.Dayjs];
    lastMonth: [dayjs.Dayjs, dayjs.Dayjs];
    thisMonth: [dayjs.Dayjs, dayjs.Dayjs];
    lastWeekFromToday: [dayjs.Dayjs, dayjs.Dayjs];
    lastMonthFromToday: [dayjs.Dayjs, dayjs.Dayjs];
    last3MonthsFromToday: [dayjs.Dayjs, dayjs.Dayjs];
    last6MonthsFromToday: [dayjs.Dayjs, dayjs.Dayjs];
    lastYearFromToday: [dayjs.Dayjs, dayjs.Dayjs];
};
declare class DatepickerComponent implements OnInit, OnChanges, AfterViewInit {
    changeDetectorRef: ChangeDetectorRef;
    symbolRegistry: SymbolRegistry;
    datepickerRef: DaterangepickerComponent;
    firstDayOfWeek: string;
    i18n: I18nDatePicker;
    locale: string;
    set maxDate(maxDate: dayjs.Dayjs | undefined);
    set minDate(minDate: dayjs.Dayjs | undefined);
    mode: DatepickerMode;
    selectedDate: dayjs.Dayjs | undefined;
    selectedDates: dayjs.Dayjs[];
    selectedPeriod: Period;
    showRanges: boolean;
    showCustomRangeLabel: _angular_core.InputSignal<boolean>;
    dateSelected: EventEmitter<any>;
    periodSelected: EventEmitter<Period>;
    DatepickerMode: typeof DatepickerMode;
    doubleCalendarWidth: number;
    localeConfig: {
        customRangeLabel: string;
        daysOfWeek: string[];
        monthNames: string[];
        firstDay: number;
    };
    rangesConfig: _angular_core.InputSignal<RangesConfigPresetType | null>;
    ranges: RangesConfigPresetType;
    rangePickerWidth: number;
    width: number;
    pageSet: boolean;
    maxDateStr: string;
    minDateStr: string;
    constructor(changeDetectorRef: ChangeDetectorRef, symbolRegistry: SymbolRegistry);
    ngOnInit(): void;
    ngOnChanges(changes: SimpleChanges): void;
    ngAfterViewInit(): void;
    initDatePickerLocale(): void;
    private initRanges;
    isCustomDate: (date: any) => string[];
    private isSelected;
    onStartDateChanged(event: StartDate): void;
    onDatesUpdated(event: Period): void;
    onNextMonth(): void;
    onPreviousMonth(): void;
    /**
     * Ugly hack used here to open the calendar on the right day if they are selected dates
     *      * https://github.com/fetrarij/ngx-daterangepicker-material/issues/139
     */
    setCalendarCurrentPage(): void;
    setWidth(): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<DatepickerComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatepickerComponent, "ap-datepicker", never, { "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; }; "i18n": { "alias": "i18n"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "mode": { "alias": "mode"; "required": true; }; "selectedDate": { "alias": "selectedDate"; "required": false; }; "selectedDates": { "alias": "selectedDates"; "required": false; }; "selectedPeriod": { "alias": "selectedPeriod"; "required": false; }; "showRanges": { "alias": "showRanges"; "required": false; }; "showCustomRangeLabel": { "alias": "showCustomRangeLabel"; "required": false; "isSignal": true; }; "rangesConfig": { "alias": "rangesConfig"; "required": false; "isSignal": true; }; }, { "dateSelected": "dateSelected"; "periodSelected": "periodSelected"; }, never, never, true, never>;
}

/**
 * A dropdown component that displays a datepicker (single, multiple, or range mode)
 * in an overlay. Exposes open/close/toggle so it can be driven by apDropdownTrigger.
 */
declare class DatepickerDropdownComponent implements DropdownOverlay {
    datepickerDropdownTemplate: _angular_core.Signal<TemplateRef<unknown> | undefined>;
    mode: _angular_core.InputSignal<DatepickerMode>;
    selectedDate: _angular_core.InputSignal<dayjs.Dayjs | undefined>;
    selectedDates: _angular_core.InputSignal<dayjs.Dayjs[]>;
    selectedPeriod: _angular_core.InputSignal<Period>;
    minDate: _angular_core.InputSignal<dayjs.Dayjs | undefined>;
    maxDate: _angular_core.InputSignal<dayjs.Dayjs | undefined>;
    firstDayOfWeek: _angular_core.InputSignal<"sunday" | "monday">;
    locale: _angular_core.InputSignal<string>;
    i18n: _angular_core.InputSignal<I18nDatePicker | undefined>;
    protected readonly effectiveI18n: _angular_core.Signal<I18nDatePicker>;
    showRanges: _angular_core.InputSignal<boolean>;
    showCustomRangeLabel: _angular_core.InputSignal<boolean>;
    rangesConfig: _angular_core.InputSignal<RangesConfigPresetType | null>;
    showBackdrop: _angular_core.InputSignal<boolean>;
    disabled: _angular_core.InputSignal<boolean>;
    defaultPosition: _angular_core.InputSignal<"left" | "right">;
    opened: _angular_core.OutputEmitterRef<void>;
    closed: _angular_core.OutputEmitterRef<void>;
    dateSelected: _angular_core.OutputEmitterRef<dayjs.Dayjs>;
    periodSelected: _angular_core.OutputEmitterRef<Period>;
    private readonly overlay;
    readonly isOpen: _angular_core.Signal<boolean>;
    open(triggerElement?: HTMLElement): void;
    close(): void;
    toggle(triggerElement?: HTMLElement): void;
    onDateSelected(date: dayjs.Dayjs): void;
    onPeriodSelected(period: Period): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<DatepickerDropdownComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatepickerDropdownComponent, "ap-datepicker-dropdown", never, { "mode": { "alias": "mode"; "required": true; "isSignal": true; }; "selectedDate": { "alias": "selectedDate"; "required": false; "isSignal": true; }; "selectedDates": { "alias": "selectedDates"; "required": false; "isSignal": true; }; "selectedPeriod": { "alias": "selectedPeriod"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "i18n": { "alias": "i18n"; "required": false; "isSignal": true; }; "showRanges": { "alias": "showRanges"; "required": false; "isSignal": true; }; "showCustomRangeLabel": { "alias": "showCustomRangeLabel"; "required": false; "isSignal": true; }; "rangesConfig": { "alias": "rangesConfig"; "required": false; "isSignal": true; }; "showBackdrop": { "alias": "showBackdrop"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "defaultPosition": { "alias": "defaultPosition"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; "dateSelected": "dateSelected"; "periodSelected": "periodSelected"; }, never, never, true, never>;
}

declare const defaultPeriodSelected: Period;
declare class InputDatepickerComponent implements ControlValueAccessor {
    mode: _angular_core.InputSignal<DatepickerMode>;
    label: _angular_core.InputSignal<string | undefined>;
    placeholder: _angular_core.InputSignal<string>;
    firstDayOfWeek: _angular_core.InputSignal<FirstDayOfWeek>;
    locale: _angular_core.InputSignal<Locale>;
    dateFormat: _angular_core.InputSignal<string>;
    disabled: _angular_core.InputSignal<boolean>;
    minDate: _angular_core.InputSignal<dayjs.Dayjs | undefined>;
    maxDate: _angular_core.InputSignal<dayjs.Dayjs | undefined>;
    selectedDate: _angular_core.InputSignal<dayjs.Dayjs | undefined>;
    selectedDates: _angular_core.InputSignal<dayjs.Dayjs[]>;
    selectedPeriod: _angular_core.InputSignal<Period | undefined>;
    i18n: _angular_core.InputSignal<I18nDatePicker | undefined>;
    showRanges: _angular_core.InputSignal<boolean>;
    showCustomRangeLabel: _angular_core.InputSignal<boolean>;
    rangesConfig: _angular_core.InputSignal<RangesConfigPresetType | null>;
    showBackdrop: _angular_core.InputSignal<boolean>;
    defaultPosition: _angular_core.InputSignal<"left" | "right">;
    periodRange: _angular_core.WritableSignal<Period>;
    isDisabled: _angular_core.WritableSignal<boolean>;
    periodChanged: _angular_core.OutputEmitterRef<Period>;
    dateSelected: _angular_core.OutputEmitterRef<dayjs.Dayjs>;
    displayedDate: _angular_core.Signal<string>;
    initPeriodRange: _angular_core.EffectRef;
    onTouched: () => void;
    onChange: (value: Period) => void;
    onPeriodSelected(period: Period): void;
    writeValue(value: Period): void;
    registerOnChange(fn: (value: Period) => void): void;
    registerOnTouched(fn: () => void): void;
    setDisabledState(isDisabled: boolean): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<InputDatepickerComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<InputDatepickerComponent, "ap-input-datepicker", never, { "mode": { "alias": "mode"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "dateFormat": { "alias": "dateFormat"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "selectedDate": { "alias": "selectedDate"; "required": false; "isSignal": true; }; "selectedDates": { "alias": "selectedDates"; "required": false; "isSignal": true; }; "selectedPeriod": { "alias": "selectedPeriod"; "required": false; "isSignal": true; }; "i18n": { "alias": "i18n"; "required": false; "isSignal": true; }; "showRanges": { "alias": "showRanges"; "required": false; "isSignal": true; }; "showCustomRangeLabel": { "alias": "showCustomRangeLabel"; "required": false; "isSignal": true; }; "rangesConfig": { "alias": "rangesConfig"; "required": false; "isSignal": true; }; "showBackdrop": { "alias": "showBackdrop"; "required": false; "isSignal": true; }; "defaultPosition": { "alias": "defaultPosition"; "required": false; "isSignal": true; }; }, { "periodChanged": "periodChanged"; "dateSelected": "dateSelected"; }, never, never, true, never>;
}

export { DatepickerComponent, DatepickerDropdownComponent, DatepickerMode, InputDatepickerComponent, RangesConfigPreset, defaultPeriodSelected };
export type { FirstDayOfWeek, I18nDatePicker, Locale, Period, RangesConfigPresetType, StartDate };
