UNPKG

adpa-enterprise-framework-automation

Version:

Modular, standards-compliant Node.js/TypeScript automation framework for enterprise requirements, project, and data management. Provides CLI and API for BABOK v3, PMBOK 7th Edition, and DMBOK 2.0 (in progress). Production-ready Express.js API with TypeSpe

173 lines 4.16 kB
/** * Enhanced CLI Menu Navigation System * * Provides an improved interactive CLI interface using inquirer for better UX. * This enhances the existing menu system with arrow key navigation, better prompts, * and improved error handling. * * @version 1.0.0 * @author ADPA Team */ import { EventEmitter } from 'events'; export interface EnhancedMenuItem { name: string; value: string; short?: string; disabled?: boolean | string; checked?: boolean; } export interface MenuChoice { type: 'list' | 'checkbox' | 'input' | 'confirm' | 'password'; name: string; message: string; choices?: EnhancedMenuItem[]; default?: any; validate?: (input: any) => boolean | string; filter?: (input: any) => any; when?: (answers: any) => boolean; pageSize?: number; } export interface NavigationStep { id: string; title: string; description?: string; choices: MenuChoice[]; onComplete?: (answers: any) => Promise<NavigationResult>; onBack?: () => Promise<void>; allowBack?: boolean; allowExit?: boolean; } export interface NavigationResult { action: 'continue' | 'back' | 'exit' | 'restart' | 'navigate'; data?: any; nextStep?: string; message?: string; } export interface NavigationFlow { id: string; title: string; description?: string; steps: NavigationStep[]; startStep?: string; onComplete?: (results: any) => Promise<void>; onCancel?: () => Promise<void>; } export interface NavigationState { currentFlow?: string; currentStep?: string; stepHistory: string[]; flowData: { [key: string]: any; }; globalData: { [key: string]: any; }; } /** * Enhanced Menu Navigation System using Inquirer */ export declare class EnhancedMenuNavigation extends EventEmitter { private flows; private state; private commandIntegration; private isRunning; constructor(); /** * Start the enhanced navigation system */ start(flowId?: string): Promise<void>; /** * Stop the navigation system */ stop(): Promise<void>; /** * Navigate to a specific flow */ navigateToFlow(flowId: string, stepId?: string): Promise<void>; /** * Navigate to a specific step within the current flow */ navigateToStep(stepId: string): Promise<void>; /** * Go back to the previous step */ goBack(): Promise<void>; /** * Execute a navigation step */ private executeStep; /** * Prompt user with a choice using inquirer */ private promptChoice; /** * Handle navigation result */ private handleNavigationResult; /** * Complete a navigation flow */ private completeFlow; /** * Render step header */ private renderStepHeader; /** * Wrap text to fit within specified width */ private wrapText; /** * Get default validator for choice type */ private getDefaultValidator; /** * Get default filter for choice type */ private getDefaultFilter; /** * Show contextual help */ private showContextualHelp; /** * Confirm exit */ private confirmExit; /** * Handle user cancellation */ private handleUserCancellation; /** * Handle navigation errors */ private handleNavigationError; /** * Handle step execution errors */ private handleStepError; /** * Pause execution and wait for user input */ private pause; /** * Initialize navigation flows */ private initializeFlows; /** * Interactive template search */ private searchTemplatesInteractive; /** * Single document generation */ private singleDocumentGeneration; /** * Generate all documents */ private generateAllDocuments; } /** * Factory function to create and start the enhanced navigation system */ export declare function startEnhancedNavigation(): Promise<void>; export default EnhancedMenuNavigation; //# sourceMappingURL=EnhancedMenuNavigation.d.ts.map