import type { FulltextConfig, UrlArchiveFormat, UrlConfig } from "../../config/schema.js"; import type { ILibrary } from "../../core/library-interface.js"; import type { PubmedConfig } from "../../features/import/fetcher.js"; import type { AddReferencesResult, AddedItem, FailedItem, SkippedItem } from "../../features/operations/add.js"; import type { FulltextFetchOptions, FulltextFetchResult } from "../../features/operations/fulltext/fetch.js"; import type { ExecutionContext } from "../execution-context.js"; /** * Options for the add command. */ export interface AddCommandOptions { /** Input strings (file paths, PMIDs, DOIs) */ inputs: string[]; /** Skip duplicate detection */ force: boolean; /** Explicit input format */ format?: string; /** PubMed API configuration */ pubmedConfig?: PubmedConfig; /** Show verbose error output */ verbose?: boolean; /** Content from stdin */ stdinContent?: string; /** Output format: json|text */ output?: "json" | "text"; /** Include full CSL-JSON data in JSON output */ full?: boolean; /** URL import configuration */ urlConfig?: UrlConfig | undefined; /** Archive format override for URL imports */ archiveFormat?: UrlArchiveFormat | undefined; /** Skip archive creation for URL imports */ noArchive?: boolean | undefined; /** Attachments directory for saving URL import data */ attachmentsDirectory?: string | undefined; } /** * Result from add command execution. */ export type AddCommandResult = AddReferencesResult; export type { AddedItem, FailedItem, SkippedItem }; /** * Execute add command. * Uses context.library.import() which works for both local and server modes. * * @param options - Add command options * @param context - Execution context * @returns Add result containing added, failed, and skipped items */ export declare function executeAdd(options: AddCommandOptions, context: ExecutionContext): Promise; /** * Format add result for CLI output. * * @param result - Add result * @param verbose - Show verbose error output * @returns Formatted output string */ export declare function formatAddOutput(result: AddCommandResult, verbose: boolean): string; /** * Determine exit code based on result. * * @param result - Add result * @returns Exit code (0 for success/partial success, 1 for complete failure) */ export declare function getExitCode(result: AddCommandResult): number; /** * Type for the fulltext fetch function (for dependency injection in tests). */ type FulltextFetchFn = (library: ILibrary, options: FulltextFetchOptions) => Promise; /** * Options for auto-fetching fulltext after add. */ export interface AutoFetchOptions { fulltextConfig: FulltextConfig; fulltextDirectory: string; fulltextFetchFn: FulltextFetchFn; } /** * Auto-fetch fulltext for added items (best-effort). * Failures are caught and returned as failed results, never thrown. */ export declare function autoFetchFulltext(addedItems: AddedItem[], context: ExecutionContext, options: AutoFetchOptions): Promise; /** * Print progress message to stderr for URL inputs. * Suppressed when quiet is true. */ export declare function printUrlProgress(inputs: string[], quiet: boolean): void; //# sourceMappingURL=add.d.ts.map