/** * Citations in the build (#268–#272, #277): each citation span is formatted * by the registered processor against its book's context and replaced by * its text — linked to its bibliography entry — or, under a note style, by * a footnote marker whose note holds it; `:::bibliography` (or the end of * the book) receives the list of works; `:::references` blocks leave the * flow. A citation the book has no reference for prints as written. */ import type { ContentBlock, InlineSpan } from '../parse/index.js'; import type { ResolvedConfig } from '../vdt.js'; import type { ResolvedParagraphStyleConfig } from '../types.js'; import { type CitationContext } from '../citations/context.js'; import type { BibliographyEntryOutput, CitationProcessor } from '../citations/types.js'; /** Id of the paragraph style the bibliography is set in. */ export declare const BIBLIOGRAPHY_STYLE_ID = "__postext-bibliography"; /** Prefix of the anchor of a bibliography entry: `ref-`, as Pandoc * names it. */ export declare const BIBLIOGRAPHY_ANCHOR_PREFIX = "ref-"; /** Prefix of the footnote a note style sets a citation in. */ export declare const CITATION_NOTE_PREFIX = "__cite-"; /** The title a bibliography takes in a document language. */ export declare function defaultBibliographyTitle(locale: unknown): string; /** The CSL locale citations are written in: the configured one, else the * document language (`es` → `es-ES`, `zh-Hant` → `zh-TW`, `ar-EG` → * `ar`, `ja` → `ja-JP`). */ export declare function citationLocale(resolved: ResolvedConfig, documentLocale: string | undefined): string; /** What processing a book's citations gives. */ export interface ProcessedCitations { processor: CitationProcessor; /** Formatted spans of each cluster of the context (undefined: no known * work in it). */ formatted: (InlineSpan[] | undefined)[]; /** The keys of each cluster no reference defines. */ unknown: string[][]; /** The first known work of each cluster: where its link goes. */ target: (string | undefined)[]; /** Every work the bibliography lists for the whole book, in order. */ entries: BibliographyEntryOutput[]; /** With `citations.numbering: 'chapter'` (#537): each chapter's list * (the works it cites, labelled with its own numbers), by the chapter * index of `CitationContext.chapters`. */ chapterEntries?: ReadonlyMap; numbered: boolean; hangingIndent: boolean; labelColumn: boolean; } /** * Format every citation of a book and its bibliography (memoised by the * context and the settings: the chapters of a book share one run). Null * without a citation engine, or with no reference at all. */ export declare function processCitations(ctx: CitationContext, resolved: ResolvedConfig, locale: string): ProcessedCitations | null; /** The paragraph style of the bibliography: body face at the configured * size, the turnover lines hung under the first (by the label column for * a numbered list). `labelChars`: the longest label's length. */ export declare function bibliographyParagraphStyle(resolved: ResolvedConfig, labelChars: number): ResolvedParagraphStyleConfig; /** The configuration with the bibliography's paragraph style added. */ export declare function withBibliographyStyle(resolved: ResolvedConfig, labelChars: number): ResolvedConfig; /** A warning about the citations of a document (see `ContentWarning`). */ export interface CitationIssue { kind: 'unknownCitationKey' | 'citationsUnavailable' | 'referencesUnreadable'; key?: string; message?: string; sourceStart: number; sourceEnd: number; } /** What {@link applyCitations} gives the build. */ export interface AppliedCitations { blocks: ContentBlock[]; /** The longest bibliography label, in characters (0: unnumbered or no * bibliography): sizes the label column. */ labelChars: number; /** A bibliography was set in this document. */ bibliography: boolean; /** The formatted citations of the captions and notes of the resources * this document places (#529), by resource id: one entry per citation * in the caption's (the note's) text, undefined for one that prints as * written. Set plain: the caption's emphasis goes on when it is laid * out (see `resolveCitationSpans`). */ captions: Map; } /** The formatted citations of a resource's caption and note. */ export interface CaptionCitations { caption: (InlineSpan[] | undefined)[]; note: (InlineSpan[] | undefined)[]; } /** `spans` with each citation span replaced by its formatted text from * `formatted`, in order, with the emphasis of the text around it; a * citation with none prints as written. */ export declare function resolveCitationSpans(spans: InlineSpan[], formatted: readonly (InlineSpan[] | undefined)[] | undefined): InlineSpan[]; /** * Format the citations of a document's blocks, set its bibliography and * drop its `:::references` blocks. `ctx` places the document in its book; * `processed` is the book's formatted citations (null: none can be * formatted, and every citation prints as written). */ export declare function applyCitations(blocks: readonly ContentBlock[], ctx: CitationContext, processed: ProcessedCitations | null, resolved: ResolvedConfig, locale: string | undefined): AppliedCitations; /** The issues of a document's citations, for the content warnings. */ export declare function citationIssues(blocks: readonly ContentBlock[], ctx: CitationContext, bookKeys?: ReadonlySet): CitationIssue[]; //# sourceMappingURL=citations.d.ts.map