import type { UrlArchiveFormat, UrlConfig } from "../../config/schema.js"; import type { ILibrary } from "../../core/library-interface.js"; import type { InputFormat } from "../import/detector.js"; import type { PubmedConfig } from "../import/fetcher.js"; export type { FailureReason } from "../import/importer.js"; /** * Options for adding references */ export interface AddReferencesOptions { /** Skip duplicate detection */ force?: boolean; /** Explicit input format (default: auto) */ format?: InputFormat | "auto"; /** PubMed API configuration */ pubmedConfig?: PubmedConfig; /** Content from stdin (if provided, processed before file/identifier inputs) */ stdinContent?: string; /** 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 (fulltext/archive) */ attachmentsDirectory?: string | undefined; } /** * Information about a successfully added reference */ export interface AddedItem { source: string; id: string; uuid: string; title: string; /** True if the original ID from source file was changed due to collision */ idChanged?: boolean; /** Original ID from source file before collision resolution */ originalId?: string; /** Warnings from URL import (e.g., content extraction issues, save failures) */ warnings?: string[]; } /** * Information about a failed import */ export interface FailedItem { source: string; error: string; reason: import("../import/importer.js").FailureReason; } /** * Information about a skipped duplicate */ export interface SkippedItem { source: string; existingId: string; duplicateType: import("../duplicate/types.js").DuplicateType; } /** * Result of addReferences operation */ export interface AddReferencesResult { added: AddedItem[]; failed: FailedItem[]; skipped: SkippedItem[]; } /** * Add references to a library from various input sources. * * This function orchestrates: * 1. Import from inputs (files or identifiers) * 2. Duplicate detection (unless force=true) * 3. ID collision resolution * 4. Library save * * @param inputs - File paths or identifiers (PMID, DOI) * @param library - Target library * @param options - Add options * @returns Result with added, failed, and skipped items */ export declare function addReferences(inputs: string[], library: ILibrary, options: AddReferencesOptions): Promise; //# sourceMappingURL=add.d.ts.map