/** * Enhanced Prompt Service with Input Validation and Error Handling * Provides robust user input handling with validation, sanitization, and error recovery */ import * as readline from 'readline'; import { ValidationResult } from './InputValidationService.js'; export interface PromptOptions { message: string; validator?: (input: string) => ValidationResult; required?: boolean; defaultValue?: string; maxRetries?: number; timeout?: number; mask?: boolean; multiline?: boolean; suggestions?: string[]; helpText?: string; } export interface PromptResult { success: boolean; value?: T; error?: string; attempts: number; cancelled: boolean; } export declare class EnhancedPromptService { private rl; private isActive; constructor(rl?: readline.Interface); /** * Enhanced prompt with validation and error handling */ prompt(options: PromptOptions): Promise>; /** * Prompt for menu choice with enhanced validation */ promptMenuChoice(message: string, validChoices: string[]): Promise>; /** * Prompt for project name with validation */ promptProjectName(message?: string): Promise>; /** * Prompt for file path with security validation */ promptFilePath(message?: string): Promise>; /** * Prompt for numeric input with range validation */ promptNumber(message: string, min?: number, max?: number): Promise>; /** * Prompt for yes/no confirmation */ promptConfirm(message: string, defaultValue?: boolean): Promise>; /** * Prompt for password with masking */ promptPassword(message?: string): Promise>; /** * Prompt for email with validation */ promptEmail(message?: string): Promise>; /** * Prompt for URL with validation */ promptUrl(message?: string): Promise>; /** * Prompt for API key with validation */ promptApiKey(provider: string, message?: string): Promise>; /** * Prompt for multiple choice selection */ promptChoice(message: string, choices: string[], allowMultiple?: boolean): Promise>; /** * Get raw input with timeout and cancellation support */ private getInput; /** * Get masked input for passwords */ private getMaskedInput; /** * Get multiline input */ private getMultilineInput; /** * Cancel active prompt */ cancel(): void; /** * Close the prompt service */ close(): void; } //# sourceMappingURL=EnhancedPromptService.d.ts.map