import type { CitationKeyFormat, Config } from "../../config/schema.js"; import type { CslItem } from "../../core/csl-json/types.js"; import type { ActionType } from "../../features/interactive/action-menu.js"; import type { SearchResult } from "../../features/operations/search.js"; import { type SearchSortField, type SortOrder } from "../../features/pagination/index.js"; import type { ExecutionContext } from "../execution-context.js"; /** * Options for the search command. */ export interface SearchCommandOptions { query: string; output?: "pretty" | "json" | "bibtex" | "ids" | "uuid" | "pandoc-key" | "latex-key"; json?: boolean; idsOnly?: boolean; uuidOnly?: boolean; bibtex?: boolean; key?: boolean; pandocKey?: boolean; latexKey?: boolean; sort?: SearchSortField; order?: SortOrder; limit?: number; offset?: number; tui?: boolean; } /** * Result from search command execution. */ export type SearchCommandResult = SearchResult; /** * Execute search command. * Uses context.library.search() which works for both local and server modes. * * @param options - Search command options * @param context - Execution context * @returns Search result containing raw CslItem[] */ export declare function executeSearch(options: SearchCommandOptions, context: ExecutionContext): Promise; /** * Format search result for CLI output. * * @param result - Search result (CslItem[]) * @param options - Command options to determine format * @returns Formatted output string */ export declare function formatSearchOutput(result: SearchCommandResult, options: SearchCommandOptions, defaultKeyFormat?: CitationKeyFormat): string; /** * Result from interactive search command execution. */ export interface InteractiveSearchResult { output: string; cancelled: boolean; /** Action type (for side-effect action handling) */ action?: ActionType; /** Selected items (for side-effect actions) */ selectedItems?: CslItem[]; } /** * Execute interactive search command. * Uses runSearchFlow from the interactive module (Single App Pattern - ADR-015). * * @param options - Search command options with interactive flag * @param context - Execution context * @param config - Application configuration * @returns Interactive search result containing output and cancelled flag */ export declare function executeInteractiveSearch(options: SearchCommandOptions, context: ExecutionContext, config: Config): Promise; /** * Execute the "show" action from the TUI action menu. * Renders the reference detail view using the `ref show` pretty format. * @internal Exported for testing only. */ export declare function executeShowAction(items: CslItem[], config: Config): Promise; /** * Execute a side-effect action from the TUI action menu. * These actions perform operations rather than producing stdout output. * @internal Exported for testing only. */ export declare function executeSideEffectAction(action: ActionType, items: CslItem[], context: ExecutionContext, config: Config): Promise; //# sourceMappingURL=search.d.ts.map