/** * Fetcher module for PMID and DOI metadata retrieval * * - PMID: Uses PMC Citation Exporter API (returns CSL-JSON directly) * - DOI: Uses citation-js plugin-doi (Cite.async) */ import "@citation-js/plugin-doi"; import "@citation-js/plugin-isbn"; import { type CslItem } from "../../core/csl-json/types.js"; /** * PubMed configuration for API requests */ export interface PubmedConfig { email?: string; apiKey?: string; } /** * Categorized failure reasons for JSON output */ export type FailureReason = "not_found" | "fetch_error" | "parse_error" | "validation_error" | "unknown"; /** * Result of fetching a single identifier */ export type FetchResult = { success: true; item: CslItem; } | { success: false; error: string; reason: FailureReason; }; /** * Result of fetching a PMID (includes pmid for tracking) */ export type PmidFetchResult = { pmid: string; success: true; item: CslItem; } | { pmid: string; success: false; error: string; reason: FailureReason; }; /** * Results of fetching multiple PMIDs */ export type FetchResults = PmidFetchResult[]; export declare function fetchPmids(pmids: string[], config: PubmedConfig): Promise; /** * Fetch metadata for a DOI using citation-js * * Uses @citation-js/plugin-doi for content negotiation, * with Crossref REST API as fallback. */ export declare function fetchDoi(doi: string): Promise; /** * Fetch metadata for an ISBN using Google Books API via citation-js * * @param isbn - Normalized ISBN (10 or 13 digits, no hyphens) * @returns FetchResult with CSL-JSON item or error */ export declare function fetchIsbn(isbn: string): Promise; /** * Fetch arXiv metadata by arXiv ID using the Atom API. * * @param arxivId - Normalized arXiv ID (e.g., "2301.13867" or "2301.13867v2") * @returns FetchResult with CSL-JSON item on success */ export declare function fetchArxiv(arxivId: string): Promise; //# sourceMappingURL=fetcher.d.ts.map