import * as i0 from '@angular/core';
import { EventEmitter, TemplateRef, OnInit, OnDestroy, OnChanges, AfterViewInit, ElementRef, ChangeDetectorRef } from '@angular/core';
import { MobileMode, MobileModeBase, MobileModeConfig } from '@fundamental-ngx/core/mobile-mode';
import { Nullable } from '@fundamental-ngx/cdk/utils';
import { ControlValueAccessor, Validator } from '@angular/forms';
import { DaysOfWeek, FdCalendarView, CalendarYearGrid, CalendarComponent } from '@fundamental-ngx/core/calendar';
import { DatetimeAdapter, DateTimeFormats } from '@fundamental-ngx/core/datetime';
import { FormItemControl, PopoverFormMessageService } from '@fundamental-ngx/core/form';
import { Placement, SpecialDayRule } from '@fundamental-ngx/core/shared';
import { FormStates } from '@fundamental-ngx/cdk/forms';

interface DateTimePicker<D> extends MobileMode {
    date: Nullable<D>;
    isOpenChange: EventEmitter<boolean>;
    dialogApprove(): void;
    dialogDismiss(value: Nullable<D>): void;
}

declare class DatetimePickerMobileComponent<D> extends MobileModeBase<DateTimePicker<D>> {
    dateTimePickerConfig: {
        pickerTemplate: TemplateRef<any>;
    };
    /** @hidden */
    dialogTemplate: TemplateRef<any>;
    /** @hidden */
    private _selectedBackup;
    /** @hidden */
    constructor(dateTimePickerConfig: {
        pickerTemplate: TemplateRef<any>;
    }, datePickerComponent: DateTimePicker<D>);
    /** @hidden */
    handleApprove(): void;
    /** @hidden */
    handleDismiss(): void;
    /** @hidden */
    private _toggleDialog;
    /** @hidden */
    private _open;
    static ɵfac: i0.ɵɵFactoryDeclaration<DatetimePickerMobileComponent<any>, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DatetimePickerMobileComponent<any>, "fd-datetime-picker-mobile", never, {}, {}, never, never, true, never>;
}

/**
 * The datetime picker component is an opinionated composition of the fd-popover,
 * fd-calendar and fd-time components to accomplish the UI pattern for picking a date and time.
 * Supports Angular Forms.
 * ```html
 * <fd-date-time-picker [(ngModel)]="dateTime"></fd-date-time-picker>
 * ```
 */
declare class DatetimePickerComponent<D> implements DateTimePicker<D>, OnInit, OnDestroy, OnChanges, AfterViewInit, ControlValueAccessor, Validator, FormItemControl {
    private _elRef;
    private _changeDetRef;
    private _dateTimeAdapter;
    private _dateTimeFormats;
    private _popoverFormMessage;
    /** Placeholder for the inner input element. */
    placeholder: string;
    /**
     *  The placement of the popover. It can be one of: top, top-start, top-end, bottom,
     *  bottom-start, bottom-end, right, right-start, right-end, left, left-start, left-end.
     */
    placement: Placement;
    /** The element to which the popover should be appended. */
    appendTo: ElementRef;
    /** Whether the component is disabled. */
    disabled: boolean;
    /** Id attribute for input element inside DateTimePicker component */
    inputId: string;
    /** If it is mandatory field */
    required: boolean;
    /** Define a custom datetime format. Can be a string for DayjsDatetimeAdapter or object for FdDatetimeAdapter  */
    customDateTimeFormat: unknown;
    /**
     * Whether the time component should be meridian (am/pm).
     * Default value is based on the current locale format option
     * */
    meridian: boolean;
    /**
     * Whether the time component shows seconds.
     * Default value is based on the current locale format option
     * */
    displaySeconds: boolean;
    /** aria-labelledby for element describing date-picker. */
    ariaLabelledBy: Nullable<string>;
    /** Text displayed in message */
    set message(message: string);
    /** The trigger events that will open/close the message box.
     *  Accepts any [HTML DOM Events](https://www.w3schools.com/jsref/dom_obj_event.asp). */
    set messageTriggers(triggers: string[]);
    /**
     * Whether the time component shows minutes.
     * Default value is based on the current locale format option
     * */
    displayMinutes: boolean;
    /**
     * Whether the time component shows hours.
     * Default value is based on the current locale format option
     * */
    displayHours: boolean;
    /** Whether to perform visual validation on the picker input. */
    useValidation: boolean;
    /** Current selected date. Two-way binding is supported. */
    date: Nullable<D>;
    /** Whether the popover is open. Two-way binding is supported. */
    isOpen: boolean;
    /** The disableFunction for the calendar. */
    startingDayOfWeek: DaysOfWeek;
    /** Actually shown active view one of 'day' | 'month' | 'year' in calendar component*/
    activeView: FdCalendarView;
    /** Whether a null input is considered valid. */
    allowNull: boolean;
    /**
     * @Input when set to true time component will use 2 digits for each number.
     * For example 9 will become 09
     * but 12 will be kept as 12.
     * Only uses by time component and does not change input format
     */
    keepTwoDigitsTime: boolean;
    /**
     *  The state of the form control - applies css classes.
     *  Also this is applied to message.
     *  Can be `success`, `error`, `warning`, `information` or blank for default.
     */
    set state(state: FormStates);
    get state(): FormStates;
    /**
     * @deprecated Popover is toggled with f4 key
     */
    buttonFocusable: boolean;
    /**
     * Object to customize year grid,
     * Row, Columns and method to display year can be modified
     */
    yearGrid: CalendarYearGrid;
    /**
     * Object to customize aggregated year grid,
     * Row, Columns and method to display year can be modified
     */
    aggregatedYearGrid: CalendarYearGrid;
    /**
     * Whether user wants to mark sunday/saturday with `fd-calendar__item--weekend` class
     */
    markWeekends: boolean;
    /** @Input Whether to show spinner buttons */
    spinnerButtons: boolean;
    /**
     * Whether user wants to show week numbers next to days
     */
    showWeekNumbers: boolean;
    /** Whether or not to show the datetime picker footer with OK/cancel buttons. */
    showFooter: boolean;
    /**
     * Whether to recalculate value from the input as user types or on blur.
     * By default, updates the value as user types.
     * @default false
     */
    processInputOnBlur: boolean;
    /**
     * Whether to prevent page scrolling when focusing date picker input field after calendar has been closed.
     */
    preventScrollOnFocus: boolean;
    /** Whether to render datetime picker in mobile mode. */
    mobile: boolean;
    /** Mobile mode configuration. */
    mobileConfig: MobileModeConfig;
    /** Whether calendar is used inside mobile in landscape mode, it also adds close button on right side */
    mobileLandscape: boolean;
    /** Whether calendar is used inside mobile in portrait mode */
    mobilePortrait: boolean;
    /** To set input width 100% */
    isFullWidth: boolean;
    /** Event emitted when the state of the isOpen property changes. */
    isOpenChange: EventEmitter<boolean>;
    /** Event thrown every time calendar active view is changed */
    readonly activeViewChange: EventEmitter<FdCalendarView>;
    /** Event emitted when the date changes. This can be a time or day change. */
    readonly dateChange: EventEmitter<D>;
    /** Event emitted when the day changes from the calendar. */
    readonly calendarChange: EventEmitter<D>;
    /** Event emitted when the time changes from the time component. */
    readonly timeChange: EventEmitter<D>;
    /** Event emitted when popover closes. */
    readonly onClose: EventEmitter<void>;
    /** Event emitted when datepicker changes it's "touched" state. */
    readonly touched: EventEmitter<void>;
    /** @hidden */
    _inputGroupElement: ElementRef;
    /** @hidden */
    _inputElement: ElementRef<HTMLInputElement>;
    /** @hidden */
    private readonly _formMessageTemplate;
    /** @hidden */
    private readonly _pickerTemplate;
    /**
     * Special days mark, it can be used by passing array of object with
     * Special day number, list 1-20 [class:`fd-calendar__item--legend-{{number}}`] is available there:
     * https://sap.github.io/fundamental-styles/components/calendar.html calendar special days section
     * Rule accepts method with FdDate object as a parameter. ex:
     * `rule: (fdDate: FdDate) => fdDate.getDay() === 1`, which will mark all sundays as special day.
     */
    specialDaysRules: i0.InputSignal<SpecialDayRule<D>[]>;
    /**
     * Whether to show the calendar legend below the calendar.
     * The legend displays explanations for special day markers.
     */
    showCalendarLegend: i0.InputSignalWithTransform<boolean, unknown>;
    /**
     * Whether the calendar legend should display in a single column layout.
     * When false (default), the legend items flow into multiple columns automatically.
     */
    legendCol: i0.InputSignalWithTransform<boolean, unknown>;
    /** Indicates when datetime input is in invalid state. */
    get isInvalidDateInput(): boolean;
    /** @hidden Reference to the inner calendar component. */
    private set _calendarCmp(value);
    /** @hidden */
    _calendarComponent: CalendarComponent<D>;
    /** @hidden */
    _message: string | null;
    /** @hidden */
    _messageTriggers: string[];
    /**
     * @hidden
     * Date of the input field. Internal use.
     * For programmatic selection, use two-way binding on the date input.
     */
    _inputFieldDate: string | null;
    /** @hidden */
    _isInvalidDateInput: boolean;
    /** @hidden The temporary Time object for use before 'OK' is pressed. Internal use. */
    _tempTime: Nullable<D>;
    /** @hidden The temporary CalendarDay object for use before 'OK' is pressed. Internal use. */
    _tempDate: Nullable<D>;
    /** @hidden */
    _meridian: boolean;
    /** @hidden */
    _displaySeconds: boolean;
    /** @hidden */
    _displayMinutes: boolean;
    /** @hidden */
    _displayHours: boolean;
    /** @hidden whether to display date or time in mobile mode */
    _displayType: 'date' | 'time';
    /** @hidden */
    _showPopoverContents: boolean;
    /** @hidden */
    private _state;
    /** @hidden */
    private _calendarPendingDate;
    /** @hidden */
    private readonly _injector;
    /** @hidden */
    private readonly _dynamicComponentService;
    /** @hidden */
    private readonly _focusTrapService;
    /** @hidden */
    private _mobileComponentRef;
    /** @hidden */
    private _subscriptions;
    /** @hidden */
    private _touched;
    /** @hidden */
    constructor(_elRef: ElementRef, _changeDetRef: ChangeDetectorRef, _dateTimeAdapter: DatetimeAdapter<D>, _dateTimeFormats: DateTimeFormats, _popoverFormMessage: PopoverFormMessageService);
    /**
     * Function used to disable certain dates in the calendar.
     * @param fdDate FdDate
     */
    disableFunction: (value: D) => boolean;
    /** @hidden */
    onChange: (value: D | null) => void;
    /** @hidden */
    onTouched: () => void;
    /** @hidden */
    ngOnChanges(changes: any): void;
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    ngOnDestroy(): void;
    /** @hidden */
    ngAfterViewInit(): void;
    /**
     * @hidden
     * Function that implements Validator Interface, adds validation support for forms
     */
    validate(): {
        [key: string]: any;
    } | null;
    /** Toggles the popover. */
    togglePopover(): void;
    /**
     * Method that handles calendar active view change and throws event.
     */
    handleCalendarActiveViewChange(activeView: FdCalendarView): void;
    /** Method that handles blur events on datetime picker input */
    handleOnTouched(event?: FocusEvent): void;
    /** Opens the popover. */
    openPopover(): void;
    /** Closes the popover and refresh model */
    closePopover(): void;
    /** @hidden */
    setInvalidDateInputHandler(isInvalid: boolean): void;
    /** @hidden */
    registerOnChange(fn: (selected: any) => {
        void: any;
    }): void;
    /** @hidden */
    registerOnTouched(fn: any): void;
    /** @hidden */
    setDisabledState(isDisabled: boolean): void;
    /**
     * @hidden
     * Function that provides support for ControlValueAccessor that allows to use [(ngModel)] or forms
     */
    writeValue(selected: Nullable<D>): void;
    /**
     * @hidden
     * Method that is triggered by events from calendar component, when there is selected date changed.
     * If invalid time model is detected, it takes time model data from TimeComponent.
     */
    handleDateChange(date: D): void;
    /**
     * @hidden
     * Method that is triggered by events from time component, when there is selected time changed
     */
    handleTimeChange(time: D): void;
    /**
     * @hidden
     * Method that is triggered when 'OK' button is pressed.
     */
    submit(): void;
    /**
     * @hidden
     * Function that is called when 'Cancel' button is pressed.
     */
    cancel(): void;
    /**
     * @hidden
     * Looks like no one uses it. Should be removed?
     */
    focusArrowLeft(): void;
    /**
     * @hidden
     * Method, which is responsible for transforming string to datetime, depending on type or
     * validation the results are different. It also changes to state of _isInvalidDateInput.
     */
    handleInputChange(inputStr: string, isTypeEvent: boolean): void;
    /** @hidden */
    dialogApprove(): void;
    /** Method used to restore original value for mobile mode. */
    dialogDismiss(value: D): void;
    /** @hidden */
    _changeMessageVisibility(): void;
    /** @hidden */
    _onOpenStateChanged(isOpen: boolean): void;
    /** Method that provides information if model selected date/dates have properly types and are valid */
    isCurrentModelValid(): boolean;
    /** Method that provides information if FdDateTime passed as arg has properly types and is valid */
    private _isModelValid;
    /** @hidden */
    private _setInput;
    /** @hidden */
    private _refreshCurrentlyDisplayedCalendarDate;
    /**
     * @hidden
     * Format date time entity.
     */
    private _formatDateTime;
    /** @hidden */
    private _InitialiseVariablesInMessageService;
    /** @hidden */
    private _parseDate;
    /** @hidden */
    private _setTempDateTime;
    /** @hidden */
    private _calculateTimeOptions;
    /** @hidden */
    private _setUpMobileMode;
    static ɵfac: i0.ɵɵFactoryDeclaration<DatetimePickerComponent<any>, [null, null, { optional: true; }, { optional: true; }, null]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DatetimePickerComponent<any>, "fd-datetime-picker", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "appendTo": { "alias": "appendTo"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "inputId": { "alias": "inputId"; "required": false; }; "required": { "alias": "required"; "required": false; }; "customDateTimeFormat": { "alias": "customDateTimeFormat"; "required": false; }; "meridian": { "alias": "meridian"; "required": false; }; "displaySeconds": { "alias": "displaySeconds"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "message": { "alias": "message"; "required": false; }; "messageTriggers": { "alias": "messageTriggers"; "required": false; }; "displayMinutes": { "alias": "displayMinutes"; "required": false; }; "displayHours": { "alias": "displayHours"; "required": false; }; "useValidation": { "alias": "useValidation"; "required": false; }; "date": { "alias": "date"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; "startingDayOfWeek": { "alias": "startingDayOfWeek"; "required": false; }; "activeView": { "alias": "activeView"; "required": false; }; "allowNull": { "alias": "allowNull"; "required": false; }; "keepTwoDigitsTime": { "alias": "keepTwoDigitsTime"; "required": false; }; "state": { "alias": "state"; "required": false; }; "buttonFocusable": { "alias": "buttonFocusable"; "required": false; }; "yearGrid": { "alias": "yearGrid"; "required": false; }; "aggregatedYearGrid": { "alias": "aggregatedYearGrid"; "required": false; }; "markWeekends": { "alias": "markWeekends"; "required": false; }; "spinnerButtons": { "alias": "spinnerButtons"; "required": false; }; "showWeekNumbers": { "alias": "showWeekNumbers"; "required": false; }; "showFooter": { "alias": "showFooter"; "required": false; }; "processInputOnBlur": { "alias": "processInputOnBlur"; "required": false; }; "preventScrollOnFocus": { "alias": "preventScrollOnFocus"; "required": false; }; "mobile": { "alias": "mobile"; "required": false; }; "mobileConfig": { "alias": "mobileConfig"; "required": false; }; "mobileLandscape": { "alias": "mobileLandscape"; "required": false; }; "mobilePortrait": { "alias": "mobilePortrait"; "required": false; }; "isFullWidth": { "alias": "isFullWidth"; "required": false; }; "specialDaysRules": { "alias": "specialDaysRules"; "required": false; "isSignal": true; }; "showCalendarLegend": { "alias": "showCalendarLegend"; "required": false; "isSignal": true; }; "legendCol": { "alias": "legendCol"; "required": false; "isSignal": true; }; "disableFunction": { "alias": "disableFunction"; "required": false; }; }, { "isOpenChange": "isOpenChange"; "activeViewChange": "activeViewChange"; "dateChange": "dateChange"; "calendarChange": "calendarChange"; "timeChange": "timeChange"; "onClose": "onClose"; "touched": "touched"; }, never, ["*"], true, never>;
    static ngAcceptInputType_processInputOnBlur: unknown;
}

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
declare class DatetimePickerModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<DatetimePickerModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<DatetimePickerModule, never, [typeof DatetimePickerComponent, typeof DatetimePickerMobileComponent], [typeof DatetimePickerComponent, typeof DatetimePickerMobileComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<DatetimePickerModule>;
}

export { DatetimePickerComponent, DatetimePickerMobileComponent, DatetimePickerModule };
export type { DateTimePicker };
