/** * Shell completion support using tabtab * * Provides intelligent auto-completion for Bash, Zsh, and Fish shells. * Completion candidates are dynamically extracted from Commander program * and existing type definitions to avoid duplication. */ import type { Command } from "commander"; import type { CompletionItem, TabtabEnv } from "tabtab"; import type { ILibrary } from "../core/library-interface.js"; export declare const OPTION_VALUES: Record; /** * Extract subcommands from Commander program */ export declare function extractSubcommands(program: Command): CompletionItem[]; /** * Extract global options from program */ export declare function extractGlobalOptions(program: Command): CompletionItem[]; /** * Get completions based on the current completion environment */ export declare function getCompletions(env: TabtabEnv, program: Command): CompletionItem[]; /** * Check if the current context requires ID completion */ export declare function needsIdCompletion(env: TabtabEnv): { needs: boolean; command?: string | undefined; subcommand?: string | undefined; }; /** * Check if the current context requires config key completion */ export declare function needsConfigKeyCompletion(env: TabtabEnv): boolean; /** * Get config key completions */ export declare function getConfigKeyCompletions(prefix: string): CompletionItem[]; /** Maximum number of ID completion candidates */ export declare const MAX_ID_COMPLETIONS = 100; /** * Get a library instance for completion context. * Uses server if available, otherwise loads library directly. * Silently returns undefined on any error. */ export declare function getLibraryForCompletion(): Promise; /** * Get ID completions from the library. * * @param library - Library to get IDs from * @param prefix - Prefix to filter IDs by * @returns Array of completion items with ID and title description */ export declare function getIdCompletions(library: ILibrary, prefix: string): Promise; /** * Install shell completion for the CLI */ export declare function installCompletion(): Promise; /** * Uninstall shell completion */ export declare function uninstallCompletion(): Promise; /** * Handle completion request * Called when COMP_LINE environment variable is set */ export declare function handleCompletion(program: Command): Promise; /** * Register the completion command with Commander */ export declare function registerCompletionCommand(program: Command): void; //# sourceMappingURL=completion.d.ts.map