otp-angular
Version:
**Otp Angular** is a lightweight, highly customizable, and dependency-free OTP (One-Time Password) input component built for Angular 20+ applications. It offers seamless integration, flexible configuration, and a polished user experience for OTP or verifi
66 lines (62 loc) • 2.46 kB
TypeScript
import * as _angular_core from '@angular/core';
interface IOtp {
length: number;
numbersOnly?: boolean;
autoFocus?: boolean;
isPassword?: boolean;
showError?: boolean;
showCaps?: boolean;
containerClass?: string | Array<string>;
containerStyles?: Object;
inputClass?: string | Array<string>;
inputStyles?: Object | Array<Object>;
placeholder?: string;
separator?: string;
resend?: number;
resendLabel?: string;
resendContainerClass?: string;
resendLabelClass?: string;
resendTimerClass?: string;
}
declare class OtpAngular {
private readonly document;
config: _angular_core.ModelSignal<IOtp | undefined>;
disabled: _angular_core.WritableSignal<boolean>;
onInputChange: _angular_core.OutputEmitterRef<string | number | null>;
protected defaultConfig: _angular_core.Signal<{
length: number;
numbersOnly: boolean;
autoFocus: boolean;
isPassword: boolean;
showError: boolean;
showCaps: boolean;
containerClass: string | Array<string>;
containerStyles: Object;
inputClass: string | Array<string>;
inputStyles: Object;
placeholder: string;
separator: string;
resend: number;
resendLabel: string;
resendContainerClass: string;
resendLabelClass: string;
resendTimerClass: string;
}>;
protected myValue: _angular_core.WritableSignal<(string | number)[]>;
protected inputStyleArray: _angular_core.Signal<any[]>;
protected countdown: _angular_core.WritableSignal<number>;
protected isResendAllowed: _angular_core.WritableSignal<boolean>;
onResendAvailable: _angular_core.OutputEmitterRef<boolean>;
private timer;
constructor();
setValue(value: string | number): void;
protected keydown(e: KeyboardEvent, index: number): void;
protected onInput(e: Event, index: number): void;
protected blur(e: FocusEvent, index: number): void;
private emit;
protected resend(): void;
reset(): void;
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OtpAngular, never>;
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OtpAngular, "otp-angular", never, { "config": { "alias": "config"; "required": false; "isSignal": true; }; }, { "config": "configChange"; "onInputChange": "onInputChange"; "onResendAvailable": "onResendAvailable"; }, never, never, true, never>;
}
export { OtpAngular };