/** * The paper record every source maps into, the identifier parser, and the * text formatting the tools share. */ export type PaperSource = "openalex" | "arxiv" | "sportrxiv" | "crossref" | "zotero" | "local"; export declare const SOURCE_NAMES: Record; export type OpenCopy = { url: string; /** True when the URL is a PDF rather than a landing page. */ pdf: boolean; licence?: string; /** submittedVersion, acceptedVersion or publishedVersion, when the source says. */ version?: string; host?: string; }; export type PaperRecord = { source: PaperSource; title: string; authors: string[]; year?: number; date?: string; venue?: string; type?: string; ids: { doi?: string; arxiv?: string; openalex?: string; zotero?: string; }; /** The record's landing page. */ url?: string; abstract?: string; citedBy?: number; /** The licence of the record's own copy, where the source states one (arXiv, SportRxiv). */ licence?: string; oaStatus?: string; openCopies: OpenCopy[]; }; export type PaperId = { kind: "doi"; doi: string; } | { kind: "arxiv"; arxiv: string; } | { kind: "openalex"; openalex: string; } | { kind: "local"; key: string; } | { kind: "zotero"; key: string; } | { kind: "semantic-scholar"; value: string; } | { kind: "url"; url: string; } | { kind: "unknown"; value: string; }; export declare function normaliseDoi(value: string): string; export declare function parsePaperId(input: string): PaperId; /** Keys that identify the same paper across sources. */ export declare function identityKeys(record: PaperRecord): string[]; /** A readable name for a licence URL or code, keeping the URL when it is unknown. */ export declare function licenceName(value: string | undefined | null): string | undefined; /** A short summary of a record: title, authors, IDs, first open copy, start of the abstract. */ export declare function formatSummary(record: PaperRecord): string[]; /** One search hit: enough to choose which paper to open with get_paper. */ export declare function formatHit(record: PaperRecord, index: number): string; /** A citation line in author-year form, built only from the record's fields. */ export declare function citeAs(record: PaperRecord): string; /** The full record for get_paper. */ export declare function formatRecord(record: PaperRecord): string;