import { AfterContentInit, EventEmitter, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
import { Subscription } from 'rxjs';
import * as i0 from "@angular/core";
/**
 * @description
 * A directive that adds maxLength functionality to input and textarea elements with visual feedback.
 * It shows the remaining characters count and provides visual indication when the limit is reached.
 *
 * @selector input[euiMaxlength], textarea[euiMaxlength], [ngModel][euiMaxlength], [formControlName][euiMaxlength]
 *
 * @example
 * ```HTML
 * <!-- Basic usage -->
 * <input [euiMaxlength]="50">
 *
 * <!-- With form control -->
 * <input [formControlName]="'name'" [euiMaxlength]="100">
 *
 * <!-- Hide maxlength indicator -->
 * <textarea [euiMaxlength]="200" [isShowMaxlength]="false"></textarea>
 * ```
 *
 * @publicApi
 */
export declare class EuiMaxLengthDirective implements AfterContentInit, OnDestroy, OnChanges {
    /**
     * @description
     * It accepts number values to indicate the maxLength of an input. To reset or disable it set the value to null.
     * NULL value will remove any MaxLength indicator even if another input like isShowMaxlength equals true.
     */
    maxLength: number;
    /**
     * @description
     * Controls the visibility of the maxLength indicator.
     * When true, shows a counter with remaining characters.
     * When false, hides the counter but maintains the maxLength restriction.
     *
     * @default true
     */
    isShowMaxlength: boolean;
    /**
     * @description
     * Emits when the input value length reaches or exceeds the maxLength limit.
     * Emits true when a limit is reached, false when below limit.
     *
     * @emits {boolean} True when max length is reached, false otherwise
     */
    maxLengthReached: EventEmitter<boolean>;
    valueChangesSubscription: Subscription;
    private maxLengthSpan;
    private wrapper;
    private lengthCalcFn;
    private el;
    private renderer;
    private control;
    constructor();
    ngOnDestroy(): void;
    ngOnChanges(changes: SimpleChanges): void;
    ngAfterContentInit(): void;
    onChange(event: Event): void;
    onInput(event: KeyboardEvent): void;
    onPaste(event: ClipboardEvent): void;
    /**
     * Sets a custom function to calculate the length of the input value.
     * Useful for implementing custom length calculation logic (e.g., counting characters differently).
     *
     * @param fn Function that takes a string input and returns its calculated length
     *
     * @example
     * ```typescript
     * // Custom length calculation excluding spaces
     * directive.setLengthCalcFactory((value: string) => value.replace(/\s/g, '').length);
     * ```
     */
    setLengthCalcFactory(fn: (input: string) => number): void;
    /**
     * Calculates the maximum length for the input element based on current value or provided value.
     *
     * @param value Optional value to calculate max length against (overrides the current input value)
     * @returns {number} Calculated maximum length
     * @private
     */
    private calculateMaxLength;
    /**
     * @description
     * Refreshes the visual state of the maxLength indicator and updates input restrictions.
     * - Updates the remaining characters count
     * - Applies/removes error styling
     * - Emits maxLengthReached event
     * - Truncates value if it exceeds maxLength
     *
     * @private
     */
    private _refreshValue;
    /**
     * @description
     * Creates the maxLength indicator box in the DOM.
     * Wraps the input element and adds the counter span with appropriate styling.
     *
     * @private
     */
    private createMaxLengthBox;
    /**
     * @description
     * Removes the maxLength indicator box from the DOM.
     * Restores the original DOM structure by unwrapping the input element.
     *
     * @private
     */
    private destroyMaxLengthBox;
    /**
     * @description
     * Returns the current value of the input element.
     * Handles different update strategies when used with forms.
     *
     * @returns {string} Current input value
     * @private
     */
    private getValue;
    static ɵfac: i0.ɵɵFactoryDeclaration<EuiMaxLengthDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<EuiMaxLengthDirective, "    input[euiMaxlength],    textarea[euiMaxlength],    [ngModel][euiMaxlength],    [formControlName][euiMaxlength]", never, { "maxLength": { "alias": "euiMaxlength"; "required": false; }; "isShowMaxlength": { "alias": "isShowMaxlength"; "required": false; }; }, { "maxLengthReached": "maxLengthReached"; }, never, never, true, never>;
    static ngAcceptInputType_maxLength: unknown;
    static ngAcceptInputType_isShowMaxlength: unknown;
}
/**
 * @description
 * Module that provides the EuiMaxLengthDirective.
 * Import this module to use the directive in your application.
 *
 * @deprecated Use {@link `EuiMaxLengthDirective`} instead.
 *
 * @example
 * ```typescript
 * @NgModule({
 *   imports: [EuiMaxLengthDirectiveModule]
 * })
 * export class MyModule { }
 * ```
 *
 * @deprecated Use {@link `EuiMaxLengthDirective`} instead.
 * @publicApi
 */
export declare class EuiMaxLengthDirectiveModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<EuiMaxLengthDirectiveModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<EuiMaxLengthDirectiveModule, never, [typeof EuiMaxLengthDirective], [typeof EuiMaxLengthDirective]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<EuiMaxLengthDirectiveModule>;
}
//# sourceMappingURL=eui-maxlength.directive.d.ts.map