import { AfterContentInit, DoCheck, ElementRef, EventEmitter, InjectionToken, OnDestroy, Renderer2 } from '@angular/core';
import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from '@angular/forms';
import { DateAdapter, ErrorStateMatcher, KbqDateFormats } from '@koobiq/components/core';
import { KbqFormFieldControl } from '@koobiq/components/form-field';
import { KbqWarningTooltipTrigger } from '@koobiq/components/tooltip';
import { Subject } from 'rxjs';
import { KbqCalendar } from './calendar.component';
import { KbqDatepicker } from './datepicker.component';
import * as i0 from "@angular/core";
export declare const MAX_YEAR = 9999;
/** @docs-private */
export declare const KBQ_DATEPICKER_VALUE_ACCESSOR: any;
/** @docs-private */
export declare const KBQ_DATEPICKER_VALIDATORS: any;
/** default configuration of datepicker */
/** @docs-private */
export declare const KBQ_DATEPICKER_DEFAULT_CONFIGURATION: {
    placeholder: string;
    dateInput: string;
};
/** Injection Token for providing configuration of datepicker */
/** @docs-private */
export declare const KBQ_DATEPICKER_CONFIGURATION: InjectionToken<unknown>;
/**
 * An event used for datepicker input and change events. We don't always have access to a native
 * input or change event because the event may have been triggered by the user clicking on the
 * calendar popup. For consistency, we always use KbqDatepickerInputEvent instead.
 */
export declare class KbqDatepickerInputEvent<D> {
    /** Reference to the datepicker input component that emitted the event. */
    target: KbqDatepickerInput<D>;
    /** Reference to the native input element associated with the datepicker input. */
    targetElement: HTMLElement;
    /** The new value for the target datepicker input. */
    value: D | null;
    constructor(
    /** Reference to the datepicker input component that emitted the event. */
    target: KbqDatepickerInput<D>, 
    /** Reference to the native input element associated with the datepicker input. */
    targetElement: HTMLElement);
}
/** Directive used to connect an input to a KbqDatepicker. */
export declare class KbqDatepickerInput<D> implements KbqFormFieldControl<D>, ControlValueAccessor, Validator, OnDestroy, DoCheck, AfterContentInit {
    elementRef: ElementRef<HTMLInputElement>;
    private readonly renderer;
    readonly adapter: DateAdapter<D>;
    private readonly dateFormats;
    /** @docs-private */
    protected readonly localeService: import("@koobiq/components/core").KbqLocaleService | null;
    protected readonly externalConfiguration: unknown;
    protected configuration: any;
    readonly stateChanges: Subject<void>;
    controlType: string;
    focused: boolean;
    datepicker: KbqDatepicker<D>;
    calendar: KbqCalendar<D>;
    dateFilter: (date: D | null) => boolean;
    /** Emits when the value changes (either due to user input or programmatic change). */
    valueChange: EventEmitter<D | null>;
    /** Emits when the disabled state has changed */
    disabledChange: EventEmitter<boolean>;
    /** Object used to control when error messages are shown. */
    get errorStateMatcher(): ErrorStateMatcher;
    set errorStateMatcher(value: ErrorStateMatcher);
    get placeholder(): string;
    set placeholder(value: string);
    private _placeholder;
    get required(): boolean;
    set required(value: boolean);
    private _required;
    /** The datepicker that this input is associated with. */
    set kbqDatepicker(value: KbqDatepicker<D>);
    /** The calendar that this input is associated with. */
    set kbqCalendar(value: KbqCalendar<D>);
    /** Function that can be used to filter out dates within the datepicker. */
    set kbqDatepickerFilter(value: (date: D | null) => boolean);
    /** The value of the input. */
    get value(): D | null;
    set value(value: D | null);
    private _value;
    /** The minimum valid date. */
    get min(): D | null;
    set min(value: D | null);
    private _min;
    /** The maximum valid date. */
    get max(): D | null;
    set max(value: D | null);
    private _max;
    /** Whether the datepicker-input is disabled. */
    get disabled(): boolean;
    set disabled(value: boolean);
    private _disabled;
    get id(): string;
    set id(value: string);
    private _id;
    set kbqValidationTooltip(tooltip: KbqWarningTooltipTrigger);
    readonly incorrectInput: EventEmitter<void>;
    /** Emits when a `change` event is fired on this `<input>`. */
    readonly dateChange: EventEmitter<KbqDatepickerInputEvent<D>>;
    /** Emits when an `input` event is fired on this `<input>`. */
    readonly dateInput: EventEmitter<KbqDatepickerInputEvent<D>>;
    get empty(): boolean;
    get viewValue(): string;
    get ngControl(): any;
    get isReadOnly(): boolean;
    get dateInputFormat(): string;
    get errorState(): boolean;
    set errorState(value: boolean);
    private get readyForParse();
    private get selectionStart();
    private set selectionStart(value);
    private get selectionEnd();
    private set selectionEnd(value);
    private control;
    private readonly uid;
    private datepickerSubscription;
    /** Whether the last value set on the input was valid. */
    private lastValueValid;
    /** The combined form control validator for this input. */
    private readonly validator;
    private separator;
    private firstDigit;
    private secondDigit;
    private thirdDigit;
    private separatorPositions;
    private errorStateTracker;
    constructor(elementRef: ElementRef<HTMLInputElement>, renderer: Renderer2, adapter: DateAdapter<D>, dateFormats: KbqDateFormats);
    ngDoCheck(): void;
    onContainerClick(): void;
    focus(): void;
    focusChanged(isFocused: boolean): void;
    onTouched: () => void;
    ngAfterContentInit(): void;
    ngOnDestroy(): void;
    /** @docs-private */
    registerOnValidatorChange(fn: () => void): void;
    /** @docs-private */
    validate(control: AbstractControl): ValidationErrors | null;
    writeValue(value: D): void;
    registerOnChange(fn: (value: any) => void): void;
    registerOnTouched(fn: () => void): void;
    setDisabledState(isDisabled: boolean): void;
    onKeyDown(event: KeyboardEvent): void;
    onInput: () => void;
    parseOnBlur: () => any;
    onChange(): void;
    /** Handles blur events on the input. */
    onBlur(): void;
    onPaste($event: any): any;
    toISO8601(value: D): string;
    /** Refreshes the error state of the input. */
    updateErrorState(): void;
    private saveTimePart;
    private updateLocaleParams;
    private initDefaultParams;
    private setFormat;
    private updateValue;
    private isKeyForClose;
    private isKeyForOpen;
    private isLetterKey;
    private isKeyForByPass;
    private spaceKeyHandler;
    private getNewValue;
    private setViewValue;
    private replaceSymbols;
    private getDateFromString;
    private getDefaultValue;
    private getTimeStringFromDate;
    private getDateEditMetrics;
    private isMaxMonth;
    private isMinMonth;
    private isMaxYear;
    private isMinYear;
    private getMaxDate;
    private getMinDate;
    private getMaxMonth;
    private getMinMonth;
    private getMaxYear;
    private getMinYear;
    private incrementDate;
    private getLastDayFor;
    private decrementDate;
    private verticalArrowKeyHandler;
    private changeCaretPosition;
    private fixEmptyDigit;
    private selectDigitByCursor;
    private selectNextDigitByCursor;
    private selectNextDigit;
    /** Checks whether the input is invalid based on the native validation. */
    private isBadInput;
    private cvaOnChange;
    private validatorOnChange;
    /** The form control validator for whether the input parses. */
    private parseValidator;
    /** The form control validator for the min date. */
    private minValidator;
    /** The form control validator for the max date. */
    private maxValidator;
    /** The form control validator for the date filter. */
    private filterValidator;
    /** Formats a value and sets it on the input element. */
    private formatValue;
    private setControl;
    /**
     * @param obj The object to check.
     * @returns The given object if it is both a date instance and valid, otherwise null.
     */
    private getValidDateOrNull;
    private getDigitPositions;
    private createDate;
    private createDateTime;
    private correctCursorPosition;
    static ɵfac: i0.ɵɵFactoryDeclaration<KbqDatepickerInput<any>, [null, null, { optional: true; }, { optional: true; }]>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<KbqDatepickerInput<any>, "input[kbqDatepicker], input[kbqCalendar]", ["kbqDatepickerInput"], { "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "required": { "alias": "required"; "required": false; }; "kbqDatepicker": { "alias": "kbqDatepicker"; "required": false; }; "kbqCalendar": { "alias": "kbqCalendar"; "required": false; }; "kbqDatepickerFilter": { "alias": "kbqDatepickerFilter"; "required": false; }; "value": { "alias": "value"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "id": { "alias": "id"; "required": false; }; "kbqValidationTooltip": { "alias": "kbqValidationTooltip"; "required": false; }; }, { "incorrectInput": "incorrectInput"; "dateChange": "dateChange"; "dateInput": "dateInput"; }, never, never, false, never>;
}
