import * as _angular_core from '@angular/core'; import { ElementRef } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; /** * @license * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE */ /** * Character set accepted by ``: * - `numeric` — digits only (also sets `inputmode="numeric"` so mobile keyboards * show the number pad) * - `alphanumeric` — letters + digits * - `text` — any single character per cell */ type WrInputOtpMode = 'numeric' | 'alphanumeric' | 'text'; type WrInputOtpSize = 'sm' | 'md' | 'lg'; /** * Fixed-length one-time-code input. Renders one `` per character, * auto-advances focus on typing, handles paste of a full code, and supports * masking like a password field. * * Implements `ControlValueAccessor` — emits the joined string through * `[(ngModel)]` / `formControl`. Emits `completed` once all cells are * filled (useful for auto-submission). * * @example * ```html * * ``` * * @see https://ngwr.dev/components/input-otp */ declare class WrInputOtp implements ControlValueAccessor { /** Number of cells to render. Clamped to `[1, 20]`. @default 6 */ readonly length: _angular_core.InputSignalWithTransform; /** Character set per cell. @default 'numeric' */ readonly mode: _angular_core.InputSignal; /** Control size — shares the `--wr-control-*` contract. @default 'md' */ readonly size: _angular_core.InputSignal; /** Mask the typed characters like a password. @default false */ readonly mask: _angular_core.InputSignalWithTransform; /** Disable interaction. @default false */ readonly disabled: _angular_core.InputSignalWithTransform; /** Character shown in empty cells. @default '•' */ readonly placeholder: _angular_core.InputSignal; /** Fires once when every cell holds a character. */ readonly completed: _angular_core.OutputEmitterRef; protected readonly cells: _angular_core.WritableSignal; private readonly disabledFromCva; protected readonly effectiveDisabled: _angular_core.Signal; protected readonly classes: _angular_core.Signal; protected readonly cellType: _angular_core.Signal<"text" | "password">; protected readonly cellInputMode: _angular_core.Signal<"numeric" | "text">; protected readonly cellRefs: _angular_core.Signal[]>; constructor(); private onChange; private onTouched; writeValue(v: string | null): void; registerOnChange(fn: (value: string) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; protected onInput(event: Event, index: number): void; protected onKeyDown(event: KeyboardEvent, index: number): void; protected onPaste(event: ClipboardEvent): void; protected onBlur(): void; protected trackIndex(index: number): number; private update; private emitChange; private focusCell; /** Drop a character that doesn't match the configured mode. */ private sanitiseChar; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } export { WrInputOtp }; export type { WrInputOtpMode, WrInputOtpSize };