import { ElementRef } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import * as i0 from "@angular/core";
/**
 * @description Componente de entrada de código PIN/OTP com campos individuais para cada dígito.
 * Implementa {@link ControlValueAccessor} para integração nativa com Reactive Forms
 * e Template-driven Forms do Angular.
 *
 * Funcionalidades:
 * - Campos separados e navegáveis para cada dígito do código
 * - Comprimento configurável via input `length`
 * - Suporte a entrada numérica ou alfanumérica
 * - Navegação por teclado (setas, backspace)
 * - Suporte a colar (paste) com truncamento automático ao tamanho definido
 * - Estado de erro via input `invalid`
 * - Acessibilidade completa com ARIA labels e roles semânticos
 *
 * @example
 * ```html
 * <form [formGroup]="form">
 *   <s-pin-code-field
 *     formControlName="code"
 *     [length]="6"
 *     [alphanumeric]="false"
 *     [invalid]="(form.get('code')?.invalid && form.get('code')?.dirty) || false"
 *     helpText="Digite seu código de 6 dígitos"
 *     (codeFilled)="onCodeFilled($event)">
 *   </s-pin-code-field>
 * </form>
 * ```
 *
 * @category Inputs
 */
export declare class PinCodeFieldComponent implements ControlValueAccessor {
    private static readonly LAST_INDEX_OFFSET;
    private static readonly EMPTY_VALUE;
    /**
     * @description Número de campos de entrada (comprimento do código PIN).
     * Deve ser ao menos 1.
     *
     * @default 6
     */
    length: import("@angular/core").InputSignal<number>;
    /**
     * @description Permite entrada alfanumérica e de caracteres especiais.
     * Quando `false`, aceita apenas dígitos numéricos (0–9).
     *
     * @default false
     */
    alphanumeric: import("@angular/core").InputSignal<boolean>;
    /**
     * @description Texto de ajuda exibido abaixo dos campos de entrada,
     * fornecendo instruções adicionais ao usuário.
     *
     * @default ''
     */
    helpText: import("@angular/core").InputSignal<string>;
    /**
     * @description Controla a visualização do estado de erro do componente.
     * Quando `true`, exibe borda vermelha nos campos de entrada.
     * Normalmente vinculado ao estado `invalid && dirty` do `FormControl`.
     *
     * @example
     * ```html
     * [invalid]="(control?.invalid && control?.dirty) || false"
     * ```
     * @default false
     */
    invalid: import("@angular/core").InputSignal<boolean>;
    /**
     * @description Controla o estado desabilitado do componente via two-way binding.
     * Quando `true`, todos os campos ficam desabilitados e a interação do usuário é bloqueada.
     *
     * @default false
     */
    disabled: import("@angular/core").ModelSignal<boolean>;
    /**
     * @description Emitido quando todos os campos do código PIN são preenchidos.
     * Emite o código completo como string.
     *
     * @example
     * ```html
     * (codeFilled)="onCodeFilled($event)"
     * ```
     */
    codeFilled: import("@angular/core").OutputEmitterRef<string>;
    /**
     * @description Signal com os valores atuais de cada campo de entrada.
     * O comprimento do array corresponde ao valor do input `length`.
     */
    inputs: import("@angular/core").WritableSignal<string[]>;
    /**
     * Signal tracking whether the component has been touched by the user.
     * Set to true when the last input field loses focus (blur event).
     */
    touched: import("@angular/core").WritableSignal<boolean>;
    /**
     * Computed signal indicating whether all PIN code fields are filled.
     * True only when every field contains a non-empty value.
     */
    isComplete: import("@angular/core").Signal<boolean>;
    /**
     * Computed signal containing the complete PIN code as a joined string.
     * Returns empty string if no inputs are filled.
     */
    currentValue: import("@angular/core").Signal<string>;
    /**
     * Signal tracking if the component host has the ng-invalid class from FormControl validators.
     * Updated reactively whenever the invalid state changes.
     */
    private hasNgInvalidClass;
    /**
     * Signal tracking if the FormControl is dirty.
     * Updated reactively whenever the dirty state changes.
     */
    private isControlDirty;
    /**
     * Computed signal indicating if the component should show error state.
     * Returns true if:
     * - The `invalid` input is true, OR
     * - The component has the `ng-invalid` class AND the FormControl is dirty (touched/modified)
     * This ensures errors are only shown to the user after they've interacted with the field.
     */
    hasError: import("@angular/core").Signal<boolean>;
    /**
     * ViewChildren reference to all input DOM elements.
     * Used for DOM manipulation (focus, selection).
     */
    pinInputs: import("@angular/core").Signal<readonly ElementRef<any>[]>;
    private readonly elementRef;
    private readonly destroyRef;
    private onChange;
    private onTouched;
    constructor();
    /**
     * Handles input event on PIN code fields.
     * Validates character input, prevents multiple characters per field,
     * auto-advances to next field when character is entered.
     *
     * @param index - The input field index (0-based)
     * @param event - The input event
     */
    onInput(index: number, event: Event): void;
    /**
     * Handles keyboard events on PIN code fields.
     * Supports arrow navigation (left/right) and backspace key.
     *
     * Keyboard behavior:
     * - ArrowRight: Move focus to next field
     * - ArrowLeft: Move focus to previous field
     * - Backspace: Clear current or previous field and adjust focus
     *
     * @param index - The input field index (0-based)
     * @param event - The keyboard event
     */
    onKeyDown(index: number, event: KeyboardEvent): void;
    /**
     * Handles paste (clipboard) events on PIN code fields.
     * Extracts valid characters from pasted content, filters by character type,
     * and automatically truncates to match field length.
     *
     * Behavior:
     * - Filters characters based on `alphanumeric` setting
     * - Truncates to maximum field count
     * - Fills available fields with pasted content
     * - Emits codeFilled event if all fields are filled
     *
     * @param event - The clipboard event
     */
    onPaste(event: ClipboardEvent): void;
    /**
     * Handles focus event on PIN code fields.
     * Selects all text in the input field when focused.
     *
     * @param index - The input field index (0-based)
     */
    onFocus(index: number): void;
    /**
     * Handles blur event on PIN code fields.
     * Marks the component as touched when the last input field loses focus.
     * Also notifies the registered onTouched callback for FormControl integration.
     *
     * @param index - The input field index (0-based)
     */
    onBlur(index: number): void;
    /**
     * Clears the input value at specified index and adjusts focus accordingly.
     * If current field is empty, moves to previous field and clears it.
     *
     * @private
     * @param index - The input field index (0-based)
     */
    private handleBackspace;
    /**
     * Sets the value at a specific input field index and updates the form value.
     * Updates the signal and triggers the change detection via onChange callback.
     *
     * @private
     * @param index - The input field index (0-based)
     * @param value - The value to set in the field
     */
    private setInputAtIndex;
    /**
     * Focuses on and selects text in the input field at the specified index.
     * Uses queueMicrotask to ensure DOM is updated before focusing.
     *
     * @private
     * @param index - The input field index (0-based)
     */
    private focusAndSelectInput;
    /**
     * Clears the value of an input element.
     * Used for input validation to reject invalid characters.
     *
     * @private
     * @param target - The HTML input element to clear
     */
    private clearInput;
    /**
     * Extracts valid characters from pasted content.
     * Filters based on alphanumeric setting and limits to component's length.
     *
     * @private
     * @param event - The clipboard event
     * @returns Array of valid characters from the pasted content
     */
    private extractValidCharactersFromPaste;
    /**
     * Validates if a character is acceptable based on component configuration.
     * For numeric mode, accepts only digits 0-9.
     * For alphanumeric mode, accepts any non-whitespace character.
     *
     * @private
     * @param char - The character to validate
     * @returns true if character is valid, false otherwise
     */
    private isValidCharacter;
    /**
     * Updates the form value by calling the onChange callback registered by FormControl.
     * This ensures the reactive form stays synchronized with component state.
     *
     * @private
     */
    private updateValue;
    /**
     * Implements ControlValueAccessor interface.
     * Called by the FormControl to write a value to the component.
     * Only accepts string values with length matching the component's length setting.
     *
     * @param value - The value to write (typically from the FormControl)
     */
    writeValue(value: any): void;
    /**
     * Implements ControlValueAccessor interface.
     * Called by the FormControl when value changes.
     * Registers the callback to be called when the component value changes.
     *
     * @param fn - Callback function to invoke when component value changes
     */
    registerOnChange(fn: (value: string) => void): void;
    /**
     * Implements ControlValueAccessor interface.
     * Called by the FormControl to register the touched callback.
     * The callback is invoked when the last input field loses focus.
     *
     * @param fn - Callback function to invoke when component is touched
     */
    registerOnTouched(fn: () => void): void;
    /**
     * Implements ControlValueAccessor interface.
     * Called by the FormControl to set the disabled state of the component.
     * Updates the disabled model to reflect the form's disabled state.
     *
     * @param isDisabled - Whether the component should be disabled
     */
    setDisabledState(isDisabled: boolean): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<PinCodeFieldComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<PinCodeFieldComponent, "s-pin-code-field", never, { "length": { "alias": "length"; "required": false; "isSignal": true; }; "alphanumeric": { "alias": "alphanumeric"; "required": false; "isSignal": true; }; "helpText": { "alias": "helpText"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "codeFilled": "codeFilled"; }, never, never, true, never>;
}
