import { AfterContentInit, QueryList, TemplateRef } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { PrimeTemplate } from 'primeng/api'; import { Nullable } from 'primeng/ts-helpers'; import * as i0 from "@angular/core"; export declare const INPUT_OTP_VALUE_ACCESSOR: any; /** * Input change event. * @property {Event} originalEvent - browser event. * @property {any} value - updated value. * @group Interface */ export interface InputOtpChangeEvent { originalEvent: Event; value: any; } /** * Context interface for the input template events. * @property {(event: Event, index: number) => void} input - input event. * @property {(event: Event)} keydown - keydown event. * @property {(event: Event)} focus - focus event. * @property {(event: Event)} blur - blur event. * @property {(event: Event)} paste - paste event. * @group Interface */ export interface InputOtpTemplateEvents { input: (event: Event, index: number) => void; keydown: (event: Event) => void; focus: (event: Event) => void; blur: (event: Event) => void; paste: (event: Event) => void; } /** * Context of the input template. * @property {number | string} $implicit - token value. * @property {InputOtpTemplateEvents} events - Browser events of the template. * @property {number} index - index of the token. * @group Interface */ export interface InputOtpInputTemplateContext { $implicit: number | string; events: InputOtpTemplateEvents; index: number; } /** * Input Otp is used to enter one time passwords. * @group Components */ export declare class OtpInputComponent implements AfterContentInit, ControlValueAccessor { /** * When present, it specifies that an input field is read-only. * @group Props */ readonly: import("@angular/core").InputSignal; /** * Index of the element in tabbing order. * @group Props */ tabindex: import("@angular/core").InputSignal; /** * Number of characters to initiate. * @group Props */ length: import("@angular/core").InputSignal; /** * Style class of the input element. * @group Props */ styleClass: import("@angular/core").InputSignal; /** * Mask pattern. * @group Props */ mask: import("@angular/core").InputSignal; /** * When present, it specifies that an input field is integer-only. * @group Props */ integerOnly: import("@angular/core").InputSignal; /** * When present, it specifies that the component should automatically get focus on load. * @group Props */ autofocus: import("@angular/core").InputSignal; /** * Callback to invoke on value change. * @group Emits */ onChange: import("@angular/core").OutputEmitterRef; /** * Callback to invoke on OTP Completion. * @group Emits */ onComplete: import("@angular/core").OutputEmitterRef; /** * Callback to invoke when the component receives focus. * @param {Event} event - Browser event. * @group Emits */ onFocus: import("@angular/core").OutputEmitterRef; /** * Callback to invoke when the component loses focus. * @param {Event} event - Browser event. * @group Emits */ onBlur: import("@angular/core").OutputEmitterRef; /** * Input template. * @param {InputOtpInputTemplateContext} context - Context of the template * @see {@link InputOtpInputTemplateContext} * @group Templates */ inputTemplate: TemplateRef; templates: Nullable>; _inputTemplate: TemplateRef | undefined; tokens: import("@angular/core").WritableSignal; value: import("@angular/core").WritableSignal; inputMode: import("@angular/core").Signal<"numeric" | "text">; inputType: import("@angular/core").Signal<"numeric" | "text" | "password">; onModelChange: Function; onModelTouched: Function; /** * */ ngAfterContentInit(): void; /** * Gets the token value at the specified index. * @param {number} index - The index of the token to retrieve. * @returns {any} The token value at the specified index. */ getToken(index: number): any; /** * Gets the template events object for a specific input index. * @param {number} index - The index of the input field. * @returns {InputOtpTemplateEvents} Object containing event handlers for the input template. */ getTemplateEvents(index: number): InputOtpTemplateEvents; /** * Handles input events for individual OTP input fields. * @param {any} event - The input event object. * @param {number} index - The index of the input field. */ onInput(event: any, index: number): void; /** * Updates the model value and emits change events. * @param {any} event - The event that triggered the model update. */ updateModel(event: any): void; /** * Writes a value to the OTP input component. * Implements ControlValueAccessor interface. * @param {any} value - The value to write to the component. */ writeValue(value: any): void; /** * Updates the tokens array based on the current value. */ updateTokens(): void; /** * Gets the model value for a specific input index. * @param {number} i - The input index (1-based). * @returns {string} The model value for the specified input. */ getModelValue(i: number): string; /** * Determines if autofocus should be applied to an input field. * @param {number} i - The input index (1-based). * @returns {boolean} True if autofocus should be applied, false otherwise. */ getAutofocus(i: number): boolean; /** * Registers a change callback function. * Implements ControlValueAccessor interface. * @param {Function} fn - The callback function to register. */ registerOnChange(fn: Function): void; /** * Registers a touched callback function. * Implements ControlValueAccessor interface. * @param {Function} fn - The callback function to register. */ registerOnTouched(fn: Function): void; /** * Moves focus to the previous input field. * @param {any} event - The event that triggered the move. */ moveToPrev(event: any): void; /** * Moves focus to the next input field. * @param {any} event - The event that triggered the move. * @returns {any} The next input element if found, undefined otherwise. */ moveToNext(event: any): any; /** * Moves focus through multiple input fields based on the length of pasted content. * @param {any} event - The event that triggered the move. * @param pastedCode - Pasted code */ moveToLast(event: any, pastedCode: string): void; /** * Finds the next input element in the DOM. * @param {any} element - The current element to search from. * @returns {any} The next input element if found, undefined otherwise. */ findNextInput(element: any): any; /** * Finds the previous input element in the DOM. * @param {any} element - The current element to search from. * @returns {any} The previous input element if found, undefined otherwise. */ findPrevInput(element: any): any; /** * Handles focus events on input fields. * @param {any} event - The focus event object. */ onInputFocus(event: any): void; /** * Handles blur events on input fields. * @param {any} event - The blur event object. */ onInputBlur(event: any): void; /** * Handles keydown events on input fields. * @param {any} event - The keydown event object. */ onKeyDown(event: any): void; /** * Handles paste events on input fields. * @param {any} event - The paste event object. * @param {number} index - The index of the input field. */ onPaste(event: any, index: number): void; /** * Handles the processing of pasted content into token input fields. * @param {string} paste - The pasted text content. * @param {any} event - The paste event object. * @param {number} index - The index of the current input field. */ handleOnPaste(paste: string, event: any, index: number): void; /** * Creates an array of numbers from 1 to n. * @param {number} n - The upper limit for the range. * @returns {number[]} Array of numbers from 1 to n. */ getRange(n: number): number[]; /** * Utility function to conditionally join CSS class names. * @param {...string[]} classes - CSS class names to join. * @returns {string} Joined CSS class names. */ cn(...classes: string[]): string; /** * Utility function to create component-specific CSS class names. * @param {string} className - The base class name. * @returns {string} Component-specific CSS class name. */ cx(className: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }