/** * Fulltext fetch operation. * * Discovers OA sources, downloads full-text files (PDF, PMC XML), * converts XML to Markdown, and attaches them to references. */ import type { FulltextConfig, FulltextSource } from "../../../config/schema.js"; import type { ILibrary, IdentifierType } from "../../../core/library-interface.js"; export interface FulltextFetchOptions { /** Reference identifier (id or uuid) */ identifier: string; /** Identifier type: 'id' (default), 'uuid', 'doi', 'pmid', or 'isbn' */ idType?: IdentifierType | undefined; /** Fulltext configuration */ fulltextConfig: FulltextConfig; /** Directory for fulltext attachments */ fulltextDirectory: string; /** Preferred source to fetch from */ source?: FulltextSource | undefined; /** Force overwrite existing fulltext */ force?: boolean | undefined; } export interface FetchAttempt { source: string; phase: "download" | "convert" | "attach"; url?: string; fileType: "pdf" | "xml" | "html" | "markdown"; error: string; } export interface FulltextFetchResult { success: boolean; error?: string | undefined; /** The reference ID used for display */ referenceId?: string | undefined; /** Which source was used */ source?: string | undefined; /** Which file types were attached */ attachedFiles?: string[] | undefined; /** Discovery-phase errors from discoverOA */ discoveryErrors?: Array<{ source: string; error: string; }> | undefined; /** Per-download-attempt details */ attempts?: FetchAttempt[] | undefined; /** Which OA sources were checked */ checkedSources?: string[] | undefined; /** Sources that were skipped (e.g., missing credentials or identifiers) */ skipped?: Array<{ source: string; reason: string; }> | undefined; /** User-facing hint (e.g., suggesting manual download) */ hint?: string | undefined; } export declare function fulltextFetch(library: ILibrary, options: FulltextFetchOptions): Promise; //# sourceMappingURL=fetch.d.ts.map