/** * Reading papers: find a readable copy, keep its text in the user's library, * and return it by the rules for its access: * - open copies (arXiv, open repositories, open-access publishers, SportRxiv) * come back in full, by section; * - papers the user supplied (a file or a Zotero item) come back as an * outline and passages of at most FOOTBALL_DOCS_PAPERS_PASSAGE_CHARS * characters (default 200). * * football-docs never logs in to a publisher or library, never holds the * user's credentials or cookies, and stops at bot checks. */ import { type PaperContext, type ServiceLog } from "./core.js"; import { type Access, passageChars, type StoredPaper } from "./library.js"; import { type PaperId, type PaperRecord } from "./records.js"; import { outline, type QuoteMatch, type Section } from "./text.js"; import { type Lookup } from "./web.js"; export type Resolved = { record: PaperRecord; published?: PaperRecord; }; /** Metadata for a DOI, arXiv ID or OpenAlex ID. Null when no source knows it. */ export declare function resolveRecord(ctx: PaperContext, id: Extract, log: ServiceLog): Promise; /** A record for a library entry, for get_paper. */ export declare function recordFromEntry(entry: StoredPaper): PaperRecord; export type Loaded = { entry: StoredPaper; fromLibrary: boolean; }; /** The library entry for an ID: from the library, else read now. Returns an error message instead of throwing. */ export declare function loadPaper(ctx: PaperContext, rawId: string, log: ServiceLog, lookup?: Lookup): Promise; export declare function entryHeader(entry: StoredPaper, cap: number): string[]; /** Passages for a query across sections, labelled with their section. */ export declare function sectionPassages(sections: Section[], query: string, cap: number, limit?: number): string[]; export type QuoteResult = { match: QuoteMatch; section: number; heading: string; page?: number; }; export declare function bestQuoteMatch(sections: Section[], quote: string): QuoteResult | null; /** The report for a quote match. For user papers, every piece of source text stays within cap characters. */ export declare function quoteReport(sections: Section[], quote: string, access: Access, cap: number): string[]; export { outline, passageChars };