import * as _angular_core from '@angular/core';
import { OnInit, OnDestroy, DoCheck, OnChanges, InputSignal, ElementRef, Renderer2, SimpleChanges } from '@angular/core';
import { NumberInput, BooleanInput } from '@angular/cdk/coercion';
import Cleave from 'cleave.js';
import { InputDirective } from '@eui/components/shared';
import * as i1 from '@eui/components/directives';
import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors } from '@angular/forms';

interface CleaveInstance extends Cleave {
    initSwapHiddenInput?: () => void;
    initNumeralFormatter?: () => void;
    initTimeFormatter?: () => void;
    initDateFormatter?: () => void;
    initPhoneFormatter?: () => void;
    updateCreditCardPropsByValue?: () => void;
    updateValueState?: () => void;
    callOnValueChanged?: () => void;
    onChange?: (event?: Event) => void;
    onCut?: (event?: Event) => void;
    onFocus?: (event?: Event) => void;
    onCopy?: (event?: Event) => void;
    onKeyDown?: (event?: Event) => void;
    onChangeListener?: (event?: Event) => void;
    onKeyDownListener?: (event?: Event) => void;
    onFocusListener?: (event?: Event) => void;
    onCutListener?: (event?: Event) => void;
    onCopyListener?: (event?: Event) => void;
}
/**
 * @description
 * Input number component that allows the user to enter a number. It supports number
 * formatting and validation. It uses Cleave.js to format the number. It depends on
 * the {@link LocaleService} to get the current locale and format the number accordingly.
 *
 * It supports the following attributes:
 * - {@link min}: The minimum number can be entered. Blocks user's input if not in range.
 * - {@link max}: The maximum number can be entered. Blocks user's input if not in range.
 * - {@link leadingZero}: Adds leading zero to a number. Formatting will not work.
 * - {@link isInvalid}: Sets the invalid state of the input element.
 * - {@link fractionDigits}: Determines how many digits to show after the decimal point.
 * - {@link digits}: Determines how many digits to show before the decimal point.
 * - {@link fillFraction}: Fills the decimal part with zeros in case it's less than the fractionDigits.
 * - {@link roundUp}: Rounds a number with more than two decimals UP.
 * - {@link noFormat}: Disables the number formatting. It will be treated as a plain number.
 * - {@link value}: The value of the input element.
 * - {@link placeholder}: The placeholder value of the input element.
 * - {@link euiClearable}: Adds a clear button to the input element.
 * - {@link euiLoading}: Adds a loading spinner to the input element.
 * - {@link readonly}: Disables the input element.
 * - {@link disabled}: Disables the input element.
 * - {@link euiDanger}: Sets the invalid state of the input element.
 * - {@link euiSuccess}: Sets the success state of the input element.
 * - {@link euiWarning}: Sets the warning state of the input element.
 * - {@link euiInfo}: Sets the info state of the input element.
 * - {@link euiPrimary}: Sets the primary state of the input element.
 * - {@link euiSecondary}: Sets the secondary state of the input element.
 *
 * @usageNotes
 * ### Basic Usage
 * ```html
 * <input euiInputNumber [(ngModel)]="amount" [fractionDigits]="2" />
 * ```
 *
 * ### With Min/Max Range
 * ```html
 * <input euiInputNumber [min]="0" [max]="100" [(ngModel)]="percentage" />
 * ```
 *
 * ### Currency Format
 * ```html
 * <input euiInputNumber [fractionDigits]="2" [fillFraction]="true" placeholder="0.00" />
 * ```
 *
 * ### Accessibility
 * - Use associated `<label>` with `for` attribute
 * - Invalid state is communicated via `aria-invalid`
 * - Min/max constraints are enforced during input
 *
 * ### Notes
 * - Automatically formats numbers based on current locale
 * - Supports large numbers as strings to avoid precision loss
 * - Use `fillFraction` for consistent decimal display (e.g., currency)
 * - `roundUp` parameter controls decimal rounding behavior
 */
declare class EuiInputNumberComponent extends InputDirective implements OnInit, OnDestroy, DoCheck, OnChanges {
    /**
     * The minimum number can be entered. Blocks user's input if not in range.
     */
    min: _angular_core.InputSignalWithTransform<number, NumberInput>;
    /**
     * The maximum number can be entered. Blocks user's input if not in range.
     */
    max: _angular_core.InputSignalWithTransform<number, NumberInput>;
    /**
     * Adds leading zero to a number. Formatting will not work.
     *      e.g. with leadingZero=3 input number 5 => 005
     * @default 0
     */
    leadingZero: _angular_core.InputSignalWithTransform<number, NumberInput>;
    isInvalid: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
    /**
     * CSS classes to be added to the host element.
     */
    get cssClasses(): string;
    /**
     *  determines how many digits to show after the decimal point
     *  @default 0
     */
    fractionDigits: _angular_core.InputSignalWithTransform<number, NumberInput>;
    /**
     * determines how many digits to show before the decimal point
     */
    digits: _angular_core.InputSignalWithTransform<number, NumberInput>;
    /**
     * fills the decimal part with zeros in case it's less than the fractionDigits
     */
    fillFraction: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
    /**
     * rounds a number with more than two decimals UP
     */
    roundUp: _angular_core.InputSignalWithTransform<number, NumberInput>;
    /**
     * Disables the number formatting. It will be treated as a plain number.
     * Will do a thousand grouping of number.
     */
    noFormat: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
    /**
     * The type of the input element.
     * @default 'eui-number'
     */
    protected type: string;
    /**
     * The value of the input element.
     */
    value: InputSignal<string>;
    onChangeCallback: <T>(_: T) => void;
    /**
     * holds an instance of cleave.js
     */
    cleaveInstance: CleaveInstance;
    protected _elementRef: ElementRef;
    protected _renderer: Renderer2;
    /**
     * holds an instance of cleave options for the Cleave instance
     */
    private options;
    /**
     * Signal that tracks the invalid state of the associated form control.
     * Used to reactively update the component's visual state when the form control's validity changes.
     * @internal
     */
    private controlInvalid;
    /**
     * Signal that tracks whether the associated form control has been touched.
     * Used to determine when to show validation messages.
     * Initialized with the control's touched state if available.
     * @internal
     */
    private controlTouched;
    /** @internal */
    private _isInvalid;
    private localeService;
    private locale_id;
    private document;
    private platformId;
    constructor();
    ngOnInit(): void;
    ngDoCheck(): void;
    ngOnChanges(changes: SimpleChanges): void;
    ngOnDestroy(): void;
    onChange: <T>(_: T) => void;
    onTouched: () => void;
    onPaste(event: ClipboardEvent): void;
    protected onKeyDown(e: KeyboardEvent): void;
    protected onFocusout(): void;
    /**
     * @Override setPlaceholder setPlaceholderAttribute of InputDirective
     * Updates the placeholder value based on current number format and given value.
     * If value passed contains characters it doesn't format placeholder.
     * */
    protected setPlaceholderAttribute(value: string | number): void;
    /**
     * instantiate Cleave.js
     */
    private initCleave;
    /**
     * Updates the cleave options by destroying the current instance and creating another one while keeping the previous
     * value.
     */
    private updateOptions;
    /**
     * Callback function of the Cleave instance that is invoked when value is changed.
     *
     * @param event type of CleaveEventOnChange
     */
    private onValueChanged;
    /**
     * responsible to extract all locale information needed to build CleaveOptions related to number format.
     *
     * @param id The id of the locale
     */
    private getCleaveOptsBasedOnLocale;
    /**
     * Applies the fill of decimal part with zeros in case decimal part of given number has
     * size less than the max fraction digits.
     *
     * @param number
     * @param cleaveInstance
     * @private
     */
    private applyFractionFill;
    /**
     * Parses a given formatted number and returns it as a number.
     *
     * @param value The formatted number you want to parse e.g. 111,888.22
     * @param userPrevLocaleState Use previous locale state to parse the value. By default, is false
     * @param replaceSymbol Replace the decimal symbol with a dot. By default, is false
     * @private
     */
    private parseNumber;
    /**
     * Pad leading zero to the number
     *
     * @param num The number to add leading zero to
     * @param size Number of number's leading zero
     * @private
     */
    private padZero;
    /**
     * checks whether the min symbol is allowed. It is allowed when minus symbol
     * provided and min input is undefined or min provided and is negative.
     *
     * @param key The key string coming from an event
     */
    private isMinusAllowed;
    /**
     * check whether the key entered is inside the min and
     * max range. Returns true if it's out of range.
     *
     * @param e A keyboard event
     */
    private isOutSideRange;
    /**
     * Decimal adjustment of a number.
     *
     * @param value The number or string representation of a number.
     * @param exp   The exponent (the 10 logarithm of the adjustment base).
     * @returns The adjusted value.
     */
    private decimalAdjust;
    /**
     * Checks whether a value is defined or not
     *
     * @param value
     */
    private isDefined;
    /**
     * Check if the value is a valid number. Take into account the Big numbers
     * more than 16 digits. Check if string contains only digits and dots.
     * The number value must not be formatted.
     * @param value the value to check
     * @private
     */
    private isItaNumber;
    /**
     * Parse the value to a number. For large numbers, the value is a string.
     * The number value must not be formatted.
     * @param value the value to parse
     * @private
     */
    private parseBigNumber;
    /**
     * @description
     * Transforms the invalid state input to a boolean value
     *
     * @param state
     * @private
     */
    private invalidTransform;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EuiInputNumberComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<EuiInputNumberComponent, "input[euiInputNumber]", never, { "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "leadingZero": { "alias": "leadingZero"; "required": false; "isSignal": true; }; "isInvalid": { "alias": "isInvalid"; "required": false; "isSignal": true; }; "fractionDigits": { "alias": "fractionDigits"; "required": false; "isSignal": true; }; "digits": { "alias": "digits"; "required": false; "isSignal": true; }; "fillFraction": { "alias": "fillFraction"; "required": false; "isSignal": true; }; "roundUp": { "alias": "roundUp"; "required": false; "isSignal": true; }; "noFormat": { "alias": "noFormat"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.EuiClearableDirective; inputs: { "euiClearable": "euiClearable"; "readonly": "readonly"; "disabled": "disabled"; }; outputs: {}; }, { directive: typeof i1.EuiLoadingDirective; inputs: { "euiLoading": "euiLoading"; "readonly": "readonly"; }; outputs: {}; }]>;
}

/**
 * @description
 * Directive for the {@link EuiInputNumberComponent}. This directive is used to
 * handle the value changes of the input element and update the value of the
 * directive and the form control. It also implements the ControlValueAccessor
 * interface to allow the directive to be used with reactive forms.
 *
 * @usageNotes
 * ### With Reactive Forms
 * ```typescript
 * form = new FormGroup({
 *   price: new FormControl(0)
 * });
 * ```
 *
 * ```html
 * <input euiInputNumber formControlName="price" [fractionDigits]="2" />
 * ```
 *
 * ### Accessibility
 * - Integrates with Angular Forms validation
 * - Automatically handles disabled state
 *
 * ### Notes
 * - Automatically applied when using formControl, formControlName, or ngModel
 * - Handles large number precision by returning strings when needed
 */
declare class EuiInputNumberDirective implements ControlValueAccessor, Validator, OnInit {
    private onValidatorChange;
    private wasIncomplete;
    /**
     * holds a copy of the value
     */
    private value;
    private onChange;
    private elementRef;
    private euiNumberComponent;
    private document;
    private platformId;
    ngOnInit(): void;
    writeValue(obj: any): void;
    registerOnChange(fn: any): void;
    registerOnTouched(fn: any): void;
    /**
     * Set the disabled state of the input element.
     *
     * @param isDisabled
     */
    setDisabledState(isDisabled: boolean): void;
    validate(control: AbstractControl): ValidationErrors | null;
    registerOnValidatorChange(fn: () => void): void;
    private onTouched;
    /**
     * Handle the value changes of the input element and update the value of the
     * directive and the form control. For large numbers, the value is a string.
     *
     * @param event
     */
    private valueChanges;
    /**
     * Check if a numeric string can be safely converted to a number without
     * losing precision or exceeding JavaScript's maximum safe integer limit.
     * This is important for very large numbers that may be represented
     * as strings to avoid precision loss.
     *
     * @param numString The numeric string to check
     * @return An object indicating if conversion is safe, the reason if not, and the converted value if safe
     */
    private canSafelyConvertToNumber;
    /**
     * Normalize a numeric string by removing leading/trailing zeros and signs,
     * without converting to a number. This helps compare the original and converted
     * strings for equivalence.
     *
     * @param str The numeric string to normalize
     * @returns The normalized string
     */
    private normalizeStringOnly;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<EuiInputNumberDirective, never>;
    static ɵdir: _angular_core.ɵɵDirectiveDeclaration<EuiInputNumberDirective, "input[euiInputNumber][formControl],input[euiInputNumber][formControlName],input[euiInputNumber][ngModel]", never, {}, {}, never, never, true, never>;
}

declare const EUI_INPUT_NUMBER: readonly [typeof EuiInputNumberComponent, typeof EuiInputNumberDirective];

export { EUI_INPUT_NUMBER, EuiInputNumberComponent, EuiInputNumberDirective };
export type { CleaveInstance };
//# sourceMappingURL=eui-components-eui-input-number.d.ts.map
