import type { MentionParseResult } from './reference-mention.js'; import type { Concept } from './models/concept.js'; type RefType = 'concept' | 'bibliography' | 'figure' | 'table' | 'formula' | 'dataset' | 'typed-ref' | 'standard'; export type CitationClassification = 'internal-citation' | 'external-citation' | 'self-contained-citation' | 'unresolved-citation'; export interface CitationInput { /** The cite key, e.g. `foo` from `{{cite:foo}}` */ key?: string | null; /** The source id from the concept's sources array */ sourceId?: string | null; /** Optional explicit citation object (with ref.source/ref.id) */ ref?: { source?: string | null; id?: string | null; version?: string | null; } | null; /** Optional external link URL */ link?: string | null; } export interface CiteResolution { classification: CitationClassification; resolved: { registerId: string; conceptId: string; } | null; } interface ReferenceExtras { uri?: string | null; citation?: unknown; sourceId?: string | null; resolution?: Record | null; lookupKey?: Record | null; } export declare class Reference { type: RefType; target: string; relationship: string | null; source: string | null; uri: string | null; citation: unknown; sourceId: string | null; resolution: Record | null; lookupKey: Record | null; constructor(type: RefType, target: string, relationship?: string | null, source?: string | null, extras?: ReferenceExtras); get dedupKey(): [RefType, unknown]; } type Registry = Record; export declare function resolveBibliographyRecord(citationRef: { source?: string; id?: string; version?: string; } | null | undefined, registry: Registry): unknown; export declare function findNonVerbalEntity(ref: { lookupKey?: { entityType?: string; entityId?: string; } | null; }, registry: Registry): unknown; export declare class ReferenceResolver { /** * The canonical citation resolution entry point. * * Walks the cascade: sourceRefs → routing → citation.link → unresolved. * Both classification and navigation target come from this one call, * so they can never disagree. * * Classification mapping: * internal-citation — the citation resolves to a concept in the * same dataset (sourceDatasetId matches) * external-citation — the citation resolves to a concept in a * different known dataset (routing entry) * self-contained-citation — the citation has a flat bib record * (citation.link present, no concept resolution) * unresolved-citation — no match in any source */ resolveCite(citation: CitationInput, sourceDatasetId?: string | null): CiteResolution; extractReferences(concept: Concept): Reference[]; _dedup(refs: Reference[]): Reference[]; _extractFromText(text: string, source: string, concept: Concept): Reference[]; _resolveCiteRef(parsed: MentionParseResult, source: string, concept: Concept): Reference; resolveReference(ref: Reference | null, registry: Registry | null): unknown; _resolveNonVerbal(ref: Parameters[0], registry: Registry): unknown; _resolveConcept(ref: Reference, registry: Registry): unknown; _resolveBibliography(ref: Reference, registry: Registry): unknown; _resolveDataset(_ref: Reference, _registry: Registry): null; _resolveTypedRef(_ref: Reference, _registry: Registry): null; _resolveStandard(_ref: Reference, _registry: Registry): null; resolveAll(concept: Concept, registry: Registry): Map; } export declare const referenceResolver: ReferenceResolver; export {}; //# sourceMappingURL=reference-resolver.d.ts.map