import { AcEdPromptKeywordOptions } from '../prompt/AcEdPromptKeywordOptions'; import { AcEdCommandLine } from '../ui/AcEdCommandLine'; import { AcEdInputSession } from './AcEdInputSession'; /** * Interactive keyword-input session bound to the command line. * * This session is responsible for: * - Rendering the keyword prompt UI * - Applying Enter/Escape behavior for keyword picking * - Handling default-keyword and `AllowNone` semantics on empty Enter * - Restoring command-line input state when the session ends * * The resolved session value is always a string: * - keyword global name when a keyword is selected * - empty string when the prompt ends as "none"/cancel path */ export declare class AcEdKeywordSession extends AcEdInputSession { private cli; private options; private allowTyping; /** * Keyword parser/validator shared by Enter handling. * * It maps user input (display/local/global/alias) to canonical * global keyword names and rejects invalid text. */ private handler; /** * Creates a keyword session instance. * * @param cli - Command-line UI adapter used to render prompt and control input state * @param options - Keyword prompt options (message, keyword set, default, `allowNone`) * @param allowTyping - When false, typed input is disabled and only clickable keywords are accepted */ constructor(cli: AcEdCommandLine, options: AcEdPromptKeywordOptions, allowTyping?: boolean); /** * Initializes session UI state. * * Behavior: * - Clears any stale command-line input text * - Sets input read-only depending on `allowTyping` * - Renders clickable keyword prompt * - Focuses command-line input for immediate interaction */ protected onStart(): void; /** * Handles Enter key input for this keyword session. * * Resolution order: * 1. If typing is disabled, Enter is treated as consumed. * 2. Empty input: * - use default keyword when present and enabled * - otherwise resolve empty string when `allowNone` is true * - otherwise reject as invalid (session remains active) * 3. Non-empty input: * - parse as keyword via {@link AcEdKeywordHandler} * - resolve parsed global keyword when valid * - reject when invalid * * @param value - Raw text currently typed in command-line input * @returns `true` when Enter is consumed; `false` when input is invalid */ handleEnter(value: string): boolean; /** * Handles Escape key for this session. * * Escape resolves the session with an empty string, which the caller * interprets as cancel/none depending on prompt context. */ handleEscape(): void; /** * Restores command-line state after session completion. * * This always: * - Re-enables input editing * - Clears prompt/input visuals from command line */ protected cleanup(): void; } //# sourceMappingURL=AcEdKeywordSession.d.ts.map