@engr-lukman/vue-secure-pin
Version:
A secure PIN input component for Vue.js applications with virtual keyboard and PIN masking, designed for financial applications
26 lines (24 loc) • 691 B
TypeScript
import { Ref } from 'vue';
/**
* Props interface for the useSecurePin composable
*/
export interface SecurePinComposableProps {
maxLength: number;
}
/**
* Return type for the useSecurePin composable
*/
export interface SecurePinComposableReturn {
pinMasked: Ref<string>;
pin: Ref<string>;
isMaxLengthReached: Ref<boolean>;
clear: () => void;
pinHandler: (input: number) => void;
}
/**
* Manages secure PIN input with masking for privacy
*
* @param props - Component properties containing maxLength
* @returns Object with PIN state and management functions
*/
export default function useSecurePin(props: SecurePinComposableProps): SecurePinComposableReturn;