/** * Format detection module for multi-format import * * Detects input format based on: * - File extension (.json, .bib, .ris) * - Content patterns (JSON, BibTeX, RIS) * - Identifier patterns (PMID, DOI) * - Multiple whitespace-separated identifiers */ /** * Supported input formats */ export type InputFormat = "json" | "bibtex" | "ris" | "nbib" | "pmid" | "doi" | "isbn" | "arxiv" | "url" | "identifiers" | "unknown"; /** * Detect the format of the given input * * @param input - File path, identifier, or empty string for stdin * @param content - Optional content to analyze (for stdin or unknown extension) * @returns Detected format */ export declare function detectFormat(input: string, content?: string): InputFormat; /** * Detect format based on file extension */ export declare function detectByExtension(input: string): InputFormat; /** * Detect format based on content patterns */ export declare function detectByContent(content: string): InputFormat; /** * Detect if a single string is a PMID, DOI, or ISBN */ export declare function detectSingleIdentifier(input: string): "pmid" | "doi" | "isbn" | "arxiv" | "url" | "unknown"; /** * Try to extract a PMID or PMCID from a PubMed/PMC URL. * Returns the extracted identifier string or null if not a PubMed URL. */ export declare function extractPubmedId(input: string): string | null; /** * Check if input is an http/https URL that is not already matched as a known identifier (DOI, arXiv, PubMed). */ export declare function isUrl(input: string): boolean; /** * Check if string is a valid DOI */ export declare function isDoi(input: string): boolean; /** * Check if string is a valid PMID (numeric only) */ export declare function isPmid(input: string): boolean; /** * Check if string is a valid ISBN (requires ISBN: prefix) * * ISBN must have ISBN: prefix and be either: * - ISBN-13: 13 digits * - ISBN-10: 10 digits (last may be X) */ export declare function isIsbn(input: string): boolean; /** * arXiv ID pattern: YYMM.NNNNN or YYMM.NNNN with optional version suffix */ export declare const ARXIV_ID_PATTERN: RegExp; /** * Check if input is an arXiv identifier. * * Matches: * - Bare IDs: 2301.13867, 2301.13867v2 * - Prefixed: arXiv:2301.13867 * - URLs: https://arxiv.org/abs/2301.13867 */ export declare function isArxiv(input: string): boolean; //# sourceMappingURL=detector.d.ts.map